nlp_architect.api package

Submodules

nlp_architect.api.abstract_api module

class nlp_architect.api.abstract_api.AbstractApi[source]

Bases: object

Abstract class for API’s to the server

inference(doc)[source]
load_model()[source]

nlp_architect.api.base module

class nlp_architect.api.base.ModelAPI(model_path: str = None)[source]

Bases: object

Base class for a model API implementation Implementing classes must provide a default model and/or a path to a model

Parameters:model_path (str) – path to a trained model

run method must return

default_model = None
load_model(model_path: str)[source]
run(inputs: Union[str, List[str]]) → Dict[source]

nlp_architect.api.bist_parser_api module

class nlp_architect.api.bist_parser_api.BistParserApi[source]

Bases: nlp_architect.api.abstract_api.AbstractApi

Bist Parser API

inference(doc)[source]

Parse according to SpacyBISTParser’s model

Parameters:doc (str) – the doc str
Returns:the parser’s response hosted in CoreNLPDoc object
Return type:CoreNLPDoc
load_model()[source]

Load SpacyBISTParser model

nlp_architect.api.intent_extraction_api module

class nlp_architect.api.intent_extraction_api.IntentExtractionApi(prompt=False)[source]

Bases: nlp_architect.api.abstract_api.AbstractApi

static display_results(text_str, predictions, intent_type)[source]
inference(doc)[source]
load_model()[source]
model_dir = '/home/runner/nlp-architect/cache/intent-pretrained'
pretrained_model = '/home/runner/nlp-architect/cache/intent-pretrained/model.h5'
pretrained_model_info = '/home/runner/nlp-architect/cache/intent-pretrained/model_info.dat'
process_text(text)[source]
vectorize(doc, vocab, char_vocab=None)[source]

nlp_architect.api.ner_api module

class nlp_architect.api.ner_api.NerApi(prompt=False)[source]

Bases: nlp_architect.api.abstract_api.AbstractApi

NER model API

inference(doc)[source]
load_model()[source]
model_dir = '/home/runner/nlp-architect/cache/ner-pretrained'
pretrained_model = '/home/runner/nlp-architect/cache/ner-pretrained/model_v4.h5'
pretrained_model_info = '/home/runner/nlp-architect/cache/ner-pretrained/model_info_v4.dat'
static pretty_print(text, tags)[source]
process_text(text)[source]
vectorize(doc, vocab, char_vocab)[source]

Module contents