Skip to content

Graduation project for a bachelor's degree in informatics engineering (Artificial Intelligence specialization).

Notifications You must be signed in to change notification settings

AliHaiderAhmad001/Stacked-Embeddings-and-Ensemble-Model-based-Sequence-Labeling-for-Aspect-Extraction

Repository files navigation

Stacked-Embeddings-and-Ensemble-Model-based-Sequence-Labeling-for-Aspect-Extraction

One key task of fine-grained sentiment analysis of product reviews is to extract product aspects or features that users have expressed opinions on. Aspect extraction is an important task in sentiment analysis (Hu and Liu, 2004) and has many applications (Liu, 2012). It aims to extract opinion targets (or aspects) from opinion text. In product reviews, aspects are product attributes or features. For example, from “Its speed is incredible” in a laptop review, it aims to extract “speed”.

The aim of the project

Graduation project for a bachelor's degree in informatics engineering (Artificial Intelligence specialization).

Task

Given a sentence, the task is to extract aspects. Here is an example:

"I like the battery life of this phone"

Converting this sentence to IOB would look like this -

I O
like O
the O
battery B-A
life I-A
of O
this O
phone O

Environment

All code are tested under python 3.9.8 + tensorflow 2.9.1

Dependencies

  • python 3.9.8
  • tensorflow 2.9.1
  • transformers 4.21.1
  • seqeval 1.2.2
  • flairNLP 0.11

Work steps:

  1. Download Datasets: Datasets are in xml format
  1. Extract data from XML files and store in IOB files using "adapter.py"
  2. Generate embeddings using "prep_final_data.py".
  3. Train the SE-EM models using "train.py".
  4. Evaluate the trained models using "evaluation.py".

Results

Dataset F1-Score
Restaurants SemEval-14 89.3
Restaurants SemEval-16 79.8
Laptops SemEval-14 83.6

About

Graduation project for a bachelor's degree in informatics engineering (Artificial Intelligence specialization).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published