mirror of
https://github.com/Steffo99/unimore-bda-6.git
synced 2024-11-25 09:14:19 +00:00
29 lines
885 B
Python
29 lines
885 B
Python
import logging
|
|
|
|
from .config import config
|
|
from .database import mongo_reviews_collection_from_config, get_training_reviews, get_test_reviews
|
|
from .analysis.vanilla import VanillaReviewSA
|
|
from .analysis.potts import PottsReviewSA
|
|
from .log import install_log_handler
|
|
|
|
log = logging.getLogger(__name__)
|
|
|
|
|
|
def main():
|
|
with mongo_reviews_collection_from_config() as reviews:
|
|
training_reviews = get_training_reviews(collection=reviews)
|
|
test_reviews = get_test_reviews(collection=reviews)
|
|
|
|
vanilla = VanillaReviewSA()
|
|
vanilla.train(training_reviews)
|
|
log.info("Vanilla evaluation results: %s", vanilla.evaluate(test_reviews))
|
|
|
|
potts = PottsReviewSA()
|
|
potts.train(training_reviews)
|
|
log.info("Potts evaluation results: %s", potts.evaluate(test_reviews))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
install_log_handler()
|
|
config.proxies.resolve()
|
|
main()
|