predictvocabularyterms module

class predictvocabularyterms.PredictVocabularyTermsResource

Bases: Resource

methods: ClassVar[Optional[Collection[str]]] = {'POST'}

The methods this view is registered for. Uses the same default (["GET", "HEAD", "OPTIONS"]) as route and add_url_rule by default.

post()

takes a set of words and add them to a specific header’s vocabulary

Parameters:
  • header (str) – which vocabulary

  • writting_strings (list) – list of strings for which to provide nearest neighbors (NN prediction done on each)

  • neighbors_to_retrieve (int) – how many neighbors to provide

Returns:

a list of records lists, where each record is the vocab term matched to, distance, etc

Return type:

list

Examples

{

“header”:”species”, “written_strings”:[“musk muskulus”,”homo”], “neighbors_to_retrieve”:100

}