Views
No views yet
1from transformers import pipeline
2import torch
3
4# Load the model
5classifier = pipeline("text-classification",
6 model="FutureMa/game-issue-review-detection",
7 device=0 if torch.cuda.is_available() else -1)
8
9# Define review examples
10reviews = [
11 "Great game ruined by the worst final boss in history. Such a slog that has to be cheesed to win.",
12 "Great game, epic story, best gameplay and banger music. Overall very good jrpg games for me also i hope gallica is real"
13]
14
15# Label explanations
16LABEL_MAP = {
17 "LABEL_0": "Non Game Issue Review",
18 "LABEL_1": "Game Issue Review"
19}
20
21# Classify and display results
22print("🔍 Game Issue Review Analysis Results:\n")
23print("-" * 80)
24for i, review in enumerate(reviews, 1):
25 pred = classifier(review)
26 label_explanation = LABEL_MAP[pred[0]['label']]
27 print(f"Review {i}:")
28 print(f"Text: {review}")
29 print(f"Classification: {label_explanation}")
30 print(f"Confidence: {pred[0]['score']:.4f}")
31 print("-" * 80)