Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# run the nlp pipeline over the given text, store the results in
# a NlpArtifacts instance
nlp_artifacts = self.nlp_engine.process_text(text, language)
results = []
for recognizer in recognizers:
# Lazy loading of the relevant recognizers
if not recognizer.is_loaded:
recognizer.load()
recognizer.is_loaded = True
# analyze using the current recognizer and append the results
current_results = recognizer.analyze(text, entities, nlp_artifacts)
if current_results:
results.extend(current_results)
return AnalyzerEngine.__remove_duplicates(results)