A simple Language model having features such as Autocomplete, Spell Check, Word Segmenter, Custom Entity Tagger, Nearest Words.
- Autocomplete : predict the future words/sentences on the basis of given words/letters.
- Spell Check : Returns the correct candididates word for the entered wrong word.
- Entity Tagger : Returns the entities in a given correct or disambiguated query, along with the domains to which they belongs.
- Word Segmenter : Returns the segmented words from given joined query/sentence.
- Nearest words :Returns the nearest words to the given word.
$ git clone https://github.com/codeorbit/Language_Model
$ cd Language_Model && pip install -r requirements.txt
Fire it up! 🌋
$ python api.py
Created api calls for each features which returns result as json.
-
List of api : Request
http://localhost:7777/language_model/
- Result : will show all api call urls.
-
Autocomplete : Request
http://localhost:7777/language_model/autocomplete/<name>
wherename
will be word/sentence/letter (without angle brackets).- Result : list of words or sentences which can come after the given word/sentence/letter in decreasing order of their probability.
-
Spell Check : Request
http://localhost:7777/language_model/spellcheck/<name>
wherename
will be incorrect word (wihtout angle brackets).- Result : list of correct candidate words for entered incorrect word.
-
Word Segmenter : Request
http://localhost:7777/language_model/wordsegment/<name>
wherename
will be joined words or sentences (without angle brackets) for e.g.googlegmail
.- Result : Returns the list of segmented words for e.g.
[google,gmail]
.
- Result : Returns the list of segmented words for e.g.
-
Entity Tagger : Request
http://localhost:7777/language_model/getentity/<name>
wherename
will be sentences or words after removing stopwords.- Result : Returns given query, tagged entities, and their domains and disambiguation link.
-
Nearest Words : Request
http://localhost:7777/language_model/nearestword/<name>
wherename
will be word for which nearest needs to be find.- Result : Returns list of top 5 nearest words.
- Alternate : Request
http://localhost:7777/language_model/nearestword/<name>/<top_n>
wheretop_n
will be integer. This will returntop_n
nearest results.
You can tweet me if you can't get it to work. In fact, you should tweet me anyway.