jeanpoll commited on
Commit
af42be6
1 Parent(s): 35792b3

initial commit

Browse files
README.md ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ widget:
4
+ - text: "I am going to buy 100 shares of cake tomorrow"
5
+ ---
6
+
7
+ # roberta-ticker: model was fine-tuned from Roberta to detect financial tickers
8
+
9
+ ## Introduction
10
+
11
+ This is a model specifically designed to identify tickers in text.
12
+ Model was trained on transformed dataset from following Kaggle dataset:
13
+ https://www.kaggle.com/omermetinn/tweets-about-the-top-companies-from-2015-to-2020
14
+
15
+
16
+
17
+ ## How to use roberta-ticker with HuggingFace
18
+
19
+ ##### Load roberta-ticker and its sub-word tokenizer :
20
+
21
+ ```python
22
+ from transformers import AutoTokenizer, AutoModelForTokenClassification
23
+
24
+ tokenizer = AutoTokenizer.from_pretrained("Jean-Baptiste/roberta-ticker")
25
+ model = AutoModelForTokenClassification.from_pretrained("Jean-Baptiste/roberta-ticker")
26
+
27
+
28
+ ##### Process text sample
29
+
30
+ from transformers import pipeline
31
+
32
+ nlp = pipeline('ner', model=model, tokenizer=tokenizer, grouped_entities=True, ignore_labels='O')
33
+
34
+ nlp("I am going to buy 100 shares of cake tomorrow")
35
+ [{'entity_group': 'TICKER',
36
+ 'score': 0.9612462520599365,
37
+ 'word': ' cake',
38
+ 'start': 32,
39
+ 'end': 36}]
40
+
41
+ nlp("I am going to eat cake tomorrow")
42
+ []
43
+
44
+
45
+
46
+ ```
47
+
48
+
49
+ ## Model performances
50
+
51
+
52
+ ```
53
+ precision: 0.8905576596578294
54
+ recall: 0.900554675118859
55
+ f1: 0.8955282684352223
56
+
57
+ ```
58
+
config.json ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "../models_data/models/roberta-base",
3
+ "architectures": [
4
+ "RobertaForTokenClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "bos_token_id": 0,
8
+ "eos_token_id": 2,
9
+ "gradient_checkpointing": false,
10
+ "hidden_act": "gelu",
11
+ "hidden_dropout_prob": 0.1,
12
+ "hidden_size": 768,
13
+ "id2label": {
14
+ "0": "O",
15
+ "1": "TICKER"
16
+ },
17
+ "initializer_range": 0.02,
18
+ "intermediate_size": 3072,
19
+ "label2id": {
20
+ "O": 0,
21
+ "TICKER": 1
22
+ },
23
+ "layer_norm_eps": 1e-05,
24
+ "max_position_embeddings": 514,
25
+ "model_type": "roberta",
26
+ "num_attention_heads": 12,
27
+ "num_hidden_layers": 12,
28
+ "pad_token_id": 1,
29
+ "position_embedding_type": "absolute",
30
+ "transformers_version": "4.2.2",
31
+ "type_vocab_size": 1,
32
+ "use_cache": true,
33
+ "vocab_size": 50265
34
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6cbfa584183c16692abfff352ab3997b9cc868e30cc74c38919f67002f252bae
3
+ size 496315695
special_tokens_map.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"bos_token": "<s>", "eos_token": "</s>", "unk_token": "<unk>", "sep_token": "</s>", "pad_token": "<pad>", "cls_token": "<s>", "mask_token": {"content": "<mask>", "single_word": false, "lstrip": true, "rstrip": false, "normalized": false}}
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"unk_token": {"content": "<unk>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "bos_token": {"content": "<s>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "eos_token": {"content": "</s>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "add_prefix_space": true, "errors": "replace", "sep_token": {"content": "</s>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "cls_token": {"content": "<s>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "pad_token": {"content": "<pad>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "mask_token": {"content": "<mask>", "single_word": false, "lstrip": true, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "model_max_length": 512, "name_or_path": "../models_data/models/roberta-base", "special_tokens_map_file": "../models_data/models/roberta-base\\special_tokens_map.json"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff