Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
nlp_artifacts=nlp_artifacts,
word=text[result.start:result.end],
start=result.start)
context_similarity = self.__calculate_context_similarity(
context, predefined_context_words)
if context_similarity >= \
self.CONTEXT_SIMILARITY_THRESHOLD:
result.score += \
context_similarity * self.CONTEXT_SIMILARITY_FACTOR
result.score = max(
result.score,
self.MIN_SCORE_WITH_CONTEXT_SIMILARITY)
result.score = min(
result.score,
EntityRecognizer.MAX_SCORE)
return results