Text Classification
Transformers
PyTorch
Safetensors
deberta-v2
multilingual-sentiment-analysis
sentiment-analysis
aspect-based-sentiment-analysis
deberta
pyabsa
efficient
lightweight
production-ready
no-llm
Instructions to use yangheng/deberta-v3-base-absa-v1.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yangheng/deberta-v3-base-absa-v1.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="yangheng/deberta-v3-base-absa-v1.1")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("yangheng/deberta-v3-base-absa-v1.1") model = AutoModelForSequenceClassification.from_pretrained("yangheng/deberta-v3-base-absa-v1.1", device_map="auto") - Inference
- Notebooks
- Google Colab
- Kaggle
Upload end2end_absa.py
Browse files- end2end_absa.py +1134 -0
end2end_absa.py
ADDED
|
@@ -0,0 +1,1134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# -*- coding: utf-8 -*-
|
| 2 |
+
# File: end2end_absa.py
|
| 3 |
+
# Time: 18:44 12/08/2025
|
| 4 |
+
# Author: YANG, HENG <hy345@exeter.ac.uk> (杨恒)
|
| 5 |
+
# Website: https://yangheng95.github.io
|
| 6 |
+
# GitHub: https://github.com/yangheng95
|
| 7 |
+
# HuggingFace: https://huggingface.co/yangheng
|
| 8 |
+
# Google Scholar: https://scholar.google.com/citations?user=NPq5a_0AAAAJ&hl=en
|
| 9 |
+
# Copyright (C) 2019-2025. All rights reserved.
|
| 10 |
+
|
| 11 |
+
# ====== New/Replacement imports ======
|
| 12 |
+
from typing import List, Dict, Any
|
| 13 |
+
|
| 14 |
+
from transformers import (
|
| 15 |
+
AutoModelForSequenceClassification,
|
| 16 |
+
AutoTokenizer,
|
| 17 |
+
AutoModelForTokenClassification,
|
| 18 |
+
pipeline
|
| 19 |
+
)
|
| 20 |
+
|
| 21 |
+
import torch
|
| 22 |
+
import re
|
| 23 |
+
from pprint import pprint
|
| 24 |
+
|
| 25 |
+
# Device configuration
|
| 26 |
+
device = 0 if torch.cuda.is_available() else -1
|
| 27 |
+
|
| 28 |
+
# Model configurations
|
| 29 |
+
ASPECT_MODEL_ID = "yangheng/deberta-v3-base-end2end-absa"
|
| 30 |
+
SENTI_MODEL_ID = "yangheng/deberta-v3-base-absa-v1.1"
|
| 31 |
+
|
| 32 |
+
# When classifier's highest confidence < this threshold, optionally use extractor's ASP-XXX as fallback
|
| 33 |
+
USE_EXTRACTOR_SENTI_AS_FALLBACK = True
|
| 34 |
+
FALLBACK_CONFIDENCE_THRESHOLD = 0.8
|
| 35 |
+
|
| 36 |
+
# Maximum length and truncation strategy to avoid truncation warnings
|
| 37 |
+
TRUNCATION = True
|
| 38 |
+
MAX_LENGTH = 512 # Adjust based on GPU memory and text length
|
| 39 |
+
BATCH_SIZE = 16 # Batch size, adjust based on resources
|
| 40 |
+
|
| 41 |
+
# ================================
|
| 42 |
+
|
| 43 |
+
# Initialize tokenizer and model for aspect extraction
|
| 44 |
+
try:
|
| 45 |
+
tok_asp = AutoTokenizer.from_pretrained(SENTI_MODEL_ID, use_fast=True)
|
| 46 |
+
mdl_asp = AutoModelForTokenClassification.from_pretrained(ASPECT_MODEL_ID)
|
| 47 |
+
|
| 48 |
+
aspect_extractor = pipeline(
|
| 49 |
+
task="token-classification",
|
| 50 |
+
model=mdl_asp,
|
| 51 |
+
tokenizer=tok_asp,
|
| 52 |
+
aggregation_strategy="simple",
|
| 53 |
+
device=device,
|
| 54 |
+
)
|
| 55 |
+
except Exception as e:
|
| 56 |
+
print(f"Error loading aspect extraction models: {e}")
|
| 57 |
+
raise
|
| 58 |
+
|
| 59 |
+
# Initialize sentiment classifier (text_pair mode)
|
| 60 |
+
try:
|
| 61 |
+
sent_classifier = pipeline(
|
| 62 |
+
task="text-classification",
|
| 63 |
+
model=SENTI_MODEL_ID,
|
| 64 |
+
device=device,
|
| 65 |
+
return_all_scores=True, # Return all class scores for confidence
|
| 66 |
+
function_to_apply="softmax",
|
| 67 |
+
top_k=None
|
| 68 |
+
)
|
| 69 |
+
except Exception as e:
|
| 70 |
+
print(f"Error loading sentiment classification model: {e}")
|
| 71 |
+
raise
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
# --- Defensive fallback: when offset is missing, use substring search ---
|
| 75 |
+
|
| 76 |
+
def _clean_aspect(s: str) -> str:
|
| 77 |
+
"""Clean aspect string by removing leading/trailing punctuation and whitespace."""
|
| 78 |
+
if not s:
|
| 79 |
+
return ""
|
| 80 |
+
return re.sub(r'^[\s\.,;:!?\(\)\[\]\{\}"\']+|[\s\.,;:!?\(\)\[\]\{\}"\']+$', "", s).strip()
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
def _locate_span(text: str, phrase: str):
|
| 84 |
+
"""Locate the span of a phrase in text, with case-insensitive fallback."""
|
| 85 |
+
if not phrase:
|
| 86 |
+
return None
|
| 87 |
+
|
| 88 |
+
# Try exact match first
|
| 89 |
+
pat = re.escape(phrase)
|
| 90 |
+
m = re.search(pat, text)
|
| 91 |
+
if m:
|
| 92 |
+
return m.start(), m.end()
|
| 93 |
+
|
| 94 |
+
# Try case-insensitive match
|
| 95 |
+
m = re.search(pat, text, flags=re.IGNORECASE)
|
| 96 |
+
if m:
|
| 97 |
+
return m.start(), m.end()
|
| 98 |
+
|
| 99 |
+
return None
|
| 100 |
+
|
| 101 |
+
|
| 102 |
+
def extract_aspects_for_text(text: str) -> List[Dict[str, Any]]:
|
| 103 |
+
"""
|
| 104 |
+
Extract aspects from a single text using the aspect extraction model.
|
| 105 |
+
|
| 106 |
+
Args:
|
| 107 |
+
text: Input text to extract aspects from
|
| 108 |
+
|
| 109 |
+
Returns:
|
| 110 |
+
List of aspect dictionaries with position and metadata
|
| 111 |
+
"""
|
| 112 |
+
if not text.strip():
|
| 113 |
+
return []
|
| 114 |
+
|
| 115 |
+
try:
|
| 116 |
+
ents = aspect_extractor(text)
|
| 117 |
+
print(f"Raw entities extracted: {ents}") # Debug output
|
| 118 |
+
except Exception as e:
|
| 119 |
+
print(f"Error in aspect extraction for text '{text[:50]}...': {e}")
|
| 120 |
+
return []
|
| 121 |
+
|
| 122 |
+
aspects = []
|
| 123 |
+
seen = set()
|
| 124 |
+
|
| 125 |
+
for ent in ents:
|
| 126 |
+
label = (ent.get("entity_group") or "").lower()
|
| 127 |
+
print(f"Processing entity: {ent}, label: {label}") # Debug output
|
| 128 |
+
|
| 129 |
+
# More flexible label matching
|
| 130 |
+
if not any(keyword in label for keyword in ["asp", "aspect", "b-", "i-"]):
|
| 131 |
+
print(f"Skipping entity with label: {label}")
|
| 132 |
+
continue
|
| 133 |
+
|
| 134 |
+
word = _clean_aspect(ent.get("word", ""))
|
| 135 |
+
if not word: # Skip empty aspects
|
| 136 |
+
print(f"Skipping empty aspect")
|
| 137 |
+
continue
|
| 138 |
+
|
| 139 |
+
start = ent.get("start")
|
| 140 |
+
end = ent.get("end")
|
| 141 |
+
|
| 142 |
+
# Fallback: when offset is missing, relocate using substring search
|
| 143 |
+
if start is None or end is None:
|
| 144 |
+
loc = _locate_span(text, word)
|
| 145 |
+
if loc:
|
| 146 |
+
start, end = loc
|
| 147 |
+
else:
|
| 148 |
+
# Skip if position cannot be determined to avoid dirty data
|
| 149 |
+
print(f"Could not locate aspect '{word}' in text")
|
| 150 |
+
continue
|
| 151 |
+
|
| 152 |
+
# Avoid duplicates
|
| 153 |
+
key = (word.lower(), int(start), int(end))
|
| 154 |
+
if key in seen:
|
| 155 |
+
continue
|
| 156 |
+
seen.add(key)
|
| 157 |
+
|
| 158 |
+
aspect_dict = {
|
| 159 |
+
"aspect": word,
|
| 160 |
+
"start": int(start),
|
| 161 |
+
"end": int(end),
|
| 162 |
+
"extractor_label": ent.get("entity_group", ""),
|
| 163 |
+
"extractor_score": float(ent.get("score", 0.0)),
|
| 164 |
+
}
|
| 165 |
+
aspects.append(aspect_dict)
|
| 166 |
+
print(f"Added aspect: {aspect_dict}") # Debug output
|
| 167 |
+
|
| 168 |
+
print(f"Final aspects for text: {aspects}") # Debug output
|
| 169 |
+
return aspects
|
| 170 |
+
|
| 171 |
+
|
| 172 |
+
def classify_aspects(text: str, aspects: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
|
| 173 |
+
"""
|
| 174 |
+
Classify sentiment polarity for each (text, aspect) pair.
|
| 175 |
+
Since the aspect extractor already provides sentiment labels (ASP-Positive, etc.),
|
| 176 |
+
we can use those directly or optionally run additional classification.
|
| 177 |
+
|
| 178 |
+
Args:
|
| 179 |
+
text: Original text
|
| 180 |
+
aspects: List of aspect dictionaries
|
| 181 |
+
|
| 182 |
+
Returns:
|
| 183 |
+
List of aspects enriched with sentiment and confidence information
|
| 184 |
+
"""
|
| 185 |
+
if not aspects:
|
| 186 |
+
return []
|
| 187 |
+
|
| 188 |
+
enriched = []
|
| 189 |
+
for asp in aspects:
|
| 190 |
+
# Extract sentiment from the extractor label (ASP-Positive -> Positive)
|
| 191 |
+
extractor_label = asp.get("extractor_label", "")
|
| 192 |
+
extractor_confidence = asp.get("extractor_score", 0.0)
|
| 193 |
+
|
| 194 |
+
# Default values
|
| 195 |
+
sentiment = "Neutral"
|
| 196 |
+
confidence = extractor_confidence
|
| 197 |
+
prob_map = {"Positive": 0.33, "Negative": 0.33, "Neutral": 0.33}
|
| 198 |
+
|
| 199 |
+
# Parse sentiment from extractor label
|
| 200 |
+
if "-" in extractor_label:
|
| 201 |
+
_, maybe_sentiment = extractor_label.split("-", 1)
|
| 202 |
+
if maybe_sentiment.capitalize() in ("Positive", "Negative", "Neutral"):
|
| 203 |
+
sentiment = maybe_sentiment.capitalize()
|
| 204 |
+
# Create probability distribution with extractor confidence
|
| 205 |
+
prob_map = {
|
| 206 |
+
"Positive": confidence if sentiment == "Positive" else (1 - confidence) / 2,
|
| 207 |
+
"Negative": confidence if sentiment == "Negative" else (1 - confidence) / 2,
|
| 208 |
+
"Neutral": confidence if sentiment == "Neutral" else (1 - confidence) / 2
|
| 209 |
+
}
|
| 210 |
+
|
| 211 |
+
# Optionally run additional sentiment classification if confidence is low
|
| 212 |
+
if confidence < FALLBACK_CONFIDENCE_THRESHOLD:
|
| 213 |
+
try:
|
| 214 |
+
# Try additional classification
|
| 215 |
+
combined_input = f"{text} [SEP] {asp['aspect']}"
|
| 216 |
+
|
| 217 |
+
result = sent_classifier(
|
| 218 |
+
combined_input,
|
| 219 |
+
truncation=TRUNCATION,
|
| 220 |
+
max_length=MAX_LENGTH
|
| 221 |
+
)
|
| 222 |
+
|
| 223 |
+
if result and isinstance(result, list) and len(result) > 0:
|
| 224 |
+
if isinstance(result[0], dict):
|
| 225 |
+
best = max(result, key=lambda d: d.get("score", 0))
|
| 226 |
+
classifier_sentiment = best.get("label", sentiment)
|
| 227 |
+
classifier_confidence = float(best.get("score", confidence))
|
| 228 |
+
|
| 229 |
+
# Use classifier result if it has higher confidence
|
| 230 |
+
if classifier_confidence > confidence:
|
| 231 |
+
sentiment = classifier_sentiment
|
| 232 |
+
confidence = classifier_confidence
|
| 233 |
+
prob_map = {d.get("label", "Neutral"): float(d.get("score", 0)) for d in result}
|
| 234 |
+
|
| 235 |
+
except Exception as e:
|
| 236 |
+
print(f"Error in additional classification for aspect '{asp['aspect']}': {e}")
|
| 237 |
+
# Keep the extractor's result
|
| 238 |
+
|
| 239 |
+
enriched.append({
|
| 240 |
+
**asp,
|
| 241 |
+
"sentiment": sentiment,
|
| 242 |
+
"confidence": confidence,
|
| 243 |
+
"probability": prob_map
|
| 244 |
+
})
|
| 245 |
+
|
| 246 |
+
return enriched
|
| 247 |
+
|
| 248 |
+
|
| 249 |
+
def absa(texts: List[str]) -> List[Dict[str, Any]]:
|
| 250 |
+
"""
|
| 251 |
+
Main entry point: Extract aspects from each text and classify their sentiment polarity.
|
| 252 |
+
|
| 253 |
+
Args:
|
| 254 |
+
texts: List of input texts
|
| 255 |
+
|
| 256 |
+
Returns:
|
| 257 |
+
List of structured results for each text
|
| 258 |
+
"""
|
| 259 |
+
if not texts:
|
| 260 |
+
return []
|
| 261 |
+
|
| 262 |
+
results = []
|
| 263 |
+
for i, text in enumerate(texts):
|
| 264 |
+
if not isinstance(text, str):
|
| 265 |
+
print(f"Warning: Text at index {i} is not a string, skipping")
|
| 266 |
+
continue
|
| 267 |
+
|
| 268 |
+
try:
|
| 269 |
+
aspects = extract_aspects_for_text(text)
|
| 270 |
+
aspects = classify_aspects(text, aspects)
|
| 271 |
+
|
| 272 |
+
results.append({
|
| 273 |
+
"text": text,
|
| 274 |
+
"aspects": [a["aspect"] for a in aspects],
|
| 275 |
+
"positions": [[a["start"], a["end"]] for a in aspects],
|
| 276 |
+
"sentiments": [a["sentiment"] for a in aspects],
|
| 277 |
+
"confidence": [a["confidence"] for a in aspects],
|
| 278 |
+
"details": aspects # Preserve rich original information
|
| 279 |
+
})
|
| 280 |
+
except Exception as e:
|
| 281 |
+
print(f"Error processing text at index {i}: {e}")
|
| 282 |
+
results.append({
|
| 283 |
+
"text": text,
|
| 284 |
+
"aspects": [],
|
| 285 |
+
"positions": [],
|
| 286 |
+
"sentiments": [],
|
| 287 |
+
"confidence": [],
|
| 288 |
+
"details": []
|
| 289 |
+
})
|
| 290 |
+
|
| 291 |
+
return results
|
| 292 |
+
|
| 293 |
+
|
| 294 |
+
if __name__ == "__main__":
|
| 295 |
+
# Test samples in multiple languages
|
| 296 |
+
samples = [
|
| 297 |
+
"The user interface is brilliant, but the documentation is a total mess.",
|
| 298 |
+
# English
|
| 299 |
+
"这家餐厅的牛排很好吃,但是服务很慢。",
|
| 300 |
+
# Chinese (Simplified): The steak at this restaurant is delicious, but the service is slow.
|
| 301 |
+
"La batería es malísima, aunque la cámara está muy bien.",
|
| 302 |
+
# Spanish: The battery is terrible, although the camera is very good.
|
| 303 |
+
"Le film était captivant, mais la fin était décevante.",
|
| 304 |
+
# French: The movie was captivating, but the ending was disappointing.
|
| 305 |
+
"Das Auto ist sehr sparsam, aber die Sitze sind unbequem.",
|
| 306 |
+
# German: The car is very economical, but the seats are uncomfortable.
|
| 307 |
+
"Il design è elegante, però il software è pieno di bug.",
|
| 308 |
+
# Italian: The design is elegant, but the software is full of bugs.
|
| 309 |
+
"O hotel tem uma vista incrível, mas o café da manhã é fraco.",
|
| 310 |
+
# Portuguese: The hotel has an incredible view, but the breakfast is weak.
|
| 311 |
+
"Книга очень интересная, но перевод оставляет желать лучшего.",
|
| 312 |
+
# Russian: The book is very interesting, but the translation leaves much to be desired.
|
| 313 |
+
"このアプリは便利だけど、バッテリーの消費が激しい。",
|
| 314 |
+
# Japanese: This app is useful, but it drains the battery quickly.
|
| 315 |
+
"음식은 맛있었지만, 가격이 너무 비쌌어요.",
|
| 316 |
+
# Korean: The food was delicious, but the price was too expensive.
|
| 317 |
+
"الخدمة ممتازة، لكن الموقع صعب الوصول إليه.",
|
| 318 |
+
# Arabic: The service is excellent, but the location is hard to reach.
|
| 319 |
+
"फ़ोन का कैमरा शानदार है, लेकिन बैटरी लाइफ खराब है।",
|
| 320 |
+
# Hindi: The phone's camera is great, but the battery life is bad.
|
| 321 |
+
"De locatie is perfect, alleen is het personeel onvriendelijk.",
|
| 322 |
+
# Dutch: The location is perfect, however the staff is unfriendly.
|
| 323 |
+
"Boken är välskriven, men handlingen är förutsägbar.",
|
| 324 |
+
# Swedish: The book is well-written, but the plot is predictable.
|
| 325 |
+
"Grafika w grze jest niesamowita, ale fabuła jest nudna.",
|
| 326 |
+
# Polish: The graphics in the game are amazing, but the story is boring.
|
| 327 |
+
"Ürün kaliteli görünüyor ama kargo çok geç geldi.",
|
| 328 |
+
# Turkish: The product looks high quality, but the shipping was very late.
|
| 329 |
+
"Chất lượng âm thanh tốt, tuy nhiên tai nghe không thoải mái lắm.",
|
| 330 |
+
# Vietnamese: The sound quality is good, however the headphones are not very comfortable.
|
| 331 |
+
"การแสดงดีมาก แต่บทภาพยนตร์ค่อนข้างอ่อน",
|
| 332 |
+
# Thai: The acting was great, but the script was rather weak.
|
| 333 |
+
"Η τοποθεσία είναι φανταστική, αλλά το δωμάτιο ήταν πολύ μικρό.",
|
| 334 |
+
# Greek: The location is fantastic, but the room was very small.
|
| 335 |
+
"המשחק מהנה, אבל יש בו יותר מדי פרסומות.",
|
| 336 |
+
# Hebrew: The game is fun, but it has too many ads.
|
| 337 |
+
"Ponsel ini cepat, tetapi cenderung cepat panas.",
|
| 338 |
+
# Indonesian: This phone is fast, but it tends to get hot quickly.
|
| 339 |
+
"Ohjelma on tehokas, mutta käyttöliittymä on sekava.",
|
| 340 |
+
# Finnish: The program is powerful, but the user interface is confusing.
|
| 341 |
+
"Maden var lækker, men portionerne var for små.",
|
| 342 |
+
# Danish: The food was delicious, but the portions were too small.
|
| 343 |
+
"Počítač je rychlý, ale software je zastaralý.",
|
| 344 |
+
# Czech: The computer is fast, but the software is outdated.
|
| 345 |
+
]
|
| 346 |
+
|
| 347 |
+
|
| 348 |
+
print("Running ABSA analysis...")
|
| 349 |
+
try:
|
| 350 |
+
results = absa(samples)
|
| 351 |
+
print("\nResults:")
|
| 352 |
+
pprint(results, width=120)
|
| 353 |
+
except Exception as e:
|
| 354 |
+
print(f"Error running ABSA: {e}")
|
| 355 |
+
|
| 356 |
+
|
| 357 |
+
# >>>> # Example output:
|
| 358 |
+
"""
|
| 359 |
+
Running ABSA analysis...
|
| 360 |
+
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}]
|
| 361 |
+
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.51754177), 'word': 'user interface', 'start': 3, 'end': 18}, label: asp-neutral
|
| 362 |
+
Added aspect: {'aspect': 'user interface', 'start': 3, 'end': 18, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.517541766166687}
|
| 363 |
+
Processing entity: {'entity_group': 'ASP-Negative', 'score': np.float32(0.52044636), 'word': 'documentation', 'start': 40, 'end': 54}, label: asp-negative
|
| 364 |
+
Added aspect: {'aspect': 'documentation', 'start': 40, 'end': 54, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.5204463601112366}
|
| 365 |
+
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}]
|
| 366 |
+
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}]
|
| 367 |
+
Processing entity: {'entity_group': 'ASP-Positive', 'score': np.float32(0.5346123), 'word': '牛排', 'start': 5, 'end': 7}, label: asp-positive
|
| 368 |
+
Added aspect: {'aspect': '牛排', 'start': 5, 'end': 7, 'extractor_label': 'ASP-Positive', 'extractor_score': 0.5346122980117798}
|
| 369 |
+
Processing entity: {'entity_group': 'ASP-Negative', 'score': np.float32(0.5622819), 'word': '服务', 'start': 13, 'end': 15}, label: asp-negative
|
| 370 |
+
Added aspect: {'aspect': '服务', 'start': 13, 'end': 15, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.5622819066047668}
|
| 371 |
+
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}]
|
| 372 |
+
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}]
|
| 373 |
+
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.4336498), 'word': 'batería', 'start': 2, 'end': 10}, label: asp-neutral
|
| 374 |
+
Added aspect: {'aspect': 'batería', 'start': 2, 'end': 10, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.43364980816841125}
|
| 375 |
+
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.44364822), 'word': 'cámara', 'start': 33, 'end': 40}, label: asp-neutral
|
| 376 |
+
Added aspect: {'aspect': 'cámara', 'start': 33, 'end': 40, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.44364821910858154}
|
| 377 |
+
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}]
|
| 378 |
+
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}]
|
| 379 |
+
Processing entity: {'entity_group': 'ASP-Positive', 'score': np.float32(0.6539798), 'word': 'film', 'start': 2, 'end': 7}, label: asp-positive
|
| 380 |
+
Added aspect: {'aspect': 'film', 'start': 2, 'end': 7, 'extractor_label': 'ASP-Positive', 'extractor_score': 0.6539797782897949}
|
| 381 |
+
Processing entity: {'entity_group': 'ASP-Negative', 'score': np.float32(0.41829002), 'word': 'fin', 'start': 32, 'end': 36}, label: asp-negative
|
| 382 |
+
Added aspect: {'aspect': 'fin', 'start': 32, 'end': 36, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.41829001903533936}
|
| 383 |
+
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}]
|
| 384 |
+
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}]
|
| 385 |
+
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.5750168), 'word': 'Auto', 'start': 3, 'end': 8}, label: asp-neutral
|
| 386 |
+
Added aspect: {'aspect': 'Auto', 'start': 3, 'end': 8, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.5750167965888977}
|
| 387 |
+
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.49865413), 'word': 'Sitze', 'start': 35, 'end': 41}, label: asp-neutral
|
| 388 |
+
Added aspect: {'aspect': 'Sitze', 'start': 35, 'end': 41, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.4986541271209717}
|
| 389 |
+
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}]
|
| 390 |
+
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}]
|
| 391 |
+
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.6298937), 'word': 'design', 'start': 2, 'end': 9}, label: asp-neutral
|
| 392 |
+
Added aspect: {'aspect': 'design', 'start': 2, 'end': 9, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.6298937201499939}
|
| 393 |
+
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.605807), 'word': 'software', 'start': 29, 'end': 38}, label: asp-neutral
|
| 394 |
+
Added aspect: {'aspect': 'software', 'start': 29, 'end': 38, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.6058070063591003}
|
| 395 |
+
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}]
|
| 396 |
+
You seem to be using the pipelines sequentially on GPU. In order to maximize efficiency please use a dataset
|
| 397 |
+
Raw entities extracted: [{'entity_group': 'ASP-Negative', 'score': np.float32(0.56500643), 'word': 'café', 'start': 37, 'end': 42}]
|
| 398 |
+
Processing entity: {'entity_group': 'ASP-Negative', 'score': np.float32(0.56500643), 'word': 'café', 'start': 37, 'end': 42}, label: asp-negative
|
| 399 |
+
Added aspect: {'aspect': 'café', 'start': 37, 'end': 42, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.56500643491745}
|
| 400 |
+
Final aspects for text: [{'aspect': 'café', 'start': 37, 'end': 42, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.56500643491745}]
|
| 401 |
+
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}]
|
| 402 |
+
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.42165104), 'word': 'Кни', 'start': 0, 'end': 3}, label: asp-neutral
|
| 403 |
+
Added aspect: {'aspect': 'Кни', 'start': 0, 'end': 3, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.42165103554725647}
|
| 404 |
+
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.56838894), 'word': 'пере', 'start': 26, 'end': 31}, label: asp-neutral
|
| 405 |
+
Added aspect: {'aspect': 'пере', 'start': 26, 'end': 31, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.5683889389038086}
|
| 406 |
+
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}]
|
| 407 |
+
Raw entities extracted: [{'entity_group': 'ASP-Negative', 'score': np.float32(0.5808011), 'word': 'バッテリー', 'start': 12, 'end': 17}]
|
| 408 |
+
Processing entity: {'entity_group': 'ASP-Negative', 'score': np.float32(0.5808011), 'word': 'バッテリー', 'start': 12, 'end': 17}, label: asp-negative
|
| 409 |
+
Added aspect: {'aspect': 'バッテリー', 'start': 12, 'end': 17, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.5808011293411255}
|
| 410 |
+
Final aspects for text: [{'aspect': 'バッテリー', 'start': 12, 'end': 17, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.5808011293411255}]
|
| 411 |
+
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}]
|
| 412 |
+
Processing entity: {'entity_group': 'ASP-Positive', 'score': np.float32(0.49294925), 'word': '', 'start': 0, 'end': 1}, label: asp-positive
|
| 413 |
+
Skipping empty aspect
|
| 414 |
+
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.5432428), 'word': '음식', 'start': 0, 'end': 2}, label: asp-neutral
|
| 415 |
+
Added aspect: {'aspect': '음식', 'start': 0, 'end': 2, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.5432428121566772}
|
| 416 |
+
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.46728912), 'word': '가격', 'start': 10, 'end': 13}, label: asp-neutral
|
| 417 |
+
Added aspect: {'aspect': '가격', 'start': 10, 'end': 13, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.46728911995887756}
|
| 418 |
+
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}]
|
| 419 |
+
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}]
|
| 420 |
+
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.5339548), 'word': 'الخ', 'start': 0, 'end': 3}, label: asp-neutral
|
| 421 |
+
Added aspect: {'aspect': 'الخ', 'start': 0, 'end': 3, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.5339547991752625}
|
| 422 |
+
Processing entity: {'entity_group': 'ASP-Positive', 'score': np.float32(0.50554234), 'word': 'دمة', 'start': 3, 'end': 6}, label: asp-positive
|
| 423 |
+
Added aspect: {'aspect': 'دمة', 'start': 3, 'end': 6, 'extractor_label': 'ASP-Positive', 'extractor_score': 0.5055423378944397}
|
| 424 |
+
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.44124436), 'word': 'الموق', 'start': 18, 'end': 24}, label: asp-neutral
|
| 425 |
+
Added aspect: {'aspect': 'الموق', 'start': 18, 'end': 24, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.44124436378479004}
|
| 426 |
+
Processing entity: {'entity_group': 'ASP-Negative', 'score': np.float32(0.45630246), 'word': 'ع', 'start': 24, 'end': 25}, label: asp-negative
|
| 427 |
+
Added aspect: {'aspect': 'ع', 'start': 24, 'end': 25, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.4563024640083313}
|
| 428 |
+
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}]
|
| 429 |
+
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}]
|
| 430 |
+
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.45512593), 'word': 'कैमरा', 'start': 7, 'end': 13}, label: asp-neutral
|
| 431 |
+
Added aspect: {'aspect': 'कैमरा', 'start': 7, 'end': 13, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.45512592792510986}
|
| 432 |
+
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.47939613), 'word': 'बैट', 'start': 30, 'end': 34}, label: asp-neutral
|
| 433 |
+
Added aspect: {'aspect': 'बैट', 'start': 30, 'end': 34, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.47939613461494446}
|
| 434 |
+
Processing entity: {'entity_group': 'ASP-Negative', 'score': np.float32(0.43590102), 'word': 'री', 'start': 34, 'end': 36}, label: asp-negative
|
| 435 |
+
Added aspect: {'aspect': 'री', 'start': 34, 'end': 36, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.435901015996933}
|
| 436 |
+
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.46086523), 'word': 'लाइफ', 'start': 36, 'end': 41}, label: asp-neutral
|
| 437 |
+
Added aspect: {'aspect': 'लाइफ', 'start': 36, 'end': 41, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.46086522936820984}
|
| 438 |
+
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}]
|
| 439 |
+
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}]
|
| 440 |
+
Processing entity: {'entity_group': 'ASP-Positive', 'score': np.float32(0.4961163), 'word': 'locatie', 'start': 2, 'end': 10}, label: asp-positive
|
| 441 |
+
Added aspect: {'aspect': 'locatie', 'start': 2, 'end': 10, 'extractor_label': 'ASP-Positive', 'extractor_score': 0.4961163103580475}
|
| 442 |
+
Processing entity: {'entity_group': 'ASP-Negative', 'score': np.float32(0.48402262), 'word': 'personeel', 'start': 36, 'end': 46}, label: asp-negative
|
| 443 |
+
Added aspect: {'aspect': 'personeel', 'start': 36, 'end': 46, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.4840226173400879}
|
| 444 |
+
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}]
|
| 445 |
+
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}]
|
| 446 |
+
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.4699115), 'word': 'Bok', 'start': 0, 'end': 3}, label: asp-neutral
|
| 447 |
+
Added aspect: {'aspect': 'Bok', 'start': 0, 'end': 3, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.46991148591041565}
|
| 448 |
+
Processing entity: {'entity_group': 'ASP-Negative', 'score': np.float32(0.44758555), 'word': 'handling', 'start': 24, 'end': 33}, label: asp-negative
|
| 449 |
+
Added aspect: {'aspect': 'handling', 'start': 24, 'end': 33, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.4475855529308319}
|
| 450 |
+
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}]
|
| 451 |
+
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}]
|
| 452 |
+
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.55233693), 'word': 'Grafika', 'start': 0, 'end': 7}, label: asp-neutral
|
| 453 |
+
Added aspect: {'aspect': 'Grafika', 'start': 0, 'end': 7, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.5523369312286377}
|
| 454 |
+
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.38001376), 'word': 'g', 'start': 9, 'end': 11}, label: asp-neutral
|
| 455 |
+
Added aspect: {'aspect': 'g', 'start': 9, 'end': 11, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.38001376390457153}
|
| 456 |
+
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.5456186), 'word': 'fabuła', 'start': 36, 'end': 43}, label: asp-neutral
|
| 457 |
+
Added aspect: {'aspect': 'fabuła', 'start': 36, 'end': 43, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.5456185936927795}
|
| 458 |
+
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}]
|
| 459 |
+
Raw entities extracted: [{'entity_group': 'ASP-Negative', 'score': np.float32(0.64053774), 'word': 'kargo', 'start': 27, 'end': 33}]
|
| 460 |
+
Processing entity: {'entity_group': 'ASP-Negative', 'score': np.float32(0.64053774), 'word': 'kargo', 'start': 27, 'end': 33}, label: asp-negative
|
| 461 |
+
Added aspect: {'aspect': 'kargo', 'start': 27, 'end': 33, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.6405377388000488}
|
| 462 |
+
Final aspects for text: [{'aspect': 'kargo', 'start': 27, 'end': 33, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.6405377388000488}]
|
| 463 |
+
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}]
|
| 464 |
+
Processing entity: {'entity_group': 'ASP-Positive', 'score': np.float32(0.6112579), 'word': 'Ch', 'start': 0, 'end': 2}, label: asp-positive
|
| 465 |
+
Added aspect: {'aspect': 'Ch', 'start': 0, 'end': 2, 'extractor_label': 'ASP-Positive', 'extractor_score': 0.6112579107284546}
|
| 466 |
+
Processing entity: {'entity_group': 'ASP-Positive', 'score': np.float32(0.6159069), 'word': 'lượng âm thanh', 'start': 4, 'end': 19}, label: asp-positive
|
| 467 |
+
Added aspect: {'aspect': 'lượng âm thanh', 'start': 4, 'end': 19, 'extractor_label': 'ASP-Positive', 'extractor_score': 0.6159068942070007}
|
| 468 |
+
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}]
|
| 469 |
+
Raw entities extracted: []
|
| 470 |
+
Final aspects for text: []
|
| 471 |
+
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}]
|
| 472 |
+
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.64732456), 'word': 'τοποθεσία', 'start': 1, 'end': 11}, label: asp-neutral
|
| 473 |
+
Added aspect: {'aspect': 'τοποθεσία', 'start': 1, 'end': 11, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.6473245620727539}
|
| 474 |
+
Processing entity: {'entity_group': 'ASP-Negative', 'score': np.float32(0.49225593), 'word': 'δω', 'start': 37, 'end': 40}, label: asp-negative
|
| 475 |
+
Added aspect: {'aspect': 'δω', 'start': 37, 'end': 40, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.49225592613220215}
|
| 476 |
+
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.4857553), 'word': 'μάτιο', 'start': 40, 'end': 45}, label: asp-neutral
|
| 477 |
+
Added aspect: {'aspect': 'μάτιο', 'start': 40, 'end': 45, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.4857552945613861}
|
| 478 |
+
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}]
|
| 479 |
+
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}]
|
| 480 |
+
Processing entity: {'entity_group': 'ASP-Positive', 'score': np.float32(0.41735768), 'word': 'ה', 'start': 0, 'end': 1}, label: asp-positive
|
| 481 |
+
Added aspect: {'aspect': 'ה', 'start': 0, 'end': 1, 'extractor_label': 'ASP-Positive', 'extractor_score': 0.4173576831817627}
|
| 482 |
+
Processing entity: {'entity_group': 'ASP-Positive', 'score': np.float32(0.39395496), 'word': 'משחק', 'start': 1, 'end': 5}, label: asp-positive
|
| 483 |
+
Added aspect: {'aspect': 'משחק', 'start': 1, 'end': 5, 'extractor_label': 'ASP-Positive', 'extractor_score': 0.39395496249198914}
|
| 484 |
+
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}]
|
| 485 |
+
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}]
|
| 486 |
+
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.5927124), 'word': 'Pons', 'start': 0, 'end': 4}, label: asp-neutral
|
| 487 |
+
Added aspect: {'aspect': 'Pons', 'start': 0, 'end': 4, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.59271240234375}
|
| 488 |
+
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.281419), 'word': 'el', 'start': 4, 'end': 6}, label: asp-neutral
|
| 489 |
+
Added aspect: {'aspect': 'el', 'start': 4, 'end': 6, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.2814190089702606}
|
| 490 |
+
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.56265074), 'word': 'tetapi', 'start': 17, 'end': 24}, label: asp-neutral
|
| 491 |
+
Added aspect: {'aspect': 'tetapi', 'start': 17, 'end': 24, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.562650740146637}
|
| 492 |
+
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}]
|
| 493 |
+
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}]
|
| 494 |
+
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.50318885), 'word': 'Ohjelma', 'start': 0, 'end': 7}, label: asp-neutral
|
| 495 |
+
Added aspect: {'aspect': 'Ohjelma', 'start': 0, 'end': 7, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.5031888484954834}
|
| 496 |
+
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.48775986), 'word': 'käyttöliittymä', 'start': 25, 'end': 40}, label: asp-neutral
|
| 497 |
+
Added aspect: {'aspect': 'käyttöliittymä', 'start': 25, 'end': 40, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.48775985836982727}
|
| 498 |
+
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}]
|
| 499 |
+
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}]
|
| 500 |
+
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.4489361), 'word': 'Maden', 'start': 0, 'end': 5}, label: asp-neutral
|
| 501 |
+
Added aspect: {'aspect': 'Maden', 'start': 0, 'end': 5, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.4489361047744751}
|
| 502 |
+
Processing entity: {'entity_group': 'ASP-Negative', 'score': np.float32(0.5446483), 'word': 'portion', 'start': 21, 'end': 29}, label: asp-negative
|
| 503 |
+
Added aspect: {'aspect': 'portion', 'start': 21, 'end': 29, 'extractor_label': 'ASP-Negative', 'extractor_score': 0.544648289680481}
|
| 504 |
+
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}]
|
| 505 |
+
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}]
|
| 506 |
+
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.5072303), 'word': 'Počítač', 'start': 0, 'end': 7}, label: asp-neutral
|
| 507 |
+
Added aspect: {'aspect': 'Počítač', 'start': 0, 'end': 7, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.507230281829834}
|
| 508 |
+
Processing entity: {'entity_group': 'ASP-Neutral', 'score': np.float32(0.5066106), 'word': 'software', 'start': 22, 'end': 31}, label: asp-neutral
|
| 509 |
+
Added aspect: {'aspect': 'software', 'start': 22, 'end': 31, 'extractor_label': 'ASP-Neutral', 'extractor_score': 0.5066105723381042}
|
| 510 |
+
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}]
|
| 511 |
+
|
| 512 |
+
Results:
|
| 513 |
+
[{'aspects': ['user interface', 'documentation'],
|
| 514 |
+
'confidence': [0.517541766166687, 0.5204463601112366],
|
| 515 |
+
'details': [{'aspect': 'user interface',
|
| 516 |
+
'confidence': 0.517541766166687,
|
| 517 |
+
'end': 18,
|
| 518 |
+
'extractor_label': 'ASP-Neutral',
|
| 519 |
+
'extractor_score': 0.517541766166687,
|
| 520 |
+
'probability': {'Negative': 0.2412291169166565,
|
| 521 |
+
'Neutral': 0.517541766166687,
|
| 522 |
+
'Positive': 0.2412291169166565},
|
| 523 |
+
'sentiment': 'Neutral',
|
| 524 |
+
'start': 3},
|
| 525 |
+
{'aspect': 'documentation',
|
| 526 |
+
'confidence': 0.5204463601112366,
|
| 527 |
+
'end': 54,
|
| 528 |
+
'extractor_label': 'ASP-Negative',
|
| 529 |
+
'extractor_score': 0.5204463601112366,
|
| 530 |
+
'probability': {'Negative': 0.5204463601112366,
|
| 531 |
+
'Neutral': 0.2397768199443817,
|
| 532 |
+
'Positive': 0.2397768199443817},
|
| 533 |
+
'sentiment': 'Negative',
|
| 534 |
+
'start': 40}],
|
| 535 |
+
'positions': [[3, 18], [40, 54]],
|
| 536 |
+
'sentiments': ['Neutral', 'Negative'],
|
| 537 |
+
'text': 'The user interface is brilliant, but the documentation is a total mess.'},
|
| 538 |
+
{'aspects': ['牛排', '服务'],
|
| 539 |
+
'confidence': [0.5346122980117798, 0.5622819066047668],
|
| 540 |
+
'details': [{'aspect': '牛排',
|
| 541 |
+
'confidence': 0.5346122980117798,
|
| 542 |
+
'end': 7,
|
| 543 |
+
'extractor_label': 'ASP-Positive',
|
| 544 |
+
'extractor_score': 0.5346122980117798,
|
| 545 |
+
'probability': {'Negative': 0.2326938509941101,
|
| 546 |
+
'Neutral': 0.2326938509941101,
|
| 547 |
+
'Positive': 0.5346122980117798},
|
| 548 |
+
'sentiment': 'Positive',
|
| 549 |
+
'start': 5},
|
| 550 |
+
{'aspect': '服务',
|
| 551 |
+
'confidence': 0.5622819066047668,
|
| 552 |
+
'end': 15,
|
| 553 |
+
'extractor_label': 'ASP-Negative',
|
| 554 |
+
'extractor_score': 0.5622819066047668,
|
| 555 |
+
'probability': {'Negative': 0.5622819066047668,
|
| 556 |
+
'Neutral': 0.21885904669761658,
|
| 557 |
+
'Positive': 0.21885904669761658},
|
| 558 |
+
'sentiment': 'Negative',
|
| 559 |
+
'start': 13}],
|
| 560 |
+
'positions': [[5, 7], [13, 15]],
|
| 561 |
+
'sentiments': ['Positive', 'Negative'],
|
| 562 |
+
'text': '这家餐厅的牛排很好吃,但是服务很慢。'},
|
| 563 |
+
{'aspects': ['batería', 'cámara'],
|
| 564 |
+
'confidence': [0.43364980816841125, 0.44364821910858154],
|
| 565 |
+
'details': [{'aspect': 'batería',
|
| 566 |
+
'confidence': 0.43364980816841125,
|
| 567 |
+
'end': 10,
|
| 568 |
+
'extractor_label': 'ASP-Neutral',
|
| 569 |
+
'extractor_score': 0.43364980816841125,
|
| 570 |
+
'probability': {'Negative': 0.2831750959157944,
|
| 571 |
+
'Neutral': 0.43364980816841125,
|
| 572 |
+
'Positive': 0.2831750959157944},
|
| 573 |
+
'sentiment': 'Neutral',
|
| 574 |
+
'start': 2},
|
| 575 |
+
{'aspect': 'cámara',
|
| 576 |
+
'confidence': 0.44364821910858154,
|
| 577 |
+
'end': 40,
|
| 578 |
+
'extractor_label': 'ASP-Neutral',
|
| 579 |
+
'extractor_score': 0.44364821910858154,
|
| 580 |
+
'probability': {'Negative': 0.27817589044570923,
|
| 581 |
+
'Neutral': 0.44364821910858154,
|
| 582 |
+
'Positive': 0.27817589044570923},
|
| 583 |
+
'sentiment': 'Neutral',
|
| 584 |
+
'start': 33}],
|
| 585 |
+
'positions': [[2, 10], [33, 40]],
|
| 586 |
+
'sentiments': ['Neutral', 'Neutral'],
|
| 587 |
+
'text': 'La batería es malísima, aunque la cámara está muy bien.'},
|
| 588 |
+
{'aspects': ['film', 'fin'],
|
| 589 |
+
'confidence': [0.6539797782897949, 0.41829001903533936],
|
| 590 |
+
'details': [{'aspect': 'film',
|
| 591 |
+
'confidence': 0.6539797782897949,
|
| 592 |
+
'end': 7,
|
| 593 |
+
'extractor_label': 'ASP-Positive',
|
| 594 |
+
'extractor_score': 0.6539797782897949,
|
| 595 |
+
'probability': {'Negative': 0.17301011085510254,
|
| 596 |
+
'Neutral': 0.17301011085510254,
|
| 597 |
+
'Positive': 0.6539797782897949},
|
| 598 |
+
'sentiment': 'Positive',
|
| 599 |
+
'start': 2},
|
| 600 |
+
{'aspect': 'fin',
|
| 601 |
+
'confidence': 0.41829001903533936,
|
| 602 |
+
'end': 36,
|
| 603 |
+
'extractor_label': 'ASP-Negative',
|
| 604 |
+
'extractor_score': 0.41829001903533936,
|
| 605 |
+
'probability': {'Negative': 0.41829001903533936,
|
| 606 |
+
'Neutral': 0.2908549904823303,
|
| 607 |
+
'Positive': 0.2908549904823303},
|
| 608 |
+
'sentiment': 'Negative',
|
| 609 |
+
'start': 32}],
|
| 610 |
+
'positions': [[2, 7], [32, 36]],
|
| 611 |
+
'sentiments': ['Positive', 'Negative'],
|
| 612 |
+
'text': 'Le film était captivant, mais la fin était décevante.'},
|
| 613 |
+
{'aspects': ['Auto', 'Sitze'],
|
| 614 |
+
'confidence': [0.5750167965888977, 0.4986541271209717],
|
| 615 |
+
'details': [{'aspect': 'Auto',
|
| 616 |
+
'confidence': 0.5750167965888977,
|
| 617 |
+
'end': 8,
|
| 618 |
+
'extractor_label': 'ASP-Neutral',
|
| 619 |
+
'extractor_score': 0.5750167965888977,
|
| 620 |
+
'probability': {'Negative': 0.21249160170555115,
|
| 621 |
+
'Neutral': 0.5750167965888977,
|
| 622 |
+
'Positive': 0.21249160170555115},
|
| 623 |
+
'sentiment': 'Neutral',
|
| 624 |
+
'start': 3},
|
| 625 |
+
{'aspect': 'Sitze',
|
| 626 |
+
'confidence': 0.4986541271209717,
|
| 627 |
+
'end': 41,
|
| 628 |
+
'extractor_label': 'ASP-Neutral',
|
| 629 |
+
'extractor_score': 0.4986541271209717,
|
| 630 |
+
'probability': {'Negative': 0.25067293643951416,
|
| 631 |
+
'Neutral': 0.4986541271209717,
|
| 632 |
+
'Positive': 0.25067293643951416},
|
| 633 |
+
'sentiment': 'Neutral',
|
| 634 |
+
'start': 35}],
|
| 635 |
+
'positions': [[3, 8], [35, 41]],
|
| 636 |
+
'sentiments': ['Neutral', 'Neutral'],
|
| 637 |
+
'text': 'Das Auto ist sehr sparsam, aber die Sitze sind unbequem.'},
|
| 638 |
+
{'aspects': ['design', 'software'],
|
| 639 |
+
'confidence': [0.6298937201499939, 0.6058070063591003],
|
| 640 |
+
'details': [{'aspect': 'design',
|
| 641 |
+
'confidence': 0.6298937201499939,
|
| 642 |
+
'end': 9,
|
| 643 |
+
'extractor_label': 'ASP-Neutral',
|
| 644 |
+
'extractor_score': 0.6298937201499939,
|
| 645 |
+
'probability': {'Negative': 0.18505313992500305,
|
| 646 |
+
'Neutral': 0.6298937201499939,
|
| 647 |
+
'Positive': 0.18505313992500305},
|
| 648 |
+
'sentiment': 'Neutral',
|
| 649 |
+
'start': 2},
|
| 650 |
+
{'aspect': 'software',
|
| 651 |
+
'confidence': 0.6058070063591003,
|
| 652 |
+
'end': 38,
|
| 653 |
+
'extractor_label': 'ASP-Neutral',
|
| 654 |
+
'extractor_score': 0.6058070063591003,
|
| 655 |
+
'probability': {'Negative': 0.19709649682044983,
|
| 656 |
+
'Neutral': 0.6058070063591003,
|
| 657 |
+
'Positive': 0.19709649682044983},
|
| 658 |
+
'sentiment': 'Neutral',
|
| 659 |
+
'start': 29}],
|
| 660 |
+
'positions': [[2, 9], [29, 38]],
|
| 661 |
+
'sentiments': ['Neutral', 'Neutral'],
|
| 662 |
+
'text': 'Il design è elegante, però il software è pieno di bug.'},
|
| 663 |
+
{'aspects': ['café'],
|
| 664 |
+
'confidence': [0.56500643491745],
|
| 665 |
+
'details': [{'aspect': 'café',
|
| 666 |
+
'confidence': 0.56500643491745,
|
| 667 |
+
'end': 42,
|
| 668 |
+
'extractor_label': 'ASP-Negative',
|
| 669 |
+
'extractor_score': 0.56500643491745,
|
| 670 |
+
'probability': {'Negative': 0.56500643491745,
|
| 671 |
+
'Neutral': 0.21749678254127502,
|
| 672 |
+
'Positive': 0.21749678254127502},
|
| 673 |
+
'sentiment': 'Negative',
|
| 674 |
+
'start': 37}],
|
| 675 |
+
'positions': [[37, 42]],
|
| 676 |
+
'sentiments': ['Negative'],
|
| 677 |
+
'text': 'O hotel tem uma vista incrível, mas o café da manhã é fraco.'},
|
| 678 |
+
{'aspects': ['Кни', 'пере'],
|
| 679 |
+
'confidence': [0.42165103554725647, 0.5683889389038086],
|
| 680 |
+
'details': [{'aspect': 'Кни',
|
| 681 |
+
'confidence': 0.42165103554725647,
|
| 682 |
+
'end': 3,
|
| 683 |
+
'extractor_label': 'ASP-Neutral',
|
| 684 |
+
'extractor_score': 0.42165103554725647,
|
| 685 |
+
'probability': {'Negative': 0.28917448222637177,
|
| 686 |
+
'Neutral': 0.42165103554725647,
|
| 687 |
+
'Positive': 0.28917448222637177},
|
| 688 |
+
'sentiment': 'Neutral',
|
| 689 |
+
'start': 0},
|
| 690 |
+
{'aspect': 'пере',
|
| 691 |
+
'confidence': 0.5683889389038086,
|
| 692 |
+
'end': 31,
|
| 693 |
+
'extractor_label': 'ASP-Neutral',
|
| 694 |
+
'extractor_score': 0.5683889389038086,
|
| 695 |
+
'probability': {'Negative': 0.2158055305480957,
|
| 696 |
+
'Neutral': 0.5683889389038086,
|
| 697 |
+
'Positive': 0.2158055305480957},
|
| 698 |
+
'sentiment': 'Neutral',
|
| 699 |
+
'start': 26}],
|
| 700 |
+
'positions': [[0, 3], [26, 31]],
|
| 701 |
+
'sentiments': ['Neutral', 'Neutral'],
|
| 702 |
+
'text': 'Книга очень интересная, но перевод оставляет желать лучшего.'},
|
| 703 |
+
{'aspects': ['バッテリー'],
|
| 704 |
+
'confidence': [0.5808011293411255],
|
| 705 |
+
'details': [{'aspect': 'バッテリー',
|
| 706 |
+
'confidence': 0.5808011293411255,
|
| 707 |
+
'end': 17,
|
| 708 |
+
'extractor_label': 'ASP-Negative',
|
| 709 |
+
'extractor_score': 0.5808011293411255,
|
| 710 |
+
'probability': {'Negative': 0.5808011293411255,
|
| 711 |
+
'Neutral': 0.20959943532943726,
|
| 712 |
+
'Positive': 0.20959943532943726},
|
| 713 |
+
'sentiment': 'Negative',
|
| 714 |
+
'start': 12}],
|
| 715 |
+
'positions': [[12, 17]],
|
| 716 |
+
'sentiments': ['Negative'],
|
| 717 |
+
'text': 'このアプリは便利だけど、バッテリーの消費が激しい。'},
|
| 718 |
+
{'aspects': ['음식', '가격'],
|
| 719 |
+
'confidence': [0.5432428121566772, 0.46728911995887756],
|
| 720 |
+
'details': [{'aspect': '음식',
|
| 721 |
+
'confidence': 0.5432428121566772,
|
| 722 |
+
'end': 2,
|
| 723 |
+
'extractor_label': 'ASP-Neutral',
|
| 724 |
+
'extractor_score': 0.5432428121566772,
|
| 725 |
+
'probability': {'Negative': 0.22837859392166138,
|
| 726 |
+
'Neutral': 0.5432428121566772,
|
| 727 |
+
'Positive': 0.22837859392166138},
|
| 728 |
+
'sentiment': 'Neutral',
|
| 729 |
+
'start': 0},
|
| 730 |
+
{'aspect': '가격',
|
| 731 |
+
'confidence': 0.46728911995887756,
|
| 732 |
+
'end': 13,
|
| 733 |
+
'extractor_label': 'ASP-Neutral',
|
| 734 |
+
'extractor_score': 0.46728911995887756,
|
| 735 |
+
'probability': {'Negative': 0.2663554400205612,
|
| 736 |
+
'Neutral': 0.46728911995887756,
|
| 737 |
+
'Positive': 0.2663554400205612},
|
| 738 |
+
'sentiment': 'Neutral',
|
| 739 |
+
'start': 10}],
|
| 740 |
+
'positions': [[0, 2], [10, 13]],
|
| 741 |
+
'sentiments': ['Neutral', 'Neutral'],
|
| 742 |
+
'text': '음식은 맛있었지만, 가격이 너무 비쌌어요.'},
|
| 743 |
+
{'aspects': ['الخ', 'دمة', 'الموق', 'ع'],
|
| 744 |
+
'confidence': [0.5339547991752625, 0.5055423378944397, 0.44124436378479004, 0.4563024640083313],
|
| 745 |
+
'details': [{'aspect': 'الخ',
|
| 746 |
+
'confidence': 0.5339547991752625,
|
| 747 |
+
'end': 3,
|
| 748 |
+
'extractor_label': 'ASP-Neutral',
|
| 749 |
+
'extractor_score': 0.5339547991752625,
|
| 750 |
+
'probability': {'Negative': 0.23302260041236877,
|
| 751 |
+
'Neutral': 0.5339547991752625,
|
| 752 |
+
'Positive': 0.23302260041236877},
|
| 753 |
+
'sentiment': 'Neutral',
|
| 754 |
+
'start': 0},
|
| 755 |
+
{'aspect': 'دمة',
|
| 756 |
+
'confidence': 0.5055423378944397,
|
| 757 |
+
'end': 6,
|
| 758 |
+
'extractor_label': 'ASP-Positive',
|
| 759 |
+
'extractor_score': 0.5055423378944397,
|
| 760 |
+
'probability': {'Negative': 0.24722883105278015,
|
| 761 |
+
'Neutral': 0.24722883105278015,
|
| 762 |
+
'Positive': 0.5055423378944397},
|
| 763 |
+
'sentiment': 'Positive',
|
| 764 |
+
'start': 3},
|
| 765 |
+
{'aspect': 'الموق',
|
| 766 |
+
'confidence': 0.44124436378479004,
|
| 767 |
+
'end': 24,
|
| 768 |
+
'extractor_label': 'ASP-Neutral',
|
| 769 |
+
'extractor_score': 0.44124436378479004,
|
| 770 |
+
'probability': {'Negative': 0.279377818107605,
|
| 771 |
+
'Neutral': 0.44124436378479004,
|
| 772 |
+
'Positive': 0.279377818107605},
|
| 773 |
+
'sentiment': 'Neutral',
|
| 774 |
+
'start': 18},
|
| 775 |
+
{'aspect': 'ع',
|
| 776 |
+
'confidence': 0.4563024640083313,
|
| 777 |
+
'end': 25,
|
| 778 |
+
'extractor_label': 'ASP-Negative',
|
| 779 |
+
'extractor_score': 0.4563024640083313,
|
| 780 |
+
'probability': {'Negative': 0.4563024640083313,
|
| 781 |
+
'Neutral': 0.27184876799583435,
|
| 782 |
+
'Positive': 0.27184876799583435},
|
| 783 |
+
'sentiment': 'Negative',
|
| 784 |
+
'start': 24}],
|
| 785 |
+
'positions': [[0, 3], [3, 6], [18, 24], [24, 25]],
|
| 786 |
+
'sentiments': ['Neutral', 'Positive', 'Neutral', 'Negative'],
|
| 787 |
+
'text': 'الخدمة ممتازة، لكن الموقع صعب الوصول إليه.'},
|
| 788 |
+
{'aspects': ['कैमरा', 'बैट', 'री', 'लाइफ'],
|
| 789 |
+
'confidence': [0.45512592792510986, 0.47939613461494446, 0.435901015996933, 0.46086522936820984],
|
| 790 |
+
'details': [{'aspect': 'कैमरा',
|
| 791 |
+
'confidence': 0.45512592792510986,
|
| 792 |
+
'end': 13,
|
| 793 |
+
'extractor_label': 'ASP-Neutral',
|
| 794 |
+
'extractor_score': 0.45512592792510986,
|
| 795 |
+
'probability': {'Negative': 0.27243703603744507,
|
| 796 |
+
'Neutral': 0.45512592792510986,
|
| 797 |
+
'Positive': 0.27243703603744507},
|
| 798 |
+
'sentiment': 'Neutral',
|
| 799 |
+
'start': 7},
|
| 800 |
+
{'aspect': 'बैट',
|
| 801 |
+
'confidence': 0.47939613461494446,
|
| 802 |
+
'end': 34,
|
| 803 |
+
'extractor_label': 'ASP-Neutral',
|
| 804 |
+
'extractor_score': 0.47939613461494446,
|
| 805 |
+
'probability': {'Negative': 0.26030193269252777,
|
| 806 |
+
'Neutral': 0.47939613461494446,
|
| 807 |
+
'Positive': 0.26030193269252777},
|
| 808 |
+
'sentiment': 'Neutral',
|
| 809 |
+
'start': 30},
|
| 810 |
+
{'aspect': 'री',
|
| 811 |
+
'confidence': 0.435901015996933,
|
| 812 |
+
'end': 36,
|
| 813 |
+
'extractor_label': 'ASP-Negative',
|
| 814 |
+
'extractor_score': 0.435901015996933,
|
| 815 |
+
'probability': {'Negative': 0.435901015996933,
|
| 816 |
+
'Neutral': 0.2820494920015335,
|
| 817 |
+
'Positive': 0.2820494920015335},
|
| 818 |
+
'sentiment': 'Negative',
|
| 819 |
+
'start': 34},
|
| 820 |
+
{'aspect': 'लाइफ',
|
| 821 |
+
'confidence': 0.46086522936820984,
|
| 822 |
+
'end': 41,
|
| 823 |
+
'extractor_label': 'ASP-Neutral',
|
| 824 |
+
'extractor_score': 0.46086522936820984,
|
| 825 |
+
'probability': {'Negative': 0.2695673853158951,
|
| 826 |
+
'Neutral': 0.46086522936820984,
|
| 827 |
+
'Positive': 0.2695673853158951},
|
| 828 |
+
'sentiment': 'Neutral',
|
| 829 |
+
'start': 36}],
|
| 830 |
+
'positions': [[7, 13], [30, 34], [34, 36], [36, 41]],
|
| 831 |
+
'sentiments': ['Neutral', 'Neutral', 'Negative', 'Neutral'],
|
| 832 |
+
'text': 'फ़ोन का कैमरा शानदार है, लेकिन बैटरी लाइफ खराब है।'},
|
| 833 |
+
{'aspects': ['locatie', 'personeel'],
|
| 834 |
+
'confidence': [0.4961163103580475, 0.4840226173400879],
|
| 835 |
+
'details': [{'aspect': 'locatie',
|
| 836 |
+
'confidence': 0.4961163103580475,
|
| 837 |
+
'end': 10,
|
| 838 |
+
'extractor_label': 'ASP-Positive',
|
| 839 |
+
'extractor_score': 0.4961163103580475,
|
| 840 |
+
'probability': {'Negative': 0.25194184482097626,
|
| 841 |
+
'Neutral': 0.25194184482097626,
|
| 842 |
+
'Positive': 0.4961163103580475},
|
| 843 |
+
'sentiment': 'Positive',
|
| 844 |
+
'start': 2},
|
| 845 |
+
{'aspect': 'personeel',
|
| 846 |
+
'confidence': 0.4840226173400879,
|
| 847 |
+
'end': 46,
|
| 848 |
+
'extractor_label': 'ASP-Negative',
|
| 849 |
+
'extractor_score': 0.4840226173400879,
|
| 850 |
+
'probability': {'Negative': 0.4840226173400879,
|
| 851 |
+
'Neutral': 0.25798869132995605,
|
| 852 |
+
'Positive': 0.25798869132995605},
|
| 853 |
+
'sentiment': 'Negative',
|
| 854 |
+
'start': 36}],
|
| 855 |
+
'positions': [[2, 10], [36, 46]],
|
| 856 |
+
'sentiments': ['Positive', 'Negative'],
|
| 857 |
+
'text': 'De locatie is perfect, alleen is het personeel onvriendelijk.'},
|
| 858 |
+
{'aspects': ['Bok', 'handling'],
|
| 859 |
+
'confidence': [0.46991148591041565, 0.4475855529308319],
|
| 860 |
+
'details': [{'aspect': 'Bok',
|
| 861 |
+
'confidence': 0.46991148591041565,
|
| 862 |
+
'end': 3,
|
| 863 |
+
'extractor_label': 'ASP-Neutral',
|
| 864 |
+
'extractor_score': 0.46991148591041565,
|
| 865 |
+
'probability': {'Negative': 0.2650442570447922,
|
| 866 |
+
'Neutral': 0.46991148591041565,
|
| 867 |
+
'Positive': 0.2650442570447922},
|
| 868 |
+
'sentiment': 'Neutral',
|
| 869 |
+
'start': 0},
|
| 870 |
+
{'aspect': 'handling',
|
| 871 |
+
'confidence': 0.4475855529308319,
|
| 872 |
+
'end': 33,
|
| 873 |
+
'extractor_label': 'ASP-Negative',
|
| 874 |
+
'extractor_score': 0.4475855529308319,
|
| 875 |
+
'probability': {'Negative': 0.4475855529308319,
|
| 876 |
+
'Neutral': 0.27620722353458405,
|
| 877 |
+
'Positive': 0.27620722353458405},
|
| 878 |
+
'sentiment': 'Negative',
|
| 879 |
+
'start': 24}],
|
| 880 |
+
'positions': [[0, 3], [24, 33]],
|
| 881 |
+
'sentiments': ['Neutral', 'Negative'],
|
| 882 |
+
'text': 'Boken är välskriven, men handlingen är förutsägbar.'},
|
| 883 |
+
{'aspects': ['Grafika', 'g', 'fabuła'],
|
| 884 |
+
'confidence': [0.5523369312286377, 0.38001376390457153, 0.5456185936927795],
|
| 885 |
+
'details': [{'aspect': 'Grafika',
|
| 886 |
+
'confidence': 0.5523369312286377,
|
| 887 |
+
'end': 7,
|
| 888 |
+
'extractor_label': 'ASP-Neutral',
|
| 889 |
+
'extractor_score': 0.5523369312286377,
|
| 890 |
+
'probability': {'Negative': 0.22383153438568115,
|
| 891 |
+
'Neutral': 0.5523369312286377,
|
| 892 |
+
'Positive': 0.22383153438568115},
|
| 893 |
+
'sentiment': 'Neutral',
|
| 894 |
+
'start': 0},
|
| 895 |
+
{'aspect': 'g',
|
| 896 |
+
'confidence': 0.38001376390457153,
|
| 897 |
+
'end': 11,
|
| 898 |
+
'extractor_label': 'ASP-Neutral',
|
| 899 |
+
'extractor_score': 0.38001376390457153,
|
| 900 |
+
'probability': {'Negative': 0.30999311804771423,
|
| 901 |
+
'Neutral': 0.38001376390457153,
|
| 902 |
+
'Positive': 0.30999311804771423},
|
| 903 |
+
'sentiment': 'Neutral',
|
| 904 |
+
'start': 9},
|
| 905 |
+
{'aspect': 'fabuła',
|
| 906 |
+
'confidence': 0.5456185936927795,
|
| 907 |
+
'end': 43,
|
| 908 |
+
'extractor_label': 'ASP-Neutral',
|
| 909 |
+
'extractor_score': 0.5456185936927795,
|
| 910 |
+
'probability': {'Negative': 0.22719070315361023,
|
| 911 |
+
'Neutral': 0.5456185936927795,
|
| 912 |
+
'Positive': 0.22719070315361023},
|
| 913 |
+
'sentiment': 'Neutral',
|
| 914 |
+
'start': 36}],
|
| 915 |
+
'positions': [[0, 7], [9, 11], [36, 43]],
|
| 916 |
+
'sentiments': ['Neutral', 'Neutral', 'Neutral'],
|
| 917 |
+
'text': 'Grafika w grze jest niesamowita, ale fabuła jest nudna.'},
|
| 918 |
+
{'aspects': ['kargo'],
|
| 919 |
+
'confidence': [0.6405377388000488],
|
| 920 |
+
'details': [{'aspect': 'kargo',
|
| 921 |
+
'confidence': 0.6405377388000488,
|
| 922 |
+
'end': 33,
|
| 923 |
+
'extractor_label': 'ASP-Negative',
|
| 924 |
+
'extractor_score': 0.6405377388000488,
|
| 925 |
+
'probability': {'Negative': 0.6405377388000488,
|
| 926 |
+
'Neutral': 0.17973113059997559,
|
| 927 |
+
'Positive': 0.17973113059997559},
|
| 928 |
+
'sentiment': 'Negative',
|
| 929 |
+
'start': 27}],
|
| 930 |
+
'positions': [[27, 33]],
|
| 931 |
+
'sentiments': ['Negative'],
|
| 932 |
+
'text': 'Ürün kaliteli görünüyor ama kargo çok geç geldi.'},
|
| 933 |
+
{'aspects': ['Ch', 'lượng âm thanh'],
|
| 934 |
+
'confidence': [0.6112579107284546, 0.6159068942070007],
|
| 935 |
+
'details': [{'aspect': 'Ch',
|
| 936 |
+
'confidence': 0.6112579107284546,
|
| 937 |
+
'end': 2,
|
| 938 |
+
'extractor_label': 'ASP-Positive',
|
| 939 |
+
'extractor_score': 0.6112579107284546,
|
| 940 |
+
'probability': {'Negative': 0.1943710446357727,
|
| 941 |
+
'Neutral': 0.1943710446357727,
|
| 942 |
+
'Positive': 0.6112579107284546},
|
| 943 |
+
'sentiment': 'Positive',
|
| 944 |
+
'start': 0},
|
| 945 |
+
{'aspect': 'lượng âm thanh',
|
| 946 |
+
'confidence': 0.6159068942070007,
|
| 947 |
+
'end': 19,
|
| 948 |
+
'extractor_label': 'ASP-Positive',
|
| 949 |
+
'extractor_score': 0.6159068942070007,
|
| 950 |
+
'probability': {'Negative': 0.19204655289649963,
|
| 951 |
+
'Neutral': 0.19204655289649963,
|
| 952 |
+
'Positive': 0.6159068942070007},
|
| 953 |
+
'sentiment': 'Positive',
|
| 954 |
+
'start': 4}],
|
| 955 |
+
'positions': [[0, 2], [4, 19]],
|
| 956 |
+
'sentiments': ['Positive', 'Positive'],
|
| 957 |
+
'text': 'Chất lượng âm thanh tốt, tuy nhiên tai nghe không thoải mái lắm.'},
|
| 958 |
+
{'aspects': [],
|
| 959 |
+
'confidence': [],
|
| 960 |
+
'details': [],
|
| 961 |
+
'positions': [],
|
| 962 |
+
'sentiments': [],
|
| 963 |
+
'text': 'การแสดงดีมาก แต่บทภาพยนตร์ค่อนข้างอ่อน'},
|
| 964 |
+
{'aspects': ['τοποθεσία', 'δω', 'μάτιο'],
|
| 965 |
+
'confidence': [0.6473245620727539, 0.49225592613220215, 0.4857552945613861],
|
| 966 |
+
'details': [{'aspect': 'τοποθεσία',
|
| 967 |
+
'confidence': 0.6473245620727539,
|
| 968 |
+
'end': 11,
|
| 969 |
+
'extractor_label': 'ASP-Neutral',
|
| 970 |
+
'extractor_score': 0.6473245620727539,
|
| 971 |
+
'probability': {'Negative': 0.17633771896362305,
|
| 972 |
+
'Neutral': 0.6473245620727539,
|
| 973 |
+
'Positive': 0.17633771896362305},
|
| 974 |
+
'sentiment': 'Neutral',
|
| 975 |
+
'start': 1},
|
| 976 |
+
{'aspect': 'δω',
|
| 977 |
+
'confidence': 0.49225592613220215,
|
| 978 |
+
'end': 40,
|
| 979 |
+
'extractor_label': 'ASP-Negative',
|
| 980 |
+
'extractor_score': 0.49225592613220215,
|
| 981 |
+
'probability': {'Negative': 0.49225592613220215,
|
| 982 |
+
'Neutral': 0.2538720369338989,
|
| 983 |
+
'Positive': 0.2538720369338989},
|
| 984 |
+
'sentiment': 'Negative',
|
| 985 |
+
'start': 37},
|
| 986 |
+
{'aspect': 'μάτιο',
|
| 987 |
+
'confidence': 0.4857552945613861,
|
| 988 |
+
'end': 45,
|
| 989 |
+
'extractor_label': 'ASP-Neutral',
|
| 990 |
+
'extractor_score': 0.4857552945613861,
|
| 991 |
+
'probability': {'Negative': 0.25712235271930695,
|
| 992 |
+
'Neutral': 0.4857552945613861,
|
| 993 |
+
'Positive': 0.25712235271930695},
|
| 994 |
+
'sentiment': 'Neutral',
|
| 995 |
+
'start': 40}],
|
| 996 |
+
'positions': [[1, 11], [37, 40], [40, 45]],
|
| 997 |
+
'sentiments': ['Neutral', 'Negative', 'Neutral'],
|
| 998 |
+
'text': 'Η τοποθεσία είναι φανταστική, αλλά το δωμάτιο ήταν πολύ μικρό.'},
|
| 999 |
+
{'aspects': ['ה', 'משחק'],
|
| 1000 |
+
'confidence': [0.4173576831817627, 0.39395496249198914],
|
| 1001 |
+
'details': [{'aspect': 'ה',
|
| 1002 |
+
'confidence': 0.4173576831817627,
|
| 1003 |
+
'end': 1,
|
| 1004 |
+
'extractor_label': 'ASP-Positive',
|
| 1005 |
+
'extractor_score': 0.4173576831817627,
|
| 1006 |
+
'probability': {'Negative': 0.29132115840911865,
|
| 1007 |
+
'Neutral': 0.29132115840911865,
|
| 1008 |
+
'Positive': 0.4173576831817627},
|
| 1009 |
+
'sentiment': 'Positive',
|
| 1010 |
+
'start': 0},
|
| 1011 |
+
{'aspect': 'משחק',
|
| 1012 |
+
'confidence': 0.39395496249198914,
|
| 1013 |
+
'end': 5,
|
| 1014 |
+
'extractor_label': 'ASP-Positive',
|
| 1015 |
+
'extractor_score': 0.39395496249198914,
|
| 1016 |
+
'probability': {'Negative': 0.30302251875400543,
|
| 1017 |
+
'Neutral': 0.30302251875400543,
|
| 1018 |
+
'Positive': 0.39395496249198914},
|
| 1019 |
+
'sentiment': 'Positive',
|
| 1020 |
+
'start': 1}],
|
| 1021 |
+
'positions': [[0, 1], [1, 5]],
|
| 1022 |
+
'sentiments': ['Positive', 'Positive'],
|
| 1023 |
+
'text': 'המשחק מהנה, אבל יש בו יותר מדי פרסומות.'},
|
| 1024 |
+
{'aspects': ['Pons', 'el', 'tetapi'],
|
| 1025 |
+
'confidence': [0.59271240234375, 0.2814190089702606, 0.562650740146637],
|
| 1026 |
+
'details': [{'aspect': 'Pons',
|
| 1027 |
+
'confidence': 0.59271240234375,
|
| 1028 |
+
'end': 4,
|
| 1029 |
+
'extractor_label': 'ASP-Neutral',
|
| 1030 |
+
'extractor_score': 0.59271240234375,
|
| 1031 |
+
'probability': {'Negative': 0.203643798828125,
|
| 1032 |
+
'Neutral': 0.59271240234375,
|
| 1033 |
+
'Positive': 0.203643798828125},
|
| 1034 |
+
'sentiment': 'Neutral',
|
| 1035 |
+
'start': 0},
|
| 1036 |
+
{'aspect': 'el',
|
| 1037 |
+
'confidence': 0.2814190089702606,
|
| 1038 |
+
'end': 6,
|
| 1039 |
+
'extractor_label': 'ASP-Neutral',
|
| 1040 |
+
'extractor_score': 0.2814190089702606,
|
| 1041 |
+
'probability': {'Negative': 0.3592904955148697,
|
| 1042 |
+
'Neutral': 0.2814190089702606,
|
| 1043 |
+
'Positive': 0.3592904955148697},
|
| 1044 |
+
'sentiment': 'Neutral',
|
| 1045 |
+
'start': 4},
|
| 1046 |
+
{'aspect': 'tetapi',
|
| 1047 |
+
'confidence': 0.562650740146637,
|
| 1048 |
+
'end': 24,
|
| 1049 |
+
'extractor_label': 'ASP-Neutral',
|
| 1050 |
+
'extractor_score': 0.562650740146637,
|
| 1051 |
+
'probability': {'Negative': 0.21867462992668152,
|
| 1052 |
+
'Neutral': 0.562650740146637,
|
| 1053 |
+
'Positive': 0.21867462992668152},
|
| 1054 |
+
'sentiment': 'Neutral',
|
| 1055 |
+
'start': 17}],
|
| 1056 |
+
'positions': [[0, 4], [4, 6], [17, 24]],
|
| 1057 |
+
'sentiments': ['Neutral', 'Neutral', 'Neutral'],
|
| 1058 |
+
'text': 'Ponsel ini cepat, tetapi cenderung cepat panas.'},
|
| 1059 |
+
{'aspects': ['Ohjelma', 'käyttöliittymä'],
|
| 1060 |
+
'confidence': [0.5031888484954834, 0.48775985836982727],
|
| 1061 |
+
'details': [{'aspect': 'Ohjelma',
|
| 1062 |
+
'confidence': 0.5031888484954834,
|
| 1063 |
+
'end': 7,
|
| 1064 |
+
'extractor_label': 'ASP-Neutral',
|
| 1065 |
+
'extractor_score': 0.5031888484954834,
|
| 1066 |
+
'probability': {'Negative': 0.2484055757522583,
|
| 1067 |
+
'Neutral': 0.5031888484954834,
|
| 1068 |
+
'Positive': 0.2484055757522583},
|
| 1069 |
+
'sentiment': 'Neutral',
|
| 1070 |
+
'start': 0},
|
| 1071 |
+
{'aspect': 'käyttöliittymä',
|
| 1072 |
+
'confidence': 0.48775985836982727,
|
| 1073 |
+
'end': 40,
|
| 1074 |
+
'extractor_label': 'ASP-Neutral',
|
| 1075 |
+
'extractor_score': 0.48775985836982727,
|
| 1076 |
+
'probability': {'Negative': 0.25612007081508636,
|
| 1077 |
+
'Neutral': 0.48775985836982727,
|
| 1078 |
+
'Positive': 0.25612007081508636},
|
| 1079 |
+
'sentiment': 'Neutral',
|
| 1080 |
+
'start': 25}],
|
| 1081 |
+
'positions': [[0, 7], [25, 40]],
|
| 1082 |
+
'sentiments': ['Neutral', 'Neutral'],
|
| 1083 |
+
'text': 'Ohjelma on tehokas, mutta käyttöliittymä on sekava.'},
|
| 1084 |
+
{'aspects': ['Maden', 'portion'],
|
| 1085 |
+
'confidence': [0.4489361047744751, 0.544648289680481],
|
| 1086 |
+
'details': [{'aspect': 'Maden',
|
| 1087 |
+
'confidence': 0.4489361047744751,
|
| 1088 |
+
'end': 5,
|
| 1089 |
+
'extractor_label': 'ASP-Neutral',
|
| 1090 |
+
'extractor_score': 0.4489361047744751,
|
| 1091 |
+
'probability': {'Negative': 0.27553194761276245,
|
| 1092 |
+
'Neutral': 0.4489361047744751,
|
| 1093 |
+
'Positive': 0.27553194761276245},
|
| 1094 |
+
'sentiment': 'Neutral',
|
| 1095 |
+
'start': 0},
|
| 1096 |
+
{'aspect': 'portion',
|
| 1097 |
+
'confidence': 0.544648289680481,
|
| 1098 |
+
'end': 29,
|
| 1099 |
+
'extractor_label': 'ASP-Negative',
|
| 1100 |
+
'extractor_score': 0.544648289680481,
|
| 1101 |
+
'probability': {'Negative': 0.544648289680481,
|
| 1102 |
+
'Neutral': 0.22767585515975952,
|
| 1103 |
+
'Positive': 0.22767585515975952},
|
| 1104 |
+
'sentiment': 'Negative',
|
| 1105 |
+
'start': 21}],
|
| 1106 |
+
'positions': [[0, 5], [21, 29]],
|
| 1107 |
+
'sentiments': ['Neutral', 'Negative'],
|
| 1108 |
+
'text': 'Maden var lækker, men portionerne var for små.'},
|
| 1109 |
+
{'aspects': ['Počítač', 'software'],
|
| 1110 |
+
'confidence': [0.507230281829834, 0.5066105723381042],
|
| 1111 |
+
'details': [{'aspect': 'Počítač',
|
| 1112 |
+
'confidence': 0.507230281829834,
|
| 1113 |
+
'end': 7,
|
| 1114 |
+
'extractor_label': 'ASP-Neutral',
|
| 1115 |
+
'extractor_score': 0.507230281829834,
|
| 1116 |
+
'probability': {'Negative': 0.246384859085083,
|
| 1117 |
+
'Neutral': 0.507230281829834,
|
| 1118 |
+
'Positive': 0.246384859085083},
|
| 1119 |
+
'sentiment': 'Neutral',
|
| 1120 |
+
'start': 0},
|
| 1121 |
+
{'aspect': 'software',
|
| 1122 |
+
'confidence': 0.5066105723381042,
|
| 1123 |
+
'end': 31,
|
| 1124 |
+
'extractor_label': 'ASP-Neutral',
|
| 1125 |
+
'extractor_score': 0.5066105723381042,
|
| 1126 |
+
'probability': {'Negative': 0.24669471383094788,
|
| 1127 |
+
'Neutral': 0.5066105723381042,
|
| 1128 |
+
'Positive': 0.24669471383094788},
|
| 1129 |
+
'sentiment': 'Neutral',
|
| 1130 |
+
'start': 22}],
|
| 1131 |
+
'positions': [[0, 7], [22, 31]],
|
| 1132 |
+
'sentiments': ['Neutral', 'Neutral'],
|
| 1133 |
+
'text': 'Počítač je rychlý, ale software je zastaralý.'}]
|
| 1134 |
+
"""
|