We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 45fdc8a commit 214a1beCopy full SHA for 214a1be
sdp/processors/inference/nlp/fasttext/fasttext.py
@@ -110,7 +110,8 @@ def process_dataset_entry(self, data_entry: dict):
110
"""Applies the classifier to a single dataset entry."""
111
112
self._load_model()
113
- label, prob = self._model.predict(data_entry[self.text_field])
+ text = data_entry[self.text_field].strip().replace("\n", " ")
114
+ label, prob = self._model.predict(text)
115
data_entry[self.output_field] = label[0].replace('__label__', '')
116
data_entry[f"{self.output_field}_prob"] = prob[0]
117
0 commit comments