byunal commited on
Commit
6f65091
·
verified ·
1 Parent(s): d519bb8

Update README.md

Browse files

Readme was updated.

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