Spaces:
Runtime error
Runtime error
fixed N/A bug
Browse files
textclassifier/TextClassifier.py
CHANGED
@@ -112,7 +112,7 @@ class TextClassifier:
|
|
112 |
# Sometimes GPT-3 gives faulty results, so a simple filter is introduced
|
113 |
# If the prediction is bad
|
114 |
# -> set target value to N/A (not applicable)
|
115 |
-
if len(analyzed_sentiment) >
|
116 |
analyzed_sentiment = "N/A"
|
117 |
|
118 |
# An attempt to merge target responses that should be the same
|
@@ -174,8 +174,8 @@ if __name__ == "__main__":
|
|
174 |
|
175 |
warnings.simplefilter(action='ignore', category=FutureWarning)
|
176 |
pd.set_option('display.max_columns', None)
|
177 |
-
tc = TextClassifier(model_name="text-davinci-002", from_date='2022-
|
178 |
-
to_date=str(date.today()), user_name='jimmieakesson', num_tweets=
|
179 |
print(tc)
|
180 |
# df = tc.classify_sentiment_of_tweets("jimmieakesson")
|
181 |
# print(df)
|
|
|
112 |
# Sometimes GPT-3 gives faulty results, so a simple filter is introduced
|
113 |
# If the prediction is bad
|
114 |
# -> set target value to N/A (not applicable)
|
115 |
+
if len(analyzed_sentiment) > 50:
|
116 |
analyzed_sentiment = "N/A"
|
117 |
|
118 |
# An attempt to merge target responses that should be the same
|
|
|
174 |
|
175 |
warnings.simplefilter(action='ignore', category=FutureWarning)
|
176 |
pd.set_option('display.max_columns', None)
|
177 |
+
tc = TextClassifier(model_name="text-davinci-002", from_date='2022-01-01',
|
178 |
+
to_date=str(date.today()), user_name='jimmieakesson', num_tweets=60)
|
179 |
print(tc)
|
180 |
# df = tc.classify_sentiment_of_tweets("jimmieakesson")
|
181 |
# print(df)
|