File size: 1,212 Bytes
af42be6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13ee076
af42be6
 
 
 
 
 
 
 
b28d090
af42be6
 
 
 
 
 
 
 
 
 
 
b28d090
 
 
af42be6
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
language: en
widget:
- text: "I am going to buy 100 shares of cake tomorrow"
---

# roberta-ticker: model was fine-tuned from Roberta to detect financial tickers

## Introduction

This is a model specifically designed to identify tickers in text.
Model was trained on transformed dataset from following Kaggle dataset:
https://www.kaggle.com/omermetinn/tweets-about-the-top-companies-from-2015-to-2020



## How to use roberta-ticker with HuggingFace

##### Load roberta-ticker and its sub-word tokenizer :

```python
from transformers import AutoTokenizer, AutoModelForTokenClassification

tokenizer = AutoTokenizer.from_pretrained("Jean-Baptiste/roberta-ticker")
model = AutoModelForTokenClassification.from_pretrained("Jean-Baptiste/roberta-ticker")


##### Process text sample 

from transformers import pipeline

nlp = pipeline('ner', model=model, tokenizer=tokenizer, aggregation_strategy="simple")

nlp("I am going to buy 100 shares of cake tomorrow")
[{'entity_group': 'TICKER',
  'score': 0.9612462520599365,
  'word': ' cake',
  'start': 32,
  'end': 36}]
  
nlp("I am going to eat a cake tomorrow")
[]
 


```


## Model performances


```
precision: 0.914157
recall: 0.788824
f1: 0.846878

 ```