def nlp(): the_nlp = NaturalLanguageProcessor(APP_PATH) try: the_nlp.load() except ClassifierLoadError as exc: raise ClassifierLoadError( "Could not load app. Have you built the models? " "Run 'python -m {} build' to do so.".format( os.path.split(APP_PATH[1]))) from exc return the_nlp
def diaglogflow_nlp(mindmeld_project_path2): nlp = NaturalLanguageProcessor(mindmeld_project_path2) nlp.build() return nlp
def skill_nlp(skill_dir) -> NaturalLanguageProcessor: # pylint: disable=redefined-outer-name """Provides a built processor instance""" nlp = NaturalLanguageProcessor(app_path=skill_dir) nlp.build() nlp.dump() return nlp
def rasa_nlp(rasa_converter, mindmeld_rasa_converter_app_path): nlp = NaturalLanguageProcessor(mindmeld_rasa_converter_app_path) nlp.build() return nlp
def rasa_nlp(mindmeld_project_path): nlp = NaturalLanguageProcessor(mindmeld_project_path) nlp.build() return nlp
def _skill_nlp(skill_dir) -> NaturalLanguageProcessor: """Provides a built processor instance""" nlp = NaturalLanguageProcessor(app_path=skill_dir) nlp.build() nlp.dump() return nlp