Spaces:
Runtime error
Runtime error
Fix Text Preprocessor
Browse files
Videobook/TextPreprocessor.py
CHANGED
@@ -54,9 +54,10 @@ class TextPreprocessor:
|
|
54 |
return {'pos':positive, 'neg': negative}
|
55 |
|
56 |
def __call__(self, text):
|
|
|
57 |
coref_text = self.coref(text)
|
58 |
sentences = nltk.sent_tokenize(coref_text)
|
59 |
processed_sentences = []
|
60 |
for sentence in sentences:
|
61 |
processed_sentences.append(self.neg_prompt(sentence))
|
62 |
-
return processed_sentences,
|
|
|
54 |
return {'pos':positive, 'neg': negative}
|
55 |
|
56 |
def __call__(self, text):
|
57 |
+
old_sentences = nltk.sent_tokenize(text)
|
58 |
coref_text = self.coref(text)
|
59 |
sentences = nltk.sent_tokenize(coref_text)
|
60 |
processed_sentences = []
|
61 |
for sentence in sentences:
|
62 |
processed_sentences.append(self.neg_prompt(sentence))
|
63 |
+
return processed_sentences, old_sentences
|