Identifies terms within a text using basic (as opposed to deep-learning) techniques
-
After installing NeuralCR, copy the files
basic_text_matcher.py
andbasic_text_matcher_flask_loader.py
to the NeuralCR directory. -
Edit the file
app.py
adding the linesimport basic_text_matcher
andimport basic_text_matcher_flask_loader
to immediately below the lineimport ncrmodel_flask_loader
. -
Register the basic model loader by adding the line
MODEL_LOADERS['basic'] = basic_text_matcher_flask_loader.loadfromrequest
to immediately below the lineMODEL_LOADERS['neural'] = ncrmodel_flask_loader.loadfromrequest
.
-
NCRModel
interface conforming BasicCR models can be instantiated by callingbasic_text_matcher.BasicTextMatcher(id_file, title_file)
whereid_file
is the file path to a JSON file of an object that maps different names to a common identifier, andtitle_file
is the file path to a JSON file of an object that maps these common identifers to their human readable names. -
If
app.py
is started with the--allow_model_put
flag, BasicCR models can be instantiated through the REST API by making a HTTP PUT request to/models/<new model name>
with the arguments of:model_type
=basic
id_file
= same as above describedid_file
argumenttitle_file
= same as above describedtitle_file
argument