Demea9000 commited on
Commit
c5f746c
1 Parent(s): fa0430c

fixed N/A bug

Browse files
Files changed (1) hide show
  1. textclassifier/TextClassifier.py +3 -3
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) > 10:
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-07-01',
178
- to_date=str(date.today()), user_name='jimmieakesson', num_tweets=15)
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)