https://github.com/mkcor/caption-words
Utility to find specific or over-represented words in (technical) documents (pages, documentation...)
https://github.com/mkcor/caption-words
Last synced: 4 months ago
JSON representation
Utility to find specific or over-represented words in (technical) documents (pages, documentation...)
- Host: GitHub
- URL: https://github.com/mkcor/caption-words
- Owner: mkcor
- License: other
- Created: 2015-04-12T18:17:59.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2018-01-28T22:40:38.000Z (over 8 years ago)
- Last Synced: 2025-02-21T12:44:49.002Z (over 1 year ago)
- Language: HTML
- Size: 2.5 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# caption-words
Utility to find specific or over-represented words in (technical) documents (pages, documentation...)
This module lets you find the tf-idf of words in a web page
(see [Wikipedia](http://en.wikipedia.org/wiki/Tf%E2%80%93idf)).
The idea is to find the words that most represent the content of this page
wrt to a general use of the language (here, English).
## Setup
$ virtualenv --python=python3.6 ~/.virtualenv/caption-words
$ source ~/.virtualenv/caption-words/bin/activate
$ pip install -r requirements.txt
$ deactivate
## Data
Download `nltk` data into a system-wide directory:
$ sudo python -m nltk.downloader -d /usr/share/nltk_data all
Input files are provided for convenience.
### Frequency Word Lists
[https://invokeit.wordpress.com/frequency-word-lists/](https://invokeit.wordpress.com/frequency-word-lists/)
$ unzip en-2012.zip
### Test file
File `test.html` is page [https://docs.python.org/3/](https://docs.python.org/3/).
## Running
You can run `term_frequency.py` as a standalone script:
$ source ~/.virtualenv/caption-words/bin/activate
$ python term_frequency.py