byunal commited on
Commit
6a3f605
·
verified ·
1 Parent(s): 426c450

Update README.md

Browse files

README.md was updated.

Files changed (1) hide show
  1. README.md +83 -3
README.md CHANGED
@@ -1,3 +1,83 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - tr
5
+ metrics:
6
+ - name: accuracy
7
+ value: 0.77
8
+ - name: f1
9
+ value: 0.76
10
+ base_model:
11
+ - loodos/albert-base-turkish-uncased
12
+ pipeline_tag: text-classification
13
+ ---
14
+ # byunal/albert-base-turkish-cased-stance
15
+
16
+ ![Model card](https://huggingface.co/front/assets/huggingface_logo.svg)
17
+
18
+ This repository contains a fine-tuned BERT model for stance detection in Turkish. The base model for this fine-tuning is [loodos/albert-base-turkish-uncased](https://huggingface.co/loodos/albert-base-turkish-uncased). The model has been specifically trained on a uniquely collected Turkish stance detection dataset.
19
+
20
+ ## Model Description
21
+
22
+ - **Model Name**: byunal/albert-base-turkish-uncased-stance
23
+ - **Base Model**: [loodos/albert-base-turkish-uncased](https://huggingface.co/loodos/albert-base-turkish-uncased)
24
+ - **Task**: Stance Detection
25
+ - **Language**: Turkish
26
+
27
+ The model predicts the stance of a given text towards a specific target. Possible stance labels include:
28
+
29
+ - **Favor**: The text supports the target
30
+ - **Against**: The text opposes the target
31
+ - **Neutral**: The text does not express a clear stance on the target
32
+
33
+ ## Installation
34
+
35
+ To install the necessary libraries and load the model, run:
36
+
37
+ ```bash
38
+ pip install transformers
39
+ ```
40
+
41
+ ## Usage
42
+ Here’s a simple example of how to use the model for stance detection in Turkish:
43
+
44
+ ```bash
45
+ from transformers import AutoModelForSequenceClassification, AutoTokenizer
46
+ import torch
47
+
48
+ # Load the model and tokenizer
49
+ model_name = "byunal/albert-base-turkish-uncased-stance"
50
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
51
+ model = AutoModelForSequenceClassification.from_pretrained(model_name)
52
+
53
+ # Example text
54
+ text = "Bu konu hakkında kesinlikle karşıyım."
55
+
56
+ # Tokenize input
57
+ inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
58
+
59
+ # Perform prediction
60
+ with torch.no_grad():
61
+ outputs = model(**inputs)
62
+
63
+ # Get predicted stance
64
+ predictions = torch.argmax(outputs.logits, dim=-1)
65
+ stance_label = predictions.item()
66
+
67
+ # Display result
68
+ labels = ["Favor", "Against", "Neutral"]
69
+ print(f"The stance is: {labels[stance_label]}")
70
+ ```
71
+
72
+ ## Training
73
+ This model was fine-tuned using a specialized Turkish stance detection dataset that uniquely reflects various text contexts and opinions. The dataset includes diverse examples from social media, news articles, and public comments, ensuring a robust understanding of stance detection in real-world applications.
74
+
75
+ - Epochs: 10
76
+ - Batch Size: 32
77
+ - Learning Rate: 5e-5
78
+ - Optimizer: AdamW
79
+
80
+ ## Evaluation
81
+ The model was evaluated using Accuracy and Macro F1-score on a validation dataset. The results confirm the model's effectiveness in stance detection tasks in Turkish.
82
+ - Accuracy Score: % 76.0
83
+ - Macro F1 Score: % 77.0