Git Product home page Git Product logo

aspect-term-extraction-and-analysis's Introduction

Aspect-based Sentiment Analysis

model:

  • Bert for Aspect Term Extraction:
  • Bert for Aspect-based Sentiment Analysis:

dataset:

  • SemEval-2014 task4:
    • Laptops:
      • train: 2327
      • test: 636
    • Restaurants:
      • train: 3602
      • test: 1119
    • twitter:
      • train: 6247
      • test: 691


performance:

  • Aspect Term Extraction:
0: unrelated
1: start of aspect term
2: mark of aspect term

Wall time: 23.1 s
              precision    recall  f1-score   support

           0       0.99      0.99      0.99    140373
           1       0.84      0.92      0.88      6486
           2       0.93      0.73      0.82      3837

    accuracy                           0.98    150696
   macro avg       0.92      0.88      0.90    150696
weighted avg       0.99      0.98      0.98    150696
  • Aspect-based Sentiment Analysis
0: negative
1: neutral
2: postive

Wall time: 10.1 s
              precision    recall  f1-score   support

           0       0.72      0.75      0.74       497
           1       0.67      0.74      0.70       710
           2       0.89      0.83      0.86      1239

    accuracy                           0.79      2446
   macro avg       0.76      0.77      0.77      2446
weighted avg       0.79      0.79      0.79      2446

test case:

  • For the price you pay this product is very good. However, battery life is a little lack-luster coming from a MacBook Pro.
tokens: ['for', 'the', 'price', 'you', 'pay', 'this', 'product', 'is', 'very', 'good', '.', 'however', ',', 'battery', 'life', 'is', 'a', 'little', 'lack', '-', 'lust', '##er', 'coming', 'from', 'a', 'mac', '##book', 'pro', '.']
ATE: ['price', 'battery life']
term: ['price'] class: [2] ABSA: [-2.585547924041748, -1.6089690923690796, 3.54140567779541]
term: ['battery life'] class: [0] ABSA: [5.975338459014893, -2.6804981231689453, -2.68221116065979]
  • I think Apple is better than Microsoft.
tokens: ['i', 'think', 'apple', 'is', 'better', 'than', 'microsoft', '.']
ATE: ['apple', 'microsoft']
term: ['apple'] class: [1] ABSA: [-1.8246030807495117, 2.0324230194091797, 0.0777517780661583]
term: ['microsoft'] class: [0] ABSA: [2.3918569087982178, 0.8508685231208801, -2.396061897277832]
  • Cyberpunk 2077 freezes constantly, frame rates are terrible, and it's extremely frustrating to try to play.
tokens: ['cyber', '##pu', '##nk', '207', '##7', 'freeze', '##s', 'constantly', ',', 'frame', 'rates', 'are', 'terrible', ',', 'and', 'it', "'", 's', 'extremely', 'frustrating', 'to', 'try', 'to', 'play', '.']
ATE: ['cyberpu', 'frame rates']
term: ['cyberpu'] class: [0] ABSA: [4.44415283203125, -0.36560752987861633, -3.3459084033966064]
term: ['frame rates'] class: [0] ABSA: [5.2562408447265625, -2.305537700653076, -2.0652124881744385]

aspect-term-extraction-and-analysis's People

Contributors

1tangerine1day avatar hackmd-deploy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

aspect-term-extraction-and-analysis's Issues

[Question] Train-Test data

Hello,
thank you for this amazing work... I have a question why did you merge all the data from different domains?

Thanks in advance!

Question regarding Dataset

Original dataset is different from given dataset. Can you please tell what tags and polity vectors signify. I just could not understand it.
Please help me out.

代码报错tokenizer = BertTokenizer.from_pretrained(pretrain_model_name)

您好,在执行train文件这行代码的时候报错,Traceback (most recent call last):
File "/home/liluoni/anaconda3/envs/py36torch17/lib/python3.6/site-packages/transformers/tokenization_utils_base.py", line 1750, in from_pretrained
use_auth_token=use_auth_token,
File "/home/liluoni/anaconda3/envs/py36torch17/lib/python3.6/site-packages/transformers/file_utils.py", line 1086, in cached_path
local_files_only=local_files_only,
File "/home/liluoni/anaconda3/envs/py36torch17/lib/python3.6/site-packages/transformers/file_utils.py", line 1265, in get_from_cache
"Connection error, and we cannot find the requested files in the cached path."
ValueError: Connection error, and we cannot find the requested files in the cached path. Please try again or make sure your Internet connection is on.
python-BaseException
请问您知道是什么原因吗,或者执行这个代码需要配置什么样的环境

环境问题

您好,可以问下代码的运行环境吗,python的版本之类的,因为在运行的时候总是会报错

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.