apkonsta commited on
Commit
f1b67a4
·
verified ·
1 Parent(s): 525010c

Upload folder using huggingface_hub

Browse files
.ipynb_checkpoints/README-checkpoint.md ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - ru
4
+ license: apache-2.0
5
+ base_model: cointegrated/rubert-tiny2
6
+ tags:
7
+ - finance
8
+ - sentiment-analysis
9
+ - russian
10
+ datasets:
11
+ - apkonsta/FinancialPhraseBank-v1.0-ru
12
+ metrics:
13
+ - accuracy
14
+ - f1
15
+ ---
16
+
17
+ # FinRuBERT
18
+
19
+ Fine-tuned модель для анализа тональности финансовых текстов на русском языке.
20
+
21
+ ## Описание
22
+ Модель была дообучена на датасете FinancialPhraseBank (русская версия) и предсказывает:
23
+ - **Негативный** (`negative`)
24
+ - **Нейтральный** (`neutral`)
25
+ - **Позитивный** (`positive`)
26
+
27
+ ## Данные обучения
28
+ Использовалась версия датасета с согласием аннотаторов ≥50% (4,840 примеров):
29
+ - Sentences_50Agree.csv из [FinancialPhraseBank-v1.0-ru](https://huggingface.co/datasets/apkonsta/FinancialPhraseBank-v1.0-ru)
30
+
31
+ ## Использование
32
+
33
+ ```python
34
+ from transformers import AutoModelForSequenceClassification, AutoTokenizer, pipeline
35
+
36
+ model_name = "apkonsta/finrubert"
37
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
38
+ model = AutoModelForSequenceClassification.from_pretrained(model_name)
39
+
40
+ classifier = pipeline("text-classification", model=model, tokenizer=tokenizer)
41
+ result = classifier("Прибыль компании сократилась на 15% в этом квартале")
42
+
43
+ print(result) # [{'label': 'negative', 'score': 0.88}]
.ipynb_checkpoints/vocab-checkpoint.txt ADDED
The diff for this file is too large to render. See raw diff
 
README.md CHANGED
@@ -1,3 +1,43 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - ru
4
+ license: apache-2.0
5
+ base_model: cointegrated/rubert-tiny2
6
+ tags:
7
+ - finance
8
+ - sentiment-analysis
9
+ - russian
10
+ datasets:
11
+ - apkonsta/FinancialPhraseBank-v1.0-ru
12
+ metrics:
13
+ - accuracy
14
+ - f1
15
+ ---
16
+
17
+ # FinRuBERT
18
+
19
+ Fine-tuned модель для анализа тональности финансовых текстов на русском языке.
20
+
21
+ ## Описание
22
+ Модель была дообучена на датасете FinancialPhraseBank (русская версия) и предсказывает:
23
+ - **Негативный** (`negative`)
24
+ - **Нейтральный** (`neutral`)
25
+ - **Позитивный** (`positive`)
26
+
27
+ ## Данные обучения
28
+ Использовалась версия датасета с согласием аннотаторов ≥50% (4,840 примеров):
29
+ - Sentences_50Agree.csv из [FinancialPhraseBank-v1.0-ru](https://huggingface.co/datasets/apkonsta/FinancialPhraseBank-v1.0-ru)
30
+
31
+ ## Использование
32
+
33
+ ```python
34
+ from transformers import AutoModelForSequenceClassification, AutoTokenizer, pipeline
35
+
36
+ model_name = "apkonsta/finrubert"
37
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
38
+ model = AutoModelForSequenceClassification.from_pretrained(model_name)
39
+
40
+ classifier = pipeline("text-classification", model=model, tokenizer=tokenizer)
41
+ result = classifier("Прибыль компании сократилась на 15% в этом квартале")
42
+
43
+ print(result) # [{'label': 'negative', 'score': 0.88}]
config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"return_dict": true, "output_hidden_states": false, "output_attentions": false, "torchscript": false, "torch_dtype": "float32", "use_bfloat16": false, "tf_legacy_loss": false, "pruned_heads": {}, "tie_word_embeddings": true, "chunk_size_feed_forward": 0, "is_encoder_decoder": false, "is_decoder": false, "cross_attention_hidden_size": null, "add_cross_attention": false, "tie_encoder_decoder": false, "max_length": 20, "min_length": 0, "do_sample": false, "early_stopping": false, "num_beams": 1, "num_beam_groups": 1, "diversity_penalty": 0.0, "temperature": 1.0, "top_k": 50, "top_p": 1.0, "typical_p": 1.0, "repetition_penalty": 1.0, "length_penalty": 1.0, "no_repeat_ngram_size": 0, "encoder_no_repeat_ngram_size": 0, "bad_words_ids": null, "num_return_sequences": 1, "output_scores": false, "return_dict_in_generate": false, "forced_bos_token_id": null, "forced_eos_token_id": null, "remove_invalid_values": false, "exponential_decay_length_penalty": null, "suppress_tokens": null, "begin_suppress_tokens": null, "architectures": ["BertForPreTraining"], "finetuning_task": null, "id2label": {"0": "positive", "1": "negative", "2": "neutral"}, "label2id": {"positive": 0, "negative": 1, "neutral": 2}, "tokenizer_class": null, "prefix": null, "bos_token_id": null, "pad_token_id": 0, "eos_token_id": null, "sep_token_id": null, "decoder_start_token_id": null, "task_specific_params": null, "problem_type": null, "_name_or_path": "/home/jupyter-anikolaeva/finrubert/finBERT/models/classifier_model/finbert-sentiment", "_attn_implementation_autoset": true, "transformers_version": "4.50.0.dev0", "emb_size": 312, "gradient_checkpointing": false, "model_type": "bert", "vocab_size": 83828, "hidden_size": 312, "num_hidden_layers": 3, "num_attention_heads": 12, "hidden_act": "gelu", "intermediate_size": 600, "hidden_dropout_prob": 0.1, "attention_probs_dropout_prob": 0.1, "max_position_embeddings": 2048, "type_vocab_size": 2, "initializer_range": 0.02, "layer_norm_eps": 1e-12, "position_embedding_type": "absolute", "use_cache": true, "classifier_dropout": null}
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2864f11397ec0a304dc62b3dbd94bc04875f131affb0e55adc6f7ea9fc2e7fcb
3
+ size 116801241
special_tokens_map.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": {
3
+ "content": "[CLS]",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "mask_token": {
10
+ "content": "[MASK]",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "[PAD]",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "sep_token": {
24
+ "content": "[SEP]",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "unk_token": {
31
+ "content": "[UNK]",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ }
37
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "1": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "2": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "3": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "4": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "clean_up_tokenization_spaces": false,
45
+ "cls_token": "[CLS]",
46
+ "do_basic_tokenize": true,
47
+ "do_lower_case": false,
48
+ "extra_special_tokens": {},
49
+ "mask_token": "[MASK]",
50
+ "max_length": 512,
51
+ "model_max_length": 2048,
52
+ "never_split": null,
53
+ "pad_to_multiple_of": null,
54
+ "pad_token": "[PAD]",
55
+ "pad_token_type_id": 0,
56
+ "padding_side": "right",
57
+ "sep_token": "[SEP]",
58
+ "stride": 0,
59
+ "strip_accents": null,
60
+ "tokenize_chinese_chars": true,
61
+ "tokenizer_class": "BertTokenizer",
62
+ "truncation_side": "right",
63
+ "truncation_strategy": "longest_first",
64
+ "unk_token": "[UNK]"
65
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff