Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def build_text_manual(self, record):
text = record[Constants.TEXT_FIELD]
sentences = nlp_utils.get_sentences(text)
lemmatized_words = []
for sentence in sentences:
lemmatized_words.append(nlp_utils.lemmatize_sentence(
sentence, nltk.re.compile(''),
min_length=1, max_length=100))
doc_parts = []
itemize = Itemize()
for sentence in lemmatized_words:
new_words = []
itemize.add_item('')
for tagged_word in sentence:
tag = tagged_word[1]
word = tagged_word[0]
singular = pattern.text.en.singularize(word)