1
Fork 0
mirror of https://github.com/Steffo99/unimore-bda-6.git synced 2024-11-25 17:24:20 +00:00
bda-6-steffo/unimore_bda_6/__main__.py

27 lines
739 B
Python
Raw Normal View History

2023-02-01 16:46:25 +00:00
from .config import config
2023-02-02 01:56:37 +00:00
from .database import mongo_reviews_collection_from_config, get_training_reviews, get_test_reviews
from .analysis.vanilla import VanillaReviewSA
2023-02-01 16:46:25 +00:00
from .log import install_log_handler
2023-02-01 03:20:09 +00:00
2023-02-01 01:33:42 +00:00
def main():
2023-02-02 01:56:37 +00:00
with mongo_reviews_collection_from_config() as reviews:
training_reviews = get_training_reviews(collection=reviews)
test_reviews = get_test_reviews(collection=reviews)
model = VanillaReviewSA()
model.train(training_reviews)
evaluation = model.evaluate(test_reviews)
print(evaluation)
while True:
classification = model.use(input())
print(classification)
2023-02-01 01:33:42 +00:00
if __name__ == "__main__":
2023-02-01 16:46:25 +00:00
install_log_handler()
config.proxies.resolve()
2023-02-01 01:33:42 +00:00
main()