Skip to content
Python script to recommend tags, given a text input
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Python script to recommend tags, given a text input





This script is built on nltk and textplob and should be invoked using python3. To install nltk and textblob:

pip3 install nltk

pip3 install textblob

To then invoke the script, call it from where it's installed (/Users/shared/tagger in the below example) and provide a --file option with the path and a --tags option to define how many tags to respond with, as follows:

python3 /Users/shared/tagger/ --file='/Users/ce/Downloads/tagger/test.txt' --tags=5

The response will be the number of tags, delimited with a end of line.

Future work

If you were to put this into production, I'd add a model json file to replace stop_code in the code, that could then be used to further train it. This is really just using the natural language toolkit to isolate top meaninful words but looking at each industry something like this could be used in, there are lots of sets that can obtained in an automated fashion using nltk or other sources and then trained to make the output more specific for the intended use case.

You can’t perform that action at this time.