rhaymison commited on
Commit
8081d7d
1 Parent(s): e2f8c8c

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +30 -3
README.md CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- license: cc-by-4.0
3
  base_model: Helsinki-NLP/opus-mt-tc-big-en-pt
4
  tags:
5
  - generated_from_trainer
@@ -8,6 +8,9 @@ datasets:
8
  model-index:
9
  - name: opus-en-to-pt-translate
10
  results: []
 
 
 
11
  ---
12
 
13
  <!-- This model card has been generated automatically according to the information the Trainer had access to. You
@@ -29,7 +32,7 @@ From 2004 to 2015, he co-produced and hosted the reality television series The A
29
  """
30
 
31
  from transformers import pipeline
32
- pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-en-pt")
33
  print(pipe())
34
 
35
  #Trump recebeu um título de bacharel em economia pela Universidade da Pensilvânia em 1968, e o seu pai deu- lhe o nome de presidente do seu negócio imobiliário em 1971.
@@ -38,6 +41,30 @@ print(pipe())
38
  #licenciamento do nome Trump. De 2004 a 2015, ele produziu em conjunto e alojou a série de reality série The Apprentice.
39
  ```
40
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  ### Training hyperparameters
42
 
43
  The following hyperparameters were used during training:
@@ -104,4 +131,4 @@ It achieves the following results on the evaluation set:
104
  - Transformers 4.38.1
105
  - Pytorch 2.1.0+cu121
106
  - Datasets 2.18.0
107
- - Tokenizers 0.15.2
 
1
  ---
2
+ license: apache-2.0
3
  base_model: Helsinki-NLP/opus-mt-tc-big-en-pt
4
  tags:
5
  - generated_from_trainer
 
8
  model-index:
9
  - name: opus-en-to-pt-translate
10
  results: []
11
+ language:
12
+ - pt
13
+ pipeline_tag: translation
14
  ---
15
 
16
  <!-- This model card has been generated automatically according to the information the Trainer had access to. You
 
32
  """
33
 
34
  from transformers import pipeline
35
+ pipe = pipeline("translation", model="rhaymison/opus-en-to-pt-translator")
36
  print(pipe())
37
 
38
  #Trump recebeu um título de bacharel em economia pela Universidade da Pensilvânia em 1968, e o seu pai deu- lhe o nome de presidente do seu negócio imobiliário em 1971.
 
41
  #licenciamento do nome Trump. De 2004 a 2015, ele produziu em conjunto e alojou a série de reality série The Apprentice.
42
  ```
43
 
44
+ ```python
45
+
46
+ from transformers import MarianMTModel, MarianTokenizer
47
+
48
+ texts = [
49
+ ">>por<< Trump received a Bachelor of Science in economics from the University of Pennsylvania in 1968, and his father named him president of his real estate business in 1971.",
50
+ ">>por<< Trump renamed it the Trump Organization and reoriented the company toward building and renovating skyscrapers, hotels, casinos, and golf courses."
51
+ ]
52
+
53
+ model = "rhaymison/opus-en-to-pt-translator"
54
+ tokenizer = MarianTokenizer.from_pretrained(model)
55
+ model = MarianMTModel.from_pretrained(model)
56
+ translated = model.generate(**tokenizer(texts, return_tensors="pt", padding=True))
57
+
58
+ for t in translated:
59
+ print( tokenizer.decode(t, skip_special_tokens=True) )
60
+
61
+ # output:
62
+ # Trump recebeu um título de bacharel em economia pela Universidade da Pensilvânia em 1968, e o seu pai deu- lhe o nome de presidente do seu negócio imobiliário em 1971..
63
+ # Trump mudou o nome para Organização Trump e voltou a orientar a companhia para a construção e reforma de arranha- céus, hotéis, casinos e campos de golfe.
64
+
65
+
66
+ ```
67
+
68
  ### Training hyperparameters
69
 
70
  The following hyperparameters were used during training:
 
131
  - Transformers 4.38.1
132
  - Pytorch 2.1.0+cu121
133
  - Datasets 2.18.0
134
+ - Tokenizers 0.15.2