deberta-v3-base-absa-v1.1 / end2end_absa.py
yangheng's picture
Upload end2end_absa.py
e6e5dd0 verified
# -*- coding: utf-8 -*-
# File: end2end_absa.py
# Time: 18:44 12/08/2025
# Author: YANG, HENG <[email protected]> (杨恒)
# Website: https://yangheng95.github.io
# GitHub: https://github.com/yangheng95
# HuggingFace: https://huggingface.co/yangheng
# Google Scholar: https://scholar.google.com/citations?user=NPq5a_0AAAAJ&hl=en
# Copyright (C) 2019-2025. All rights reserved.
# ====== New/Replacement imports ======
from typing import List, Dict, Any
from transformers import (
AutoModelForSequenceClassification,
AutoTokenizer,
AutoModelForTokenClassification,
pipeline
)
import torch
import re
from pprint import pprint
# Device configuration
device = 0 if torch.cuda.is_available() else -1
# Model configurations
ASPECT_MODEL_ID = "yangheng/deberta-v3-base-end2end-absa"
SENTI_MODEL_ID = "yangheng/deberta-v3-base-absa-v1.1"
# When classifier's highest confidence < this threshold, optionally use extractor's ASP-XXX as fallback
USE_EXTRACTOR_SENTI_AS_FALLBACK = True
FALLBACK_CONFIDENCE_THRESHOLD = 0.8
# Maximum length and truncation strategy to avoid truncation warnings
TRUNCATION = True
MAX_LENGTH = 512 # Adjust based on GPU memory and text length
BATCH_SIZE = 16 # Batch size, adjust based on resources
# ================================
# Initialize tokenizer and model for aspect extraction
try:
tok_asp = AutoTokenizer.from_pretrained(SENTI_MODEL_ID, use_fast=True)
mdl_asp = AutoModelForTokenClassification.from_pretrained(ASPECT_MODEL_ID)
aspect_extractor = pipeline(
task="token-classification",
model=mdl_asp,
tokenizer=tok_asp,
aggregation_strategy="simple",
device=device,
)
except Exception as e:
print(f"Error loading aspect extraction models: {e}")
raise
# Initialize sentiment classifier (text_pair mode)
try:
sent_classifier = pipeline(
task="text-classification",
model=SENTI_MODEL_ID,
device=device,
return_all_scores=True, # Return all class scores for confidence
function_to_apply="softmax",
top_k=None
)
except Exception as e:
print(f"Error loading sentiment classification model: {e}")
raise
# --- Defensive fallback: when offset is missing, use substring search ---
def _clean_aspect(s: str) -> str:
"""Clean aspect string by removing leading/trailing punctuation and whitespace."""
if not s:
return ""
return re.sub(r'^[\s\.,;:!?\(\)\[\]\{\}"\']+|[\s\.,;:!?\(\)\[\]\{\}"\']+$', "", s).strip()
def _locate_span(text: str, phrase: str):
"""Locate the span of a phrase in text, with case-insensitive fallback."""
if not phrase:
return None
# Try exact match first
pat = re.escape(phrase)
m = re.search(pat, text)
if m:
return m.start(), m.end()
# Try case-insensitive match
m = re.search(pat, text, flags=re.IGNORECASE)
if m:
return m.start(), m.end()
return None
def extract_aspects_for_text(text: str) -> List[Dict[str, Any]]:
"""
Extract aspects from a single text using the aspect extraction model.
Args:
text: Input text to extract aspects from
Returns:
List of aspect dictionaries with position and metadata
"""
if not text.strip():
return []
try:
ents = aspect_extractor(text)
print(f"Raw entities extracted: {ents}") # Debug output
except Exception as e:
print(f"Error in aspect extraction for text '{text[:50]}...': {e}")
return []
aspects = []
seen = set()
for ent in ents:
label = (ent.get("entity_group") or "").lower()
print(f"Processing entity: {ent}, label: {label}") # Debug output
# More flexible label matching
if not any(keyword in label for keyword in ["asp", "aspect", "b-", "i-"]):
print(f"Skipping entity with label: {label}")
continue
word = _clean_aspect(ent.get("word", ""))
if not word: # Skip empty aspects
print(f"Skipping empty aspect")
continue
start = ent.get("start")
end = ent.get("end")
# Fallback: when offset is missing, relocate using substring search
if start is None or end is None:
loc = _locate_span(text, word)
if loc:
start, end = loc
else:
# Skip if position cannot be determined to avoid dirty data
print(f"Could not locate aspect '{word}' in text")
continue
# Avoid duplicates
key = (word.lower(), int(start), int(end))
if key in seen:
continue
seen.add(key)
aspect_dict = {
"aspect": word,
"start": int(start),
"end": int(end),
"extractor_label": ent.get("entity_group", ""),
"extractor_score": float(ent.get("score", 0.0)),
}
aspects.append(aspect_dict)
print(f"Added aspect: {aspect_dict}") # Debug output
print(f"Final aspects for text: {aspects}") # Debug output
return aspects
def classify_aspects(text: str, aspects: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
"""
Classify sentiment polarity for each (text, aspect) pair.
Since the aspect extractor already provides sentiment labels (ASP-Positive, etc.),
we can use those directly or optionally run additional classification.
Args:
text: Original text
aspects: List of aspect dictionaries
Returns:
List of aspects enriched with sentiment and confidence information
"""
if not aspects:
return []
enriched = []
for asp in aspects:
# Extract sentiment from the extractor label (ASP-Positive -> Positive)
extractor_label = asp.get("extractor_label", "")
extractor_confidence = asp.get("extractor_score", 0.0)
# Default values
sentiment = "Neutral"
confidence = extractor_confidence
prob_map = {"Positive": 0.33, "Negative": 0.33, "Neutral": 0.33}
# Parse sentiment from extractor label
if "-" in extractor_label:
_, maybe_sentiment = extractor_label.split("-", 1)
if maybe_sentiment.capitalize() in ("Positive", "Negative", "Neutral"):
sentiment = maybe_sentiment.capitalize()
# Create probability distribution with extractor confidence
prob_map = {
"Positive": confidence if sentiment == "Positive" else (1 - confidence) / 2,
"Negative": confidence if sentiment == "Negative" else (1 - confidence) / 2,
"Neutral": confidence if sentiment == "Neutral" else (1 - confidence) / 2
}
# Optionally run additional sentiment classification if confidence is low
if confidence < FALLBACK_CONFIDENCE_THRESHOLD:
try:
# Try additional classification
combined_input = f"{text} [SEP] {asp['aspect']}"
result = sent_classifier(
combined_input,
truncation=TRUNCATION,
max_length=MAX_LENGTH
)
if result and isinstance(result, list) and len(result) > 0:
if isinstance(result[0], dict):
best = max(result, key=lambda d: d.get("score", 0))
classifier_sentiment = best.get("label", sentiment)
classifier_confidence = float(best.get("score", confidence))
# Use classifier result if it has higher confidence
if classifier_confidence > confidence:
sentiment = classifier_sentiment
confidence = classifier_confidence
prob_map = {d.get("label", "Neutral"): float(d.get("score", 0)) for d in result}
except Exception as e:
print(f"Error in additional classification for aspect '{asp['aspect']}': {e}")
# Keep the extractor's result
enriched.append({
**asp,
"sentiment": sentiment,
"confidence": confidence,
"probability": prob_map
})
return enriched
def absa(texts: List[str]) -> List[Dict[str, Any]]:
"""
Main entry point: Extract aspects from each text and classify their sentiment polarity.
Args:
texts: List of input texts
Returns:
List of structured results for each text
"""
if not texts:
return []
results = []
for i, text in enumerate(texts):
if not isinstance(text, str):
print(f"Warning: Text at index {i} is not a string, skipping")
continue
try:
aspects = extract_aspects_for_text(text)
aspects = classify_aspects(text, aspects)
results.append({
"text": text,
"aspects": [a["aspect"] for a in aspects],
"positions": [[a["start"], a["end"]] for a in aspects],
"sentiments": [a["sentiment"] for a in aspects],
"confidence": [a["confidence"] for a in aspects],
"details": aspects # Preserve rich original information
})
except Exception as e:
print(f"Error processing text at index {i}: {e}")
results.append({
"text": text,
"aspects": [],
"positions": [],
"sentiments": [],
"confidence": [],
"details": []
})
return results
if __name__ == "__main__":
# Test samples in multiple languages
samples = [
"The user interface is brilliant, but the documentation is a total mess.",
# English
"这家餐厅的牛排很好吃,但是服务很慢。",
# Chinese (Simplified): The steak at this restaurant is delicious, but the service is slow.
"La batería es malísima, aunque la cámara está muy bien.",
# Spanish: The battery is terrible, although the camera is very good.
"Le film était captivant, mais la fin était décevante.",
# French: The movie was captivating, but the ending was disappointing.
"Das Auto ist sehr sparsam, aber die Sitze sind unbequem.",
# German: The car is very economical, but the seats are uncomfortable.
"Il design è elegante, però il software è pieno di bug.",
# Italian: The design is elegant, but the software is full of bugs.
"O hotel tem uma vista incrível, mas o café da manhã é fraco.",
# Portuguese: The hotel has an incredible view, but the breakfast is weak.
"Книга очень интересная, но перевод оставляет желать лучшего.",
# Russian: The book is very interesting, but the translation leaves much to be desired.
"このアプリは便利だけど、バッテリーの消費が激しい。",
# Japanese: This app is useful, but it drains the battery quickly.
"음식은 맛있었지만, 가격이 너무 비쌌어요.",
# Korean: The food was delicious, but the price was too expensive.
"الخدمة ممتازة، لكن الموقع صعب الوصول إليه.",
# Arabic: The service is excellent, but the location is hard to reach.
"फ़ोन का कैमरा शानदार है, लेकिन बैटरी लाइफ खराब है।",
# Hindi: The phone's camera is great, but the battery life is bad.
"De locatie is perfect, alleen is het personeel onvriendelijk.",
# Dutch: The location is perfect, however the staff is unfriendly.
"Boken är välskriven, men handlingen är förutsägbar.",
# Swedish: The book is well-written, but the plot is predictable.
"Grafika w grze jest niesamowita, ale fabuła jest nudna.",
# Polish: The graphics in the game are amazing, but the story is boring.
"Ürün kaliteli görünüyor ama kargo çok geç geldi.",
# Turkish: The product looks high quality, but the shipping was very late.
"Chất lượng âm thanh tốt, tuy nhiên tai nghe không thoải mái lắm.",
# Vietnamese: The sound quality is good, however the headphones are not very comfortable.
"การแสดงดีมาก แต่บทภาพยนตร์ค่อนข้างอ่อน",
# Thai: The acting was great, but the script was rather weak.
"Η τοποθεσία είναι φανταστική, αλλά το δωμάτιο ήταν πολύ μικρό.",
# Greek: The location is fantastic, but the room was very small.
"המשחק מהנה, אבל יש בו יותר מדי פרסומות.",
# Hebrew: The game is fun, but it has too many ads.
"Ponsel ini cepat, tetapi cenderung cepat panas.",
# Indonesian: This phone is fast, but it tends to get hot quickly.
"Ohjelma on tehokas, mutta käyttöliittymä on sekava.",
# Finnish: The program is powerful, but the user interface is confusing.
"Maden var lækker, men portionerne var for små.",
# Danish: The food was delicious, but the portions were too small.
"Počítač je rychlý, ale software je zastaralý.",
# Czech: The computer is fast, but the software is outdated.
]
print("Running ABSA analysis...")
try:
results = absa(samples)
print("\nResults:")
pprint(results, width=120)
except Exception as e:
print(f"Error running ABSA: {e}")
# >>>> # Example output:
"""
Running ABSA analysis...
Raw entities extracted: [{'entity_group': 'ASP-Neutral', 'score': np.float32(0.51754177), 'word': 'user interface', 'start': 3, 'end': 18}, {'entity_group': 'ASP-Negative', 'score': np.float32(0.52044636), 'word': 'documentation', 'start': 40, 'end': 54}]
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.51754177), 'word': 'user interface', 'start': 3, 'end': 18}, label: asp-neutral
Added aspect: {'aspect': 'user interface', 'start': 3, 'end': 18, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.517541766166687}
Processing entity: {'entity_group': 'ASP-Negative', 'score': np.float32(0.52044636), 'word': 'documentation', 'start': 40, 'end': 54}, label: asp-negative
Added aspect: {'aspect': 'documentation', 'start': 40, 'end': 54, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.5204463601112366}
Final aspects for text: [{'aspect': 'user interface', 'start': 3, 'end': 18, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.517541766166687}, {'aspect': 'documentation', 'start': 40, 'end': 54, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.5204463601112366}]
Raw entities extracted: [{'entity_group': 'ASP-Positive', 'score': np.float32(0.5346123), 'word': '牛排', 'start': 5, 'end': 7}, {'entity_group': 'ASP-Negative', 'score': np.float32(0.5622819), 'word': '服务', 'start': 13, 'end': 15}]
Processing entity: {'entity_group': 'ASP-Positive', 'score': np.float32(0.5346123), 'word': '牛排', 'start': 5, 'end': 7}, label: asp-positive
Added aspect: {'aspect': '牛排', 'start': 5, 'end': 7, 'extractor_label': 'ASP-Positive', 'extractor_score': 0.5346122980117798}
Processing entity: {'entity_group': 'ASP-Negative', 'score': np.float32(0.5622819), 'word': '服务', 'start': 13, 'end': 15}, label: asp-negative
Added aspect: {'aspect': '服务', 'start': 13, 'end': 15, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.5622819066047668}
Final aspects for text: [{'aspect': '牛排', 'start': 5, 'end': 7, 'extractor_label': 'ASP-Positive', 'extractor_score': 0.5346122980117798}, {'aspect': '服务', 'start': 13, 'end': 15, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.5622819066047668}]
Raw entities extracted: [{'entity_group': 'ASP-Neutral', 'score': np.float32(0.4336498), 'word': 'batería', 'start': 2, 'end': 10}, {'entity_group': 'ASP-Neutral', 'score': np.float32(0.44364822), 'word': 'cámara', 'start': 33, 'end': 40}]
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.4336498), 'word': 'batería', 'start': 2, 'end': 10}, label: asp-neutral
Added aspect: {'aspect': 'batería', 'start': 2, 'end': 10, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.43364980816841125}
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.44364822), 'word': 'cámara', 'start': 33, 'end': 40}, label: asp-neutral
Added aspect: {'aspect': 'cámara', 'start': 33, 'end': 40, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.44364821910858154}
Final aspects for text: [{'aspect': 'batería', 'start': 2, 'end': 10, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.43364980816841125}, {'aspect': 'cámara', 'start': 33, 'end': 40, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.44364821910858154}]
Raw entities extracted: [{'entity_group': 'ASP-Positive', 'score': np.float32(0.6539798), 'word': 'film', 'start': 2, 'end': 7}, {'entity_group': 'ASP-Negative', 'score': np.float32(0.41829002), 'word': 'fin', 'start': 32, 'end': 36}]
Processing entity: {'entity_group': 'ASP-Positive', 'score': np.float32(0.6539798), 'word': 'film', 'start': 2, 'end': 7}, label: asp-positive
Added aspect: {'aspect': 'film', 'start': 2, 'end': 7, 'extractor_label': 'ASP-Positive', 'extractor_score': 0.6539797782897949}
Processing entity: {'entity_group': 'ASP-Negative', 'score': np.float32(0.41829002), 'word': 'fin', 'start': 32, 'end': 36}, label: asp-negative
Added aspect: {'aspect': 'fin', 'start': 32, 'end': 36, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.41829001903533936}
Final aspects for text: [{'aspect': 'film', 'start': 2, 'end': 7, 'extractor_label': 'ASP-Positive', 'extractor_score': 0.6539797782897949}, {'aspect': 'fin', 'start': 32, 'end': 36, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.41829001903533936}]
Raw entities extracted: [{'entity_group': 'ASP-Neutral', 'score': np.float32(0.5750168), 'word': 'Auto', 'start': 3, 'end': 8}, {'entity_group': 'ASP-Neutral', 'score': np.float32(0.49865413), 'word': 'Sitze', 'start': 35, 'end': 41}]
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.5750168), 'word': 'Auto', 'start': 3, 'end': 8}, label: asp-neutral
Added aspect: {'aspect': 'Auto', 'start': 3, 'end': 8, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.5750167965888977}
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.49865413), 'word': 'Sitze', 'start': 35, 'end': 41}, label: asp-neutral
Added aspect: {'aspect': 'Sitze', 'start': 35, 'end': 41, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.4986541271209717}
Final aspects for text: [{'aspect': 'Auto', 'start': 3, 'end': 8, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.5750167965888977}, {'aspect': 'Sitze', 'start': 35, 'end': 41, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.4986541271209717}]
Raw entities extracted: [{'entity_group': 'ASP-Neutral', 'score': np.float32(0.6298937), 'word': 'design', 'start': 2, 'end': 9}, {'entity_group': 'ASP-Neutral', 'score': np.float32(0.605807), 'word': 'software', 'start': 29, 'end': 38}]
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.6298937), 'word': 'design', 'start': 2, 'end': 9}, label: asp-neutral
Added aspect: {'aspect': 'design', 'start': 2, 'end': 9, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.6298937201499939}
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.605807), 'word': 'software', 'start': 29, 'end': 38}, label: asp-neutral
Added aspect: {'aspect': 'software', 'start': 29, 'end': 38, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.6058070063591003}
Final aspects for text: [{'aspect': 'design', 'start': 2, 'end': 9, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.6298937201499939}, {'aspect': 'software', 'start': 29, 'end': 38, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.6058070063591003}]
You seem to be using the pipelines sequentially on GPU. In order to maximize efficiency please use a dataset
Raw entities extracted: [{'entity_group': 'ASP-Negative', 'score': np.float32(0.56500643), 'word': 'café', 'start': 37, 'end': 42}]
Processing entity: {'entity_group': 'ASP-Negative', 'score': np.float32(0.56500643), 'word': 'café', 'start': 37, 'end': 42}, label: asp-negative
Added aspect: {'aspect': 'café', 'start': 37, 'end': 42, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.56500643491745}
Final aspects for text: [{'aspect': 'café', 'start': 37, 'end': 42, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.56500643491745}]
Raw entities extracted: [{'entity_group': 'ASP-Neutral', 'score': np.float32(0.42165104), 'word': 'Кни', 'start': 0, 'end': 3}, {'entity_group': 'ASP-Neutral', 'score': np.float32(0.56838894), 'word': 'пере', 'start': 26, 'end': 31}]
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.42165104), 'word': 'Кни', 'start': 0, 'end': 3}, label: asp-neutral
Added aspect: {'aspect': 'Кни', 'start': 0, 'end': 3, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.42165103554725647}
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.56838894), 'word': 'пере', 'start': 26, 'end': 31}, label: asp-neutral
Added aspect: {'aspect': 'пере', 'start': 26, 'end': 31, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.5683889389038086}
Final aspects for text: [{'aspect': 'Кни', 'start': 0, 'end': 3, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.42165103554725647}, {'aspect': 'пере', 'start': 26, 'end': 31, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.5683889389038086}]
Raw entities extracted: [{'entity_group': 'ASP-Negative', 'score': np.float32(0.5808011), 'word': 'バッテリー', 'start': 12, 'end': 17}]
Processing entity: {'entity_group': 'ASP-Negative', 'score': np.float32(0.5808011), 'word': 'バッテリー', 'start': 12, 'end': 17}, label: asp-negative
Added aspect: {'aspect': 'バッテリー', 'start': 12, 'end': 17, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.5808011293411255}
Final aspects for text: [{'aspect': 'バッテリー', 'start': 12, 'end': 17, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.5808011293411255}]
Raw entities extracted: [{'entity_group': 'ASP-Positive', 'score': np.float32(0.49294925), 'word': '', 'start': 0, 'end': 1}, {'entity_group': 'ASP-Neutral', 'score': np.float32(0.5432428), 'word': '음식', 'start': 0, 'end': 2}, {'entity_group': 'ASP-Neutral', 'score': np.float32(0.46728912), 'word': '가격', 'start': 10, 'end': 13}]
Processing entity: {'entity_group': 'ASP-Positive', 'score': np.float32(0.49294925), 'word': '', 'start': 0, 'end': 1}, label: asp-positive
Skipping empty aspect
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.5432428), 'word': '음식', 'start': 0, 'end': 2}, label: asp-neutral
Added aspect: {'aspect': '음식', 'start': 0, 'end': 2, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.5432428121566772}
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.46728912), 'word': '가격', 'start': 10, 'end': 13}, label: asp-neutral
Added aspect: {'aspect': '가격', 'start': 10, 'end': 13, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.46728911995887756}
Final aspects for text: [{'aspect': '음식', 'start': 0, 'end': 2, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.5432428121566772}, {'aspect': '가격', 'start': 10, 'end': 13, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.46728911995887756}]
Raw entities extracted: [{'entity_group': 'ASP-Neutral', 'score': np.float32(0.5339548), 'word': 'الخ', 'start': 0, 'end': 3}, {'entity_group': 'ASP-Positive', 'score': np.float32(0.50554234), 'word': 'دمة', 'start': 3, 'end': 6}, {'entity_group': 'ASP-Neutral', 'score': np.float32(0.44124436), 'word': 'الموق', 'start': 18, 'end': 24}, {'entity_group': 'ASP-Negative', 'score': np.float32(0.45630246), 'word': 'ع', 'start': 24, 'end': 25}]
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.5339548), 'word': 'الخ', 'start': 0, 'end': 3}, label: asp-neutral
Added aspect: {'aspect': 'الخ', 'start': 0, 'end': 3, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.5339547991752625}
Processing entity: {'entity_group': 'ASP-Positive', 'score': np.float32(0.50554234), 'word': 'دمة', 'start': 3, 'end': 6}, label: asp-positive
Added aspect: {'aspect': 'دمة', 'start': 3, 'end': 6, 'extractor_label': 'ASP-Positive', 'extractor_score': 0.5055423378944397}
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.44124436), 'word': 'الموق', 'start': 18, 'end': 24}, label: asp-neutral
Added aspect: {'aspect': 'الموق', 'start': 18, 'end': 24, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.44124436378479004}
Processing entity: {'entity_group': 'ASP-Negative', 'score': np.float32(0.45630246), 'word': 'ع', 'start': 24, 'end': 25}, label: asp-negative
Added aspect: {'aspect': 'ع', 'start': 24, 'end': 25, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.4563024640083313}
Final aspects for text: [{'aspect': 'الخ', 'start': 0, 'end': 3, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.5339547991752625}, {'aspect': 'دمة', 'start': 3, 'end': 6, 'extractor_label': 'ASP-Positive', 'extractor_score': 0.5055423378944397}, {'aspect': 'الموق', 'start': 18, 'end': 24, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.44124436378479004}, {'aspect': 'ع', 'start': 24, 'end': 25, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.4563024640083313}]
Raw entities extracted: [{'entity_group': 'ASP-Neutral', 'score': np.float32(0.45512593), 'word': 'कैमरा', 'start': 7, 'end': 13}, {'entity_group': 'ASP-Neutral', 'score': np.float32(0.47939613), 'word': 'बैट', 'start': 30, 'end': 34}, {'entity_group': 'ASP-Negative', 'score': np.float32(0.43590102), 'word': 'री', 'start': 34, 'end': 36}, {'entity_group': 'ASP-Neutral', 'score': np.float32(0.46086523), 'word': 'लाइफ', 'start': 36, 'end': 41}]
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.45512593), 'word': 'कैमरा', 'start': 7, 'end': 13}, label: asp-neutral
Added aspect: {'aspect': 'कैमरा', 'start': 7, 'end': 13, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.45512592792510986}
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.47939613), 'word': 'बैट', 'start': 30, 'end': 34}, label: asp-neutral
Added aspect: {'aspect': 'बैट', 'start': 30, 'end': 34, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.47939613461494446}
Processing entity: {'entity_group': 'ASP-Negative', 'score': np.float32(0.43590102), 'word': 'री', 'start': 34, 'end': 36}, label: asp-negative
Added aspect: {'aspect': 'री', 'start': 34, 'end': 36, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.435901015996933}
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.46086523), 'word': 'लाइफ', 'start': 36, 'end': 41}, label: asp-neutral
Added aspect: {'aspect': 'लाइफ', 'start': 36, 'end': 41, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.46086522936820984}
Final aspects for text: [{'aspect': 'कैमरा', 'start': 7, 'end': 13, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.45512592792510986}, {'aspect': 'बैट', 'start': 30, 'end': 34, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.47939613461494446}, {'aspect': 'री', 'start': 34, 'end': 36, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.435901015996933}, {'aspect': 'लाइफ', 'start': 36, 'end': 41, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.46086522936820984}]
Raw entities extracted: [{'entity_group': 'ASP-Positive', 'score': np.float32(0.4961163), 'word': 'locatie', 'start': 2, 'end': 10}, {'entity_group': 'ASP-Negative', 'score': np.float32(0.48402262), 'word': 'personeel', 'start': 36, 'end': 46}]
Processing entity: {'entity_group': 'ASP-Positive', 'score': np.float32(0.4961163), 'word': 'locatie', 'start': 2, 'end': 10}, label: asp-positive
Added aspect: {'aspect': 'locatie', 'start': 2, 'end': 10, 'extractor_label': 'ASP-Positive', 'extractor_score': 0.4961163103580475}
Processing entity: {'entity_group': 'ASP-Negative', 'score': np.float32(0.48402262), 'word': 'personeel', 'start': 36, 'end': 46}, label: asp-negative
Added aspect: {'aspect': 'personeel', 'start': 36, 'end': 46, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.4840226173400879}
Final aspects for text: [{'aspect': 'locatie', 'start': 2, 'end': 10, 'extractor_label': 'ASP-Positive', 'extractor_score': 0.4961163103580475}, {'aspect': 'personeel', 'start': 36, 'end': 46, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.4840226173400879}]
Raw entities extracted: [{'entity_group': 'ASP-Neutral', 'score': np.float32(0.4699115), 'word': 'Bok', 'start': 0, 'end': 3}, {'entity_group': 'ASP-Negative', 'score': np.float32(0.44758555), 'word': 'handling', 'start': 24, 'end': 33}]
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.4699115), 'word': 'Bok', 'start': 0, 'end': 3}, label: asp-neutral
Added aspect: {'aspect': 'Bok', 'start': 0, 'end': 3, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.46991148591041565}
Processing entity: {'entity_group': 'ASP-Negative', 'score': np.float32(0.44758555), 'word': 'handling', 'start': 24, 'end': 33}, label: asp-negative
Added aspect: {'aspect': 'handling', 'start': 24, 'end': 33, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.4475855529308319}
Final aspects for text: [{'aspect': 'Bok', 'start': 0, 'end': 3, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.46991148591041565}, {'aspect': 'handling', 'start': 24, 'end': 33, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.4475855529308319}]
Raw entities extracted: [{'entity_group': 'ASP-Neutral', 'score': np.float32(0.55233693), 'word': 'Grafika', 'start': 0, 'end': 7}, {'entity_group': 'ASP-Neutral', 'score': np.float32(0.38001376), 'word': 'g', 'start': 9, 'end': 11}, {'entity_group': 'ASP-Neutral', 'score': np.float32(0.5456186), 'word': 'fabuła', 'start': 36, 'end': 43}]
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.55233693), 'word': 'Grafika', 'start': 0, 'end': 7}, label: asp-neutral
Added aspect: {'aspect': 'Grafika', 'start': 0, 'end': 7, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.5523369312286377}
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.38001376), 'word': 'g', 'start': 9, 'end': 11}, label: asp-neutral
Added aspect: {'aspect': 'g', 'start': 9, 'end': 11, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.38001376390457153}
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.5456186), 'word': 'fabuła', 'start': 36, 'end': 43}, label: asp-neutral
Added aspect: {'aspect': 'fabuła', 'start': 36, 'end': 43, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.5456185936927795}
Final aspects for text: [{'aspect': 'Grafika', 'start': 0, 'end': 7, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.5523369312286377}, {'aspect': 'g', 'start': 9, 'end': 11, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.38001376390457153}, {'aspect': 'fabuła', 'start': 36, 'end': 43, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.5456185936927795}]
Raw entities extracted: [{'entity_group': 'ASP-Negative', 'score': np.float32(0.64053774), 'word': 'kargo', 'start': 27, 'end': 33}]
Processing entity: {'entity_group': 'ASP-Negative', 'score': np.float32(0.64053774), 'word': 'kargo', 'start': 27, 'end': 33}, label: asp-negative
Added aspect: {'aspect': 'kargo', 'start': 27, 'end': 33, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.6405377388000488}
Final aspects for text: [{'aspect': 'kargo', 'start': 27, 'end': 33, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.6405377388000488}]
Raw entities extracted: [{'entity_group': 'ASP-Positive', 'score': np.float32(0.6112579), 'word': 'Ch', 'start': 0, 'end': 2}, {'entity_group': 'ASP-Positive', 'score': np.float32(0.6159069), 'word': 'lượng âm thanh', 'start': 4, 'end': 19}]
Processing entity: {'entity_group': 'ASP-Positive', 'score': np.float32(0.6112579), 'word': 'Ch', 'start': 0, 'end': 2}, label: asp-positive
Added aspect: {'aspect': 'Ch', 'start': 0, 'end': 2, 'extractor_label': 'ASP-Positive', 'extractor_score': 0.6112579107284546}
Processing entity: {'entity_group': 'ASP-Positive', 'score': np.float32(0.6159069), 'word': 'lượng âm thanh', 'start': 4, 'end': 19}, label: asp-positive
Added aspect: {'aspect': 'lượng âm thanh', 'start': 4, 'end': 19, 'extractor_label': 'ASP-Positive', 'extractor_score': 0.6159068942070007}
Final aspects for text: [{'aspect': 'Ch', 'start': 0, 'end': 2, 'extractor_label': 'ASP-Positive', 'extractor_score': 0.6112579107284546}, {'aspect': 'lượng âm thanh', 'start': 4, 'end': 19, 'extractor_label': 'ASP-Positive', 'extractor_score': 0.6159068942070007}]
Raw entities extracted: []
Final aspects for text: []
Raw entities extracted: [{'entity_group': 'ASP-Neutral', 'score': np.float32(0.64732456), 'word': 'τοποθεσία', 'start': 1, 'end': 11}, {'entity_group': 'ASP-Negative', 'score': np.float32(0.49225593), 'word': 'δω', 'start': 37, 'end': 40}, {'entity_group': 'ASP-Neutral', 'score': np.float32(0.4857553), 'word': 'μάτιο', 'start': 40, 'end': 45}]
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.64732456), 'word': 'τοποθεσία', 'start': 1, 'end': 11}, label: asp-neutral
Added aspect: {'aspect': 'τοποθεσία', 'start': 1, 'end': 11, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.6473245620727539}
Processing entity: {'entity_group': 'ASP-Negative', 'score': np.float32(0.49225593), 'word': 'δω', 'start': 37, 'end': 40}, label: asp-negative
Added aspect: {'aspect': 'δω', 'start': 37, 'end': 40, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.49225592613220215}
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.4857553), 'word': 'μάτιο', 'start': 40, 'end': 45}, label: asp-neutral
Added aspect: {'aspect': 'μάτιο', 'start': 40, 'end': 45, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.4857552945613861}
Final aspects for text: [{'aspect': 'τοποθεσία', 'start': 1, 'end': 11, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.6473245620727539}, {'aspect': 'δω', 'start': 37, 'end': 40, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.49225592613220215}, {'aspect': 'μάτιο', 'start': 40, 'end': 45, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.4857552945613861}]
Raw entities extracted: [{'entity_group': 'ASP-Positive', 'score': np.float32(0.41735768), 'word': 'ה', 'start': 0, 'end': 1}, {'entity_group': 'ASP-Positive', 'score': np.float32(0.39395496), 'word': 'משחק', 'start': 1, 'end': 5}]
Processing entity: {'entity_group': 'ASP-Positive', 'score': np.float32(0.41735768), 'word': 'ה', 'start': 0, 'end': 1}, label: asp-positive
Added aspect: {'aspect': 'ה', 'start': 0, 'end': 1, 'extractor_label': 'ASP-Positive', 'extractor_score': 0.4173576831817627}
Processing entity: {'entity_group': 'ASP-Positive', 'score': np.float32(0.39395496), 'word': 'משחק', 'start': 1, 'end': 5}, label: asp-positive
Added aspect: {'aspect': 'משחק', 'start': 1, 'end': 5, 'extractor_label': 'ASP-Positive', 'extractor_score': 0.39395496249198914}
Final aspects for text: [{'aspect': 'ה', 'start': 0, 'end': 1, 'extractor_label': 'ASP-Positive', 'extractor_score': 0.4173576831817627}, {'aspect': 'משחק', 'start': 1, 'end': 5, 'extractor_label': 'ASP-Positive', 'extractor_score': 0.39395496249198914}]
Raw entities extracted: [{'entity_group': 'ASP-Neutral', 'score': np.float32(0.5927124), 'word': 'Pons', 'start': 0, 'end': 4}, {'entity_group': 'ASP-Neutral', 'score': np.float32(0.281419), 'word': 'el', 'start': 4, 'end': 6}, {'entity_group': 'ASP-Neutral', 'score': np.float32(0.56265074), 'word': 'tetapi', 'start': 17, 'end': 24}]
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.5927124), 'word': 'Pons', 'start': 0, 'end': 4}, label: asp-neutral
Added aspect: {'aspect': 'Pons', 'start': 0, 'end': 4, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.59271240234375}
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.281419), 'word': 'el', 'start': 4, 'end': 6}, label: asp-neutral
Added aspect: {'aspect': 'el', 'start': 4, 'end': 6, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.2814190089702606}
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.56265074), 'word': 'tetapi', 'start': 17, 'end': 24}, label: asp-neutral
Added aspect: {'aspect': 'tetapi', 'start': 17, 'end': 24, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.562650740146637}
Final aspects for text: [{'aspect': 'Pons', 'start': 0, 'end': 4, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.59271240234375}, {'aspect': 'el', 'start': 4, 'end': 6, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.2814190089702606}, {'aspect': 'tetapi', 'start': 17, 'end': 24, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.562650740146637}]
Raw entities extracted: [{'entity_group': 'ASP-Neutral', 'score': np.float32(0.50318885), 'word': 'Ohjelma', 'start': 0, 'end': 7}, {'entity_group': 'ASP-Neutral', 'score': np.float32(0.48775986), 'word': 'käyttöliittymä', 'start': 25, 'end': 40}]
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.50318885), 'word': 'Ohjelma', 'start': 0, 'end': 7}, label: asp-neutral
Added aspect: {'aspect': 'Ohjelma', 'start': 0, 'end': 7, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.5031888484954834}
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.48775986), 'word': 'käyttöliittymä', 'start': 25, 'end': 40}, label: asp-neutral
Added aspect: {'aspect': 'käyttöliittymä', 'start': 25, 'end': 40, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.48775985836982727}
Final aspects for text: [{'aspect': 'Ohjelma', 'start': 0, 'end': 7, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.5031888484954834}, {'aspect': 'käyttöliittymä', 'start': 25, 'end': 40, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.48775985836982727}]
Raw entities extracted: [{'entity_group': 'ASP-Neutral', 'score': np.float32(0.4489361), 'word': 'Maden', 'start': 0, 'end': 5}, {'entity_group': 'ASP-Negative', 'score': np.float32(0.5446483), 'word': 'portion', 'start': 21, 'end': 29}]
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.4489361), 'word': 'Maden', 'start': 0, 'end': 5}, label: asp-neutral
Added aspect: {'aspect': 'Maden', 'start': 0, 'end': 5, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.4489361047744751}
Processing entity: {'entity_group': 'ASP-Negative', 'score': np.float32(0.5446483), 'word': 'portion', 'start': 21, 'end': 29}, label: asp-negative
Added aspect: {'aspect': 'portion', 'start': 21, 'end': 29, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.544648289680481}
Final aspects for text: [{'aspect': 'Maden', 'start': 0, 'end': 5, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.4489361047744751}, {'aspect': 'portion', 'start': 21, 'end': 29, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.544648289680481}]
Raw entities extracted: [{'entity_group': 'ASP-Neutral', 'score': np.float32(0.5072303), 'word': 'Počítač', 'start': 0, 'end': 7}, {'entity_group': 'ASP-Neutral', 'score': np.float32(0.5066106), 'word': 'software', 'start': 22, 'end': 31}]
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.5072303), 'word': 'Počítač', 'start': 0, 'end': 7}, label: asp-neutral
Added aspect: {'aspect': 'Počítač', 'start': 0, 'end': 7, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.507230281829834}
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.5066106), 'word': 'software', 'start': 22, 'end': 31}, label: asp-neutral
Added aspect: {'aspect': 'software', 'start': 22, 'end': 31, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.5066105723381042}
Final aspects for text: [{'aspect': 'Počítač', 'start': 0, 'end': 7, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.507230281829834}, {'aspect': 'software', 'start': 22, 'end': 31, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.5066105723381042}]
Results:
[{'aspects': ['user interface', 'documentation'],
'confidence': [0.517541766166687, 0.5204463601112366],
'details': [{'aspect': 'user interface',
'confidence': 0.517541766166687,
'end': 18,
'extractor_label': 'ASP-Neutral',
'extractor_score': 0.517541766166687,
'probability': {'Negative': 0.2412291169166565,
'Neutral': 0.517541766166687,
'Positive': 0.2412291169166565},
'sentiment': 'Neutral',
'start': 3},
{'aspect': 'documentation',
'confidence': 0.5204463601112366,
'end': 54,
'extractor_label': 'ASP-Negative',
'extractor_score': 0.5204463601112366,
'probability': {'Negative': 0.5204463601112366,
'Neutral': 0.2397768199443817,
'Positive': 0.2397768199443817},
'sentiment': 'Negative',
'start': 40}],
'positions': [[3, 18], [40, 54]],
'sentiments': ['Neutral', 'Negative'],
'text': 'The user interface is brilliant, but the documentation is a total mess.'},
{'aspects': ['牛排', '服务'],
'confidence': [0.5346122980117798, 0.5622819066047668],
'details': [{'aspect': '牛排',
'confidence': 0.5346122980117798,
'end': 7,
'extractor_label': 'ASP-Positive',
'extractor_score': 0.5346122980117798,
'probability': {'Negative': 0.2326938509941101,
'Neutral': 0.2326938509941101,
'Positive': 0.5346122980117798},
'sentiment': 'Positive',
'start': 5},
{'aspect': '服务',
'confidence': 0.5622819066047668,
'end': 15,
'extractor_label': 'ASP-Negative',
'extractor_score': 0.5622819066047668,
'probability': {'Negative': 0.5622819066047668,
'Neutral': 0.21885904669761658,
'Positive': 0.21885904669761658},
'sentiment': 'Negative',
'start': 13}],
'positions': [[5, 7], [13, 15]],
'sentiments': ['Positive', 'Negative'],
'text': '这家餐厅的牛排很好吃,但是服务很慢。'},
{'aspects': ['batería', 'cámara'],
'confidence': [0.43364980816841125, 0.44364821910858154],
'details': [{'aspect': 'batería',
'confidence': 0.43364980816841125,
'end': 10,
'extractor_label': 'ASP-Neutral',
'extractor_score': 0.43364980816841125,
'probability': {'Negative': 0.2831750959157944,
'Neutral': 0.43364980816841125,
'Positive': 0.2831750959157944},
'sentiment': 'Neutral',
'start': 2},
{'aspect': 'cámara',
'confidence': 0.44364821910858154,
'end': 40,
'extractor_label': 'ASP-Neutral',
'extractor_score': 0.44364821910858154,
'probability': {'Negative': 0.27817589044570923,
'Neutral': 0.44364821910858154,
'Positive': 0.27817589044570923},
'sentiment': 'Neutral',
'start': 33}],
'positions': [[2, 10], [33, 40]],
'sentiments': ['Neutral', 'Neutral'],
'text': 'La batería es malísima, aunque la cámara está muy bien.'},
{'aspects': ['film', 'fin'],
'confidence': [0.6539797782897949, 0.41829001903533936],
'details': [{'aspect': 'film',
'confidence': 0.6539797782897949,
'end': 7,
'extractor_label': 'ASP-Positive',
'extractor_score': 0.6539797782897949,
'probability': {'Negative': 0.17301011085510254,
'Neutral': 0.17301011085510254,
'Positive': 0.6539797782897949},
'sentiment': 'Positive',
'start': 2},
{'aspect': 'fin',
'confidence': 0.41829001903533936,
'end': 36,
'extractor_label': 'ASP-Negative',
'extractor_score': 0.41829001903533936,
'probability': {'Negative': 0.41829001903533936,
'Neutral': 0.2908549904823303,
'Positive': 0.2908549904823303},
'sentiment': 'Negative',
'start': 32}],
'positions': [[2, 7], [32, 36]],
'sentiments': ['Positive', 'Negative'],
'text': 'Le film était captivant, mais la fin était décevante.'},
{'aspects': ['Auto', 'Sitze'],
'confidence': [0.5750167965888977, 0.4986541271209717],
'details': [{'aspect': 'Auto',
'confidence': 0.5750167965888977,
'end': 8,
'extractor_label': 'ASP-Neutral',
'extractor_score': 0.5750167965888977,
'probability': {'Negative': 0.21249160170555115,
'Neutral': 0.5750167965888977,
'Positive': 0.21249160170555115},
'sentiment': 'Neutral',
'start': 3},
{'aspect': 'Sitze',
'confidence': 0.4986541271209717,
'end': 41,
'extractor_label': 'ASP-Neutral',
'extractor_score': 0.4986541271209717,
'probability': {'Negative': 0.25067293643951416,
'Neutral': 0.4986541271209717,
'Positive': 0.25067293643951416},
'sentiment': 'Neutral',
'start': 35}],
'positions': [[3, 8], [35, 41]],
'sentiments': ['Neutral', 'Neutral'],
'text': 'Das Auto ist sehr sparsam, aber die Sitze sind unbequem.'},
{'aspects': ['design', 'software'],
'confidence': [0.6298937201499939, 0.6058070063591003],
'details': [{'aspect': 'design',
'confidence': 0.6298937201499939,
'end': 9,
'extractor_label': 'ASP-Neutral',
'extractor_score': 0.6298937201499939,
'probability': {'Negative': 0.18505313992500305,
'Neutral': 0.6298937201499939,
'Positive': 0.18505313992500305},
'sentiment': 'Neutral',
'start': 2},
{'aspect': 'software',
'confidence': 0.6058070063591003,
'end': 38,
'extractor_label': 'ASP-Neutral',
'extractor_score': 0.6058070063591003,
'probability': {'Negative': 0.19709649682044983,
'Neutral': 0.6058070063591003,
'Positive': 0.19709649682044983},
'sentiment': 'Neutral',
'start': 29}],
'positions': [[2, 9], [29, 38]],
'sentiments': ['Neutral', 'Neutral'],
'text': 'Il design è elegante, però il software è pieno di bug.'},
{'aspects': ['café'],
'confidence': [0.56500643491745],
'details': [{'aspect': 'café',
'confidence': 0.56500643491745,
'end': 42,
'extractor_label': 'ASP-Negative',
'extractor_score': 0.56500643491745,
'probability': {'Negative': 0.56500643491745,
'Neutral': 0.21749678254127502,
'Positive': 0.21749678254127502},
'sentiment': 'Negative',
'start': 37}],
'positions': [[37, 42]],
'sentiments': ['Negative'],
'text': 'O hotel tem uma vista incrível, mas o café da manhã é fraco.'},
{'aspects': ['Кни', 'пере'],
'confidence': [0.42165103554725647, 0.5683889389038086],
'details': [{'aspect': 'Кни',
'confidence': 0.42165103554725647,
'end': 3,
'extractor_label': 'ASP-Neutral',
'extractor_score': 0.42165103554725647,
'probability': {'Negative': 0.28917448222637177,
'Neutral': 0.42165103554725647,
'Positive': 0.28917448222637177},
'sentiment': 'Neutral',
'start': 0},
{'aspect': 'пере',
'confidence': 0.5683889389038086,
'end': 31,
'extractor_label': 'ASP-Neutral',
'extractor_score': 0.5683889389038086,
'probability': {'Negative': 0.2158055305480957,
'Neutral': 0.5683889389038086,
'Positive': 0.2158055305480957},
'sentiment': 'Neutral',
'start': 26}],
'positions': [[0, 3], [26, 31]],
'sentiments': ['Neutral', 'Neutral'],
'text': 'Книга очень интересная, но перевод оставляет желать лучшего.'},
{'aspects': ['バッテリー'],
'confidence': [0.5808011293411255],
'details': [{'aspect': 'バッテリー',
'confidence': 0.5808011293411255,
'end': 17,
'extractor_label': 'ASP-Negative',
'extractor_score': 0.5808011293411255,
'probability': {'Negative': 0.5808011293411255,
'Neutral': 0.20959943532943726,
'Positive': 0.20959943532943726},
'sentiment': 'Negative',
'start': 12}],
'positions': [[12, 17]],
'sentiments': ['Negative'],
'text': 'このアプリは便利だけど、バッテリーの消費が激しい。'},
{'aspects': ['음식', '가격'],
'confidence': [0.5432428121566772, 0.46728911995887756],
'details': [{'aspect': '음식',
'confidence': 0.5432428121566772,
'end': 2,
'extractor_label': 'ASP-Neutral',
'extractor_score': 0.5432428121566772,
'probability': {'Negative': 0.22837859392166138,
'Neutral': 0.5432428121566772,
'Positive': 0.22837859392166138},
'sentiment': 'Neutral',
'start': 0},
{'aspect': '가격',
'confidence': 0.46728911995887756,
'end': 13,
'extractor_label': 'ASP-Neutral',
'extractor_score': 0.46728911995887756,
'probability': {'Negative': 0.2663554400205612,
'Neutral': 0.46728911995887756,
'Positive': 0.2663554400205612},
'sentiment': 'Neutral',
'start': 10}],
'positions': [[0, 2], [10, 13]],
'sentiments': ['Neutral', 'Neutral'],
'text': '음식은 맛있었지만, 가격이 너무 비쌌어요.'},
{'aspects': ['الخ', 'دمة', 'الموق', 'ع'],
'confidence': [0.5339547991752625, 0.5055423378944397, 0.44124436378479004, 0.4563024640083313],
'details': [{'aspect': 'الخ',
'confidence': 0.5339547991752625,
'end': 3,
'extractor_label': 'ASP-Neutral',
'extractor_score': 0.5339547991752625,
'probability': {'Negative': 0.23302260041236877,
'Neutral': 0.5339547991752625,
'Positive': 0.23302260041236877},
'sentiment': 'Neutral',
'start': 0},
{'aspect': 'دمة',
'confidence': 0.5055423378944397,
'end': 6,
'extractor_label': 'ASP-Positive',
'extractor_score': 0.5055423378944397,
'probability': {'Negative': 0.24722883105278015,
'Neutral': 0.24722883105278015,
'Positive': 0.5055423378944397},
'sentiment': 'Positive',
'start': 3},
{'aspect': 'الموق',
'confidence': 0.44124436378479004,
'end': 24,
'extractor_label': 'ASP-Neutral',
'extractor_score': 0.44124436378479004,
'probability': {'Negative': 0.279377818107605,
'Neutral': 0.44124436378479004,
'Positive': 0.279377818107605},
'sentiment': 'Neutral',
'start': 18},
{'aspect': 'ع',
'confidence': 0.4563024640083313,
'end': 25,
'extractor_label': 'ASP-Negative',
'extractor_score': 0.4563024640083313,
'probability': {'Negative': 0.4563024640083313,
'Neutral': 0.27184876799583435,
'Positive': 0.27184876799583435},
'sentiment': 'Negative',
'start': 24}],
'positions': [[0, 3], [3, 6], [18, 24], [24, 25]],
'sentiments': ['Neutral', 'Positive', 'Neutral', 'Negative'],
'text': 'الخدمة ممتازة، لكن الموقع صعب الوصول إليه.'},
{'aspects': ['कैमरा', 'बैट', 'री', 'लाइफ'],
'confidence': [0.45512592792510986, 0.47939613461494446, 0.435901015996933, 0.46086522936820984],
'details': [{'aspect': 'कैमरा',
'confidence': 0.45512592792510986,
'end': 13,
'extractor_label': 'ASP-Neutral',
'extractor_score': 0.45512592792510986,
'probability': {'Negative': 0.27243703603744507,
'Neutral': 0.45512592792510986,
'Positive': 0.27243703603744507},
'sentiment': 'Neutral',
'start': 7},
{'aspect': 'बैट',
'confidence': 0.47939613461494446,
'end': 34,
'extractor_label': 'ASP-Neutral',
'extractor_score': 0.47939613461494446,
'probability': {'Negative': 0.26030193269252777,
'Neutral': 0.47939613461494446,
'Positive': 0.26030193269252777},
'sentiment': 'Neutral',
'start': 30},
{'aspect': 'री',
'confidence': 0.435901015996933,
'end': 36,
'extractor_label': 'ASP-Negative',
'extractor_score': 0.435901015996933,
'probability': {'Negative': 0.435901015996933,
'Neutral': 0.2820494920015335,
'Positive': 0.2820494920015335},
'sentiment': 'Negative',
'start': 34},
{'aspect': 'लाइफ',
'confidence': 0.46086522936820984,
'end': 41,
'extractor_label': 'ASP-Neutral',
'extractor_score': 0.46086522936820984,
'probability': {'Negative': 0.2695673853158951,
'Neutral': 0.46086522936820984,
'Positive': 0.2695673853158951},
'sentiment': 'Neutral',
'start': 36}],
'positions': [[7, 13], [30, 34], [34, 36], [36, 41]],
'sentiments': ['Neutral', 'Neutral', 'Negative', 'Neutral'],
'text': 'फ़ोन का कैमरा शानदार है, लेकिन बैटरी लाइफ खराब है।'},
{'aspects': ['locatie', 'personeel'],
'confidence': [0.4961163103580475, 0.4840226173400879],
'details': [{'aspect': 'locatie',
'confidence': 0.4961163103580475,
'end': 10,
'extractor_label': 'ASP-Positive',
'extractor_score': 0.4961163103580475,
'probability': {'Negative': 0.25194184482097626,
'Neutral': 0.25194184482097626,
'Positive': 0.4961163103580475},
'sentiment': 'Positive',
'start': 2},
{'aspect': 'personeel',
'confidence': 0.4840226173400879,
'end': 46,
'extractor_label': 'ASP-Negative',
'extractor_score': 0.4840226173400879,
'probability': {'Negative': 0.4840226173400879,
'Neutral': 0.25798869132995605,
'Positive': 0.25798869132995605},
'sentiment': 'Negative',
'start': 36}],
'positions': [[2, 10], [36, 46]],
'sentiments': ['Positive', 'Negative'],
'text': 'De locatie is perfect, alleen is het personeel onvriendelijk.'},
{'aspects': ['Bok', 'handling'],
'confidence': [0.46991148591041565, 0.4475855529308319],
'details': [{'aspect': 'Bok',
'confidence': 0.46991148591041565,
'end': 3,
'extractor_label': 'ASP-Neutral',
'extractor_score': 0.46991148591041565,
'probability': {'Negative': 0.2650442570447922,
'Neutral': 0.46991148591041565,
'Positive': 0.2650442570447922},
'sentiment': 'Neutral',
'start': 0},
{'aspect': 'handling',
'confidence': 0.4475855529308319,
'end': 33,
'extractor_label': 'ASP-Negative',
'extractor_score': 0.4475855529308319,
'probability': {'Negative': 0.4475855529308319,
'Neutral': 0.27620722353458405,
'Positive': 0.27620722353458405},
'sentiment': 'Negative',
'start': 24}],
'positions': [[0, 3], [24, 33]],
'sentiments': ['Neutral', 'Negative'],
'text': 'Boken är välskriven, men handlingen är förutsägbar.'},
{'aspects': ['Grafika', 'g', 'fabuła'],
'confidence': [0.5523369312286377, 0.38001376390457153, 0.5456185936927795],
'details': [{'aspect': 'Grafika',
'confidence': 0.5523369312286377,
'end': 7,
'extractor_label': 'ASP-Neutral',
'extractor_score': 0.5523369312286377,
'probability': {'Negative': 0.22383153438568115,
'Neutral': 0.5523369312286377,
'Positive': 0.22383153438568115},
'sentiment': 'Neutral',
'start': 0},
{'aspect': 'g',
'confidence': 0.38001376390457153,
'end': 11,
'extractor_label': 'ASP-Neutral',
'extractor_score': 0.38001376390457153,
'probability': {'Negative': 0.30999311804771423,
'Neutral': 0.38001376390457153,
'Positive': 0.30999311804771423},
'sentiment': 'Neutral',
'start': 9},
{'aspect': 'fabuła',
'confidence': 0.5456185936927795,
'end': 43,
'extractor_label': 'ASP-Neutral',
'extractor_score': 0.5456185936927795,
'probability': {'Negative': 0.22719070315361023,
'Neutral': 0.5456185936927795,
'Positive': 0.22719070315361023},
'sentiment': 'Neutral',
'start': 36}],
'positions': [[0, 7], [9, 11], [36, 43]],
'sentiments': ['Neutral', 'Neutral', 'Neutral'],
'text': 'Grafika w grze jest niesamowita, ale fabuła jest nudna.'},
{'aspects': ['kargo'],
'confidence': [0.6405377388000488],
'details': [{'aspect': 'kargo',
'confidence': 0.6405377388000488,
'end': 33,
'extractor_label': 'ASP-Negative',
'extractor_score': 0.6405377388000488,
'probability': {'Negative': 0.6405377388000488,
'Neutral': 0.17973113059997559,
'Positive': 0.17973113059997559},
'sentiment': 'Negative',
'start': 27}],
'positions': [[27, 33]],
'sentiments': ['Negative'],
'text': 'Ürün kaliteli görünüyor ama kargo çok geç geldi.'},
{'aspects': ['Ch', 'lượng âm thanh'],
'confidence': [0.6112579107284546, 0.6159068942070007],
'details': [{'aspect': 'Ch',
'confidence': 0.6112579107284546,
'end': 2,
'extractor_label': 'ASP-Positive',
'extractor_score': 0.6112579107284546,
'probability': {'Negative': 0.1943710446357727,
'Neutral': 0.1943710446357727,
'Positive': 0.6112579107284546},
'sentiment': 'Positive',
'start': 0},
{'aspect': 'lượng âm thanh',
'confidence': 0.6159068942070007,
'end': 19,
'extractor_label': 'ASP-Positive',
'extractor_score': 0.6159068942070007,
'probability': {'Negative': 0.19204655289649963,
'Neutral': 0.19204655289649963,
'Positive': 0.6159068942070007},
'sentiment': 'Positive',
'start': 4}],
'positions': [[0, 2], [4, 19]],
'sentiments': ['Positive', 'Positive'],
'text': 'Chất lượng âm thanh tốt, tuy nhiên tai nghe không thoải mái lắm.'},
{'aspects': [],
'confidence': [],
'details': [],
'positions': [],
'sentiments': [],
'text': 'การแสดงดีมาก แต่บทภาพยนตร์ค่อนข้างอ่อน'},
{'aspects': ['τοποθεσία', 'δω', 'μάτιο'],
'confidence': [0.6473245620727539, 0.49225592613220215, 0.4857552945613861],
'details': [{'aspect': 'τοποθεσία',
'confidence': 0.6473245620727539,
'end': 11,
'extractor_label': 'ASP-Neutral',
'extractor_score': 0.6473245620727539,
'probability': {'Negative': 0.17633771896362305,
'Neutral': 0.6473245620727539,
'Positive': 0.17633771896362305},
'sentiment': 'Neutral',
'start': 1},
{'aspect': 'δω',
'confidence': 0.49225592613220215,
'end': 40,
'extractor_label': 'ASP-Negative',
'extractor_score': 0.49225592613220215,
'probability': {'Negative': 0.49225592613220215,
'Neutral': 0.2538720369338989,
'Positive': 0.2538720369338989},
'sentiment': 'Negative',
'start': 37},
{'aspect': 'μάτιο',
'confidence': 0.4857552945613861,
'end': 45,
'extractor_label': 'ASP-Neutral',
'extractor_score': 0.4857552945613861,
'probability': {'Negative': 0.25712235271930695,
'Neutral': 0.4857552945613861,
'Positive': 0.25712235271930695},
'sentiment': 'Neutral',
'start': 40}],
'positions': [[1, 11], [37, 40], [40, 45]],
'sentiments': ['Neutral', 'Negative', 'Neutral'],
'text': 'Η τοποθεσία είναι φανταστική, αλλά το δωμάτιο ήταν πολύ μικρό.'},
{'aspects': ['ה', 'משחק'],
'confidence': [0.4173576831817627, 0.39395496249198914],
'details': [{'aspect': 'ה',
'confidence': 0.4173576831817627,
'end': 1,
'extractor_label': 'ASP-Positive',
'extractor_score': 0.4173576831817627,
'probability': {'Negative': 0.29132115840911865,
'Neutral': 0.29132115840911865,
'Positive': 0.4173576831817627},
'sentiment': 'Positive',
'start': 0},
{'aspect': 'משחק',
'confidence': 0.39395496249198914,
'end': 5,
'extractor_label': 'ASP-Positive',
'extractor_score': 0.39395496249198914,
'probability': {'Negative': 0.30302251875400543,
'Neutral': 0.30302251875400543,
'Positive': 0.39395496249198914},
'sentiment': 'Positive',
'start': 1}],
'positions': [[0, 1], [1, 5]],
'sentiments': ['Positive', 'Positive'],
'text': 'המשחק מהנה, אבל יש בו יותר מדי פרסומות.'},
{'aspects': ['Pons', 'el', 'tetapi'],
'confidence': [0.59271240234375, 0.2814190089702606, 0.562650740146637],
'details': [{'aspect': 'Pons',
'confidence': 0.59271240234375,
'end': 4,
'extractor_label': 'ASP-Neutral',
'extractor_score': 0.59271240234375,
'probability': {'Negative': 0.203643798828125,
'Neutral': 0.59271240234375,
'Positive': 0.203643798828125},
'sentiment': 'Neutral',
'start': 0},
{'aspect': 'el',
'confidence': 0.2814190089702606,
'end': 6,
'extractor_label': 'ASP-Neutral',
'extractor_score': 0.2814190089702606,
'probability': {'Negative': 0.3592904955148697,
'Neutral': 0.2814190089702606,
'Positive': 0.3592904955148697},
'sentiment': 'Neutral',
'start': 4},
{'aspect': 'tetapi',
'confidence': 0.562650740146637,
'end': 24,
'extractor_label': 'ASP-Neutral',
'extractor_score': 0.562650740146637,
'probability': {'Negative': 0.21867462992668152,
'Neutral': 0.562650740146637,
'Positive': 0.21867462992668152},
'sentiment': 'Neutral',
'start': 17}],
'positions': [[0, 4], [4, 6], [17, 24]],
'sentiments': ['Neutral', 'Neutral', 'Neutral'],
'text': 'Ponsel ini cepat, tetapi cenderung cepat panas.'},
{'aspects': ['Ohjelma', 'käyttöliittymä'],
'confidence': [0.5031888484954834, 0.48775985836982727],
'details': [{'aspect': 'Ohjelma',
'confidence': 0.5031888484954834,
'end': 7,
'extractor_label': 'ASP-Neutral',
'extractor_score': 0.5031888484954834,
'probability': {'Negative': 0.2484055757522583,
'Neutral': 0.5031888484954834,
'Positive': 0.2484055757522583},
'sentiment': 'Neutral',
'start': 0},
{'aspect': 'käyttöliittymä',
'confidence': 0.48775985836982727,
'end': 40,
'extractor_label': 'ASP-Neutral',
'extractor_score': 0.48775985836982727,
'probability': {'Negative': 0.25612007081508636,
'Neutral': 0.48775985836982727,
'Positive': 0.25612007081508636},
'sentiment': 'Neutral',
'start': 25}],
'positions': [[0, 7], [25, 40]],
'sentiments': ['Neutral', 'Neutral'],
'text': 'Ohjelma on tehokas, mutta käyttöliittymä on sekava.'},
{'aspects': ['Maden', 'portion'],
'confidence': [0.4489361047744751, 0.544648289680481],
'details': [{'aspect': 'Maden',
'confidence': 0.4489361047744751,
'end': 5,
'extractor_label': 'ASP-Neutral',
'extractor_score': 0.4489361047744751,
'probability': {'Negative': 0.27553194761276245,
'Neutral': 0.4489361047744751,
'Positive': 0.27553194761276245},
'sentiment': 'Neutral',
'start': 0},
{'aspect': 'portion',
'confidence': 0.544648289680481,
'end': 29,
'extractor_label': 'ASP-Negative',
'extractor_score': 0.544648289680481,
'probability': {'Negative': 0.544648289680481,
'Neutral': 0.22767585515975952,
'Positive': 0.22767585515975952},
'sentiment': 'Negative',
'start': 21}],
'positions': [[0, 5], [21, 29]],
'sentiments': ['Neutral', 'Negative'],
'text': 'Maden var lækker, men portionerne var for små.'},
{'aspects': ['Počítač', 'software'],
'confidence': [0.507230281829834, 0.5066105723381042],
'details': [{'aspect': 'Počítač',
'confidence': 0.507230281829834,
'end': 7,
'extractor_label': 'ASP-Neutral',
'extractor_score': 0.507230281829834,
'probability': {'Negative': 0.246384859085083,
'Neutral': 0.507230281829834,
'Positive': 0.246384859085083},
'sentiment': 'Neutral',
'start': 0},
{'aspect': 'software',
'confidence': 0.5066105723381042,
'end': 31,
'extractor_label': 'ASP-Neutral',
'extractor_score': 0.5066105723381042,
'probability': {'Negative': 0.24669471383094788,
'Neutral': 0.5066105723381042,
'Positive': 0.24669471383094788},
'sentiment': 'Neutral',
'start': 22}],
'positions': [[0, 7], [22, 31]],
'sentiments': ['Neutral', 'Neutral'],
'text': 'Počítač je rychlý, ale software je zastaralý.'}]
"""