dmariko commited on
Commit
2884780
1 Parent(s): cf9fc78

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +64 -0
README.md ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ # T5-base data to text model specialized for Finance NLG
3
+
4
+ __simple version__
5
+
6
+ ----
7
+ ## Usage (HuggingFace Transformers)
8
+
9
+
10
+
11
+ #### Call the model
12
+
13
+ ```python
14
+ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
15
+
16
+ tokenizer = AutoTokenizer.from_pretrained("yseop/FNP_T5_D2T_complete")
17
+
18
+ model = AutoModelForSeq2SeqLM.from_pretrained("yseop/FNP_T5_D2T_complete")
19
+
20
+
21
+ text = ["Group profit | valIs | € 115.7 million && € 115.7 million | dTime | in 2019"]
22
+
23
+ ```
24
+ #### Choose a generation method
25
+
26
+ ```python
27
+
28
+
29
+ input_ids = tokenizer.encode(": {}".format(text), return_tensors="pt")
30
+ p=0.72
31
+ k=40
32
+
33
+ outputs = model.generate(input_ids,
34
+ do_sample=True,
35
+ top_p=p,
36
+ top_k=k,
37
+ early_stopping=True)
38
+
39
+ print(tokenizer.decode(outputs[0]))
40
+
41
+ ```
42
+
43
+
44
+
45
+ ```python
46
+
47
+ input_ids = tokenizer.encode(": {}".format(text), return_tensors="pt")
48
+
49
+ outputs = model.generate(input_ids,
50
+ max_length=200,
51
+ num_beams=2, repetition_penalty=2.5,
52
+ top_k=50, top_p=0.98,
53
+ length_penalty=1.0,
54
+ early_stopping=True)
55
+
56
+ print(tokenizer.decode(outputs[0]))
57
+
58
+
59
+ ```
60
+
61
+
62
+
63
+
64
+ **Created by:** [Yseop](https://www.yseop.com/) | Pioneer in Natural Language Generation (NLG) technology. Scaling human expertise through Natural Language Generation.