Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre-trained laptop classifier accuracy does not match what is stated in README #15

Closed
Aishwarya1023 opened this issue Aug 25, 2020 · 3 comments
Assignees

Comments

@Aishwarya1023
Copy link

Aishwarya1023 commented Aug 25, 2020

I replaced the domain and classifier in test_performance.py from restaurants to laptops and I get an accuracy of 0.38 (the accuracy stated in the README is 0.8)

This was the code:

import numpy as np
import aspect_based_sentiment_analysis as absa
from aspect_based_sentiment_analysis.training import ConfusionMatrix

def test_semeval_classification_laptops():
    examples = absa.load_examples(dataset='semeval',
                                  domain='laptop',
                                  test=True)
    nlp = absa.load('absa/bert-lapt-0.1')

    metric = ConfusionMatrix(num_classes=3)
    confusion_matrix = nlp.evaluate(examples, metric, batch_size=32)
    confusion_matrix = confusion_matrix.numpy()
    accuracy = np.diagonal(confusion_matrix).sum() / confusion_matrix.sum()

    print(confusion_matrix)
    print(accuracy)
@rolczynski
Copy link
Contributor

rolczynski commented Aug 25, 2020

hey @Aishwarya1023
thank you for this issue. In this snippet you use the post-trained language model absa/bert-lapt-0.1. Instead you should use this: absa/classifier-lapt-0.1. Please wait two weeks and the solution (the uploaded pretrained model) will be ready ☺️

@rolczynski rolczynski self-assigned this Aug 25, 2020
@Aishwarya1023
Copy link
Author

@rolczynski Sounds good! Please let me know here when it's ready. :) Great work btw!

@rolczynski
Copy link
Contributor

It's done - check it out 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants