A program to recursively construct a tree of related words based off of an initial word and a list of topics (can also specify no topics). The depth of the recursion is also specified by the user.
If using the command line, the tree will then be saved as a .png file in the root directory of the repository with the name 'root.png'.
If using the web application, the tree will be then be saved in 'static/images' as a png with the name being a concatenation of the current time with the initial word.
A demo of the web application can be found here: word-transversal.info.
- Requirements
- Setup and Running: Command Line
- Usage: Command Line
- Example
- Setup and Running: Web App
- Usage: Web App
- Licensing
- Credits
- Future Features
You must have Python 3 and pip installed to begin the setup process.
To install the necessary dependencies, run sudo python3 setup.py install
. After installing the dependencies, you can run the program
with python3 analyzer.py
or python3 analyzer.py --help
to get
usage information.
usage: analyzer.py [-h] [--initial INITIAL] [--topics TOPICS] --iterations
ITERATIONS [--breadth BREADTH]
optional arguments:
-h, --help show this help message and exit
--initial INITIAL, -s INITIAL
Initial word to start with
--topics TOPICS, -t TOPICS
Comma separated topic list to make sure the words are
roughly related to. Type 'None' for no topics
--iterations ITERATIONS, -i ITERATIONS
Number of iterations/depth to go down
--breadth BREADTH, -b BREADTH
Number of related words on each depth level
The following image is the output from: python3 analyzer.py --initial happy --iterations 4 -b 2 --topics emotion
To install the necessary dependencies, run sudo python3 setup.py develop
. After installing the dependencies, you can run the program
locally using FLASK_APP=web_app.py flask run -h '127.0.0.1'
on your local machine.
Open a browser and navigate to http://127.0.0.1:5000.
All files are licensed under GPL 2.0
Related words are found using the Datamuse API.
- Looking into further uses for this, including cognitive flexibility training
- Expanding the application to include a mode for the "meaning like" feature of the API