nicholasKluge commited on
Commit
46fe6cd
·
verified ·
1 Parent(s): 0aedf1f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -93
README.md CHANGED
@@ -6,28 +6,11 @@ language:
6
  - pt
7
  pipeline_tag: translation
8
  ---
9
- # Transformer-eng-por
10
 
11
- ## Model Overview
12
 
13
- The transformer-eng-por model is a transformer trained for text classification.
14
-
15
- ### Details
16
-
17
- - **Size:** 23,805,216 parameters
18
- - **Model type:** Transformer
19
- - **Optimizer**: `rmsprop`
20
- - **Number of Epochs:** 30
21
- - **Embbedding dimensionality:** 256
22
- - **Dense dimensionality:** 2048
23
- - **Attention heads:** 8
24
- - **Vocabulary size:** 20000
25
- - **Sequence lenght:** 20
26
- - **Hardware:** Tesla V4
27
- - **Emissions:** Not measured
28
- - **Total Energy Consumption:** Not measured
29
-
30
- ### How to Use
31
 
32
  ```python
33
  import tensorflow as tf
@@ -53,7 +36,7 @@ portuguese_vocabulary_path = hf_hub_download(
53
 
54
  from keras_transformer_blocks import TransformerEncoder, PositionalEmbedding, TransformerDecoder
55
 
56
- transformer = keras.models.load_model("/content/transformer-eng-por/transformer-eng-por.h5",
57
  custom_objects={"TransformerEncoder": TransformerEncoder,
58
  "PositionalEmbedding": PositionalEmbedding,
59
  "TransformerDecoder": TransformerDecoder})
@@ -109,75 +92,3 @@ for sentence in eng_sentences:
109
  print(f'Portuguese translation:\n{decode_sequence(sentence)}')
110
  print('-' * 50)
111
  ```
112
- This will output the following:
113
-
114
- ```
115
- English sentence:
116
- What is its name?
117
- Portuguese translation:
118
- [start] qual é o nome dele [end]
119
- --------------------------------------------------
120
- English sentence:
121
- How old are you?
122
- Portuguese translation:
123
- [start] quantos anos você tem [end]
124
- --------------------------------------------------
125
- English sentence:
126
- I know you know where Mary is.
127
- Portuguese translation:
128
- [start] eu sei que você sabe onde mary está [end]
129
- --------------------------------------------------
130
- English sentence:
131
- We will show Tom.
132
- Portuguese translation:
133
- [start] vamos ligar para o tom [end]
134
- --------------------------------------------------
135
- English sentence:
136
- What do you all do?
137
- Portuguese translation:
138
- [start] o que vocês todos nós têm feito [end]
139
- --------------------------------------------------
140
- English sentence:
141
- Don't do it!
142
- Portuguese translation:
143
- [start] não faça isso [end]
144
- --------------------------------------------------
145
- ```
146
- ## Intended Use
147
-
148
- This model was created for research purposes only. Specifically, it was designed to translate sentences from English to Portuguese. We do not recommend any application of this model outside this scope.
149
-
150
-
151
- ## Performance Metrics
152
-
153
- Accuracy: 76,46%
154
-
155
-
156
- ## Training Data
157
-
158
- [English-portuguese translation](https://www.kaggle.com/datasets/nageshsingh/englishportuguese-translation).
159
-
160
- The dataset consists of a set of English and Portuguese sentences.
161
-
162
- ## Limitations
163
-
164
- In `What is its name?` to `[start] o que é o seu nome [end]`, the `transformer` model makes a gender assumption,
165
- even though the source sentence wasn't gendered (`[start] qual é o nome dele [end]`).
166
- Errors like these are common in NLP, algorithmic bias being one of the great problems associated with using language models
167
- in real applications. In conclusion, we do not recommend using this model in real-world applications.
168
- It was solely developed for academic and educational purposes.
169
-
170
- # Cite as
171
- ```latex
172
- @misc{teenytinycastle,
173
- doi = {10.5281/zenodo.7112065},
174
- url = {https://github.com/Nkluge-correa/teeny-tiny_castle},
175
- author = {Nicholas Kluge Corr{\^e}a},
176
- title = {Teeny-Tiny Castle},
177
- year = {2024},
178
- publisher = {GitHub},
179
- journal = {GitHub repository},
180
- }
181
- ```
182
- ## License
183
- The transformer-eng-por is licensed under the Apache License, Version 2.0. See the LICENSE file for more details.
 
6
  - pt
7
  pipeline_tag: translation
8
  ---
9
+ # Transformer En-PT (Teeny-Tiny Castle)
10
 
11
+ This model is part of a tutorial tied to the [Teeny-Tiny Castle](https://github.com/Nkluge-correa/TeenyTinyCastle), an open-source repository containing educational tools for AI Ethics and Safety research.
12
 
13
+ ## How to Use
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
  ```python
16
  import tensorflow as tf
 
36
 
37
  from keras_transformer_blocks import TransformerEncoder, PositionalEmbedding, TransformerDecoder
38
 
39
+ transformer = keras.models.load_model("./transformer-eng-por/transformer-eng-por.h5",
40
  custom_objects={"TransformerEncoder": TransformerEncoder,
41
  "PositionalEmbedding": PositionalEmbedding,
42
  "TransformerDecoder": TransformerDecoder})
 
92
  print(f'Portuguese translation:\n{decode_sequence(sentence)}')
93
  print('-' * 50)
94
  ```