-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
19 lines (14 loc) · 824 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from yapp_classifier import YappClassifier
from utils.logger import ColorfulLogger
# EXAMPLE USAGE OF THE YAPPING CLASSIFIER MODEL
yapp_classifier = YappClassifier(model_path='./models/yapping_classifier_model',
tokenizer_path='./models/tokenizer.pickle',
stemmer_path='./models/stemmer.pickle')
if __name__ == '__main__':
input_text = input("Your yapp > ")
confidence = yapp_classifier.classify_yapp(input_text)
logger = ColorfulLogger.get_logger('logger')
logger.info(f"Positive Confidence: {confidence['positive'] * 100:.3f}%")
logger.error(f"Negative Confidence: {confidence['negative'] * 100:.3f}%")
classification = max(confidence, key=confidence.get)
logger.debug(f"The yapp is classified as a {classification} yapp")