Rafaelvieira432 commited on
Commit
bf6a125
·
verified ·
1 Parent(s): 145d706

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +120 -123
README.md CHANGED
@@ -44,106 +44,104 @@ metrics:
44
 
45
  # 🌍 Synapse-LangID
46
 
47
- **Synapse-LangID** is a lightweight multilingual language identification model developed by **Comunidade Synapse BR**.
48
 
49
- Designed for fast and efficient language detection, the model combines a compact BERT architecture with strong multilingual performance, making it suitable for production systems, APIs, mobile applications and edge devices.
50
 
51
- The project focuses on providing an open-source, lightweight alternative for language identification while maintaining low computational requirements.
52
 
53
  ---
54
 
55
- # 🚀 Highlights
56
 
57
- - 🌍 Supports **15 languages**
58
- - ⚡ Fast inference
59
- - 🪶 Lightweight architecture (~5M parameters)
60
- - 📦 Small model size (~20 MB)
61
- - 🤗 Compatible with Hugging Face Transformers
62
- - 🔓 Open-source
63
- - 💻 Suitable for production and edge computing
64
 
65
  ---
66
 
67
- # 📖 Model Overview
68
 
69
- | Property | Value |
70
- |-----------|-------|
71
- | Architecture | BERT Encoder |
72
- | Parameters | ~5 Million |
73
- | Model Size | ~20 MB |
74
- | Vocabulary Size | 16,000 |
75
- | Maximum Sequence Length | 128 tokens |
76
  | Hidden Size | 192 |
77
- | Transformer Layers | 6 |
78
- | Attention Heads | 4 |
79
- | Intermediate Size | 512 |
80
  | Framework | PyTorch |
81
- | Library | Hugging Face Transformers |
82
 
83
  ---
84
 
85
- # 🌐 Supported Languages
86
-
87
- | Code | Language |
88
- |------|----------|
89
- | en | English |
90
- | es | Spanish |
91
- | fi | Finnish |
92
- | fr | French |
93
- | it | Italian |
94
- | ja | Japanese |
95
- | ko | Korean |
96
- | nl | Dutch |
97
- | pl | Polish |
98
- | pt | Portuguese |
99
- | ro | Romanian |
100
- | ru | Russian |
101
- | sv | Swedish |
102
- | tr | Turkish |
103
- | zh | Chinese |
104
-
105
- **Total:** 15 supported languages.
106
 
107
  ---
108
 
109
- # 📚 Training Dataset
110
 
111
- The model was trained using:
112
 
113
  **Comunidade-Synapse-BR/dataset-multilingue-750k**
114
 
115
- Dataset characteristics:
116
 
117
- - Approximately **750,000 texts**
118
- - 15 balanced languages
119
- - UTF-8 encoding
120
- - Cleaned and deduplicated
121
- - Balanced class distribution
122
- - Train / Validation / Test splits
123
- - Optimized for language identification
124
 
125
  ---
126
 
127
- # 🎯 Intended Uses
128
 
129
- Synapse-LangID is suitable for:
130
 
131
- - Language Identification
132
- - NLP Pipelines
133
- - Search Engines
134
- - Translation Pipelines
135
- - Dataset Cleaning
136
- - Dataset Filtering
137
- - Language Routing
138
- - Text Preprocessing
139
- - Document Processing
140
- - AI Applications
141
 
142
  ---
143
 
144
- # ⚡ Quick Start
145
-
146
- Install Transformers:
147
 
148
  ```bash
149
  pip install transformers torch
@@ -151,7 +149,7 @@ pip install transformers torch
151
 
152
  ---
153
 
154
- # 🤗 Pipeline Example
155
 
156
  ```python
157
  from transformers import pipeline
@@ -166,7 +164,7 @@ print(classifier("Olá, tudo bem?"))
166
 
167
  ---
168
 
169
- # 💻 Python Example
170
 
171
  ```python
172
  import torch
@@ -177,10 +175,10 @@ repo = "Comunidade-Synapse-BR/Synapse-LangID"
177
  tokenizer = AutoTokenizer.from_pretrained(repo)
178
  model = AutoModelForSequenceClassification.from_pretrained(repo)
179
 
180
- text = "Olá, tudo bem?"
181
 
182
  inputs = tokenizer(
183
- text,
184
  return_tensors="pt",
185
  truncation=True,
186
  max_length=128
@@ -189,70 +187,71 @@ inputs = tokenizer(
189
  with torch.no_grad():
190
  outputs = model(**inputs)
191
 
192
- prediction = outputs.logits.softmax(dim=-1)
193
 
194
- label = model.config.id2label[prediction.argmax().item()]
 
 
195
 
196
- print(label)
197
  ```
198
 
199
  ---
200
 
201
- # 📊 Example Predictions
202
 
203
- | Input | Prediction |
204
- |-------|------------|
205
- | Hello world | en |
206
- | Olá mundo | pt |
207
- | Bonjour | fr |
208
- | Hola amigos | es |
209
- | Ciao a tutti | it |
210
- | 今日はいい天気ですね | ja |
211
- | 안녕하세요 | ko |
212
- | Привет | ru |
213
 
214
  ---
215
 
216
- # 📈 Performance
217
 
218
- Synapse-LangID performs best on:
219
 
220
- - Complete sentences
221
- - Paragraphs
222
- - Documentation
223
- - News articles
224
- - General conversations
225
 
226
- Performance may decrease for:
227
 
228
- - Extremely short texts
229
- - Mixed-language sentences
230
- - Random strings
231
- - Numbers only
232
- - Emoji-only messages
233
- - Heavy internet slang
234
 
235
- Performance metrics will be expanded in future releases.
236
 
237
  ---
238
 
239
- # ⚠️ Limitations
240
 
241
- Although Synapse-LangID performs well on multilingual language identification, no classifier is perfect.
242
 
243
- The model may struggle with:
244
 
245
- - Very short texts
246
- - Code-switching
247
- - Ambiguous content
248
- - Texts with little linguistic information
249
- - Mixed-language inputs
250
 
251
- Human review is recommended for critical applications.
252
 
253
  ---
254
 
255
- # 📂 Repository Files
256
 
257
  ```
258
  config.json
@@ -265,17 +264,17 @@ README.md
265
 
266
  ---
267
 
268
- # 📜 License
269
 
270
- This model is distributed under the **Apache License 2.0**.
271
 
272
- See the repository for additional licensing information.
273
 
274
  ---
275
 
276
- # 📚 Citation
277
 
278
- If this model contributes to your research or project, please consider citing it.
279
 
280
  ```bibtex
281
  @misc{synapse_langid_2026,
@@ -288,12 +287,10 @@ If this model contributes to your research or project, please consider citing it
288
 
289
  ---
290
 
291
- # 🤝 About Comunidade Synapse BR
292
-
293
- **Comunidade Synapse BR** is a Brazilian open-source initiative dedicated to developing lightweight AI models, datasets and tools for the global AI community.
294
 
295
- Our mission is to make artificial intelligence more accessible through efficient, transparent and open technologies while strengthening the Brazilian AI ecosystem.
296
 
297
- We welcome contributions, suggestions and community feedback.
298
 
299
- ---
 
44
 
45
  # 🌍 Synapse-LangID
46
 
47
+ O **Synapse-LangID** é um modelo leve de identificação automática de idiomas desenvolvido pela **Comunidade Synapse BR**.
48
 
49
+ Projetado para oferecer detecção rápida e eficiente de idiomas, o modelo combina uma arquitetura compacta baseada em **BERT** com bom desempenho multilíngue, sendo adequado para sistemas em produção, APIs, aplicações móveis e dispositivos de borda (*edge computing*).
50
 
51
+ Nosso objetivo é disponibilizar uma solução **open source**, leve e acessível para identificação de idiomas, mantendo baixo custo computacional e facilidade de integração.
52
 
53
  ---
54
 
55
+ # 🚀 Destaques
56
 
57
+ - 🌍 Suporte para **15 idiomas**
58
+ - ⚡ Inferência rápida
59
+ - 🪶 Arquitetura leve (~5 milhões de parâmetros)
60
+ - 📦 Aproximadamente 20 MB
61
+ - 🤗 Compatível com Hugging Face Transformers
62
+ - 🔓 Código aberto
63
+ - 💻 Ideal para produção, APIs e Edge Computing
64
 
65
  ---
66
 
67
+ # 📖 Visão Geral do Modelo
68
 
69
+ | Propriedade | Valor |
70
+ |-------------|-------|
71
+ | Arquitetura | BERT Encoder |
72
+ | Parâmetros | ~5 milhões |
73
+ | Tamanho | ~20 MB |
74
+ | Vocabulário | 16.000 tokens |
75
+ | Comprimento máximo | 128 tokens |
76
  | Hidden Size | 192 |
77
+ | Camadas Transformer | 6 |
78
+ | Cabeças de Atenção | 4 |
79
+ | Camada Intermediária | 512 |
80
  | Framework | PyTorch |
81
+ | Biblioteca | Hugging Face Transformers |
82
 
83
  ---
84
 
85
+ # 🌐 Idiomas Suportados
86
+
87
+ | Código | Idioma |
88
+ |---------|--------|
89
+ | en | Inglês |
90
+ | es | Espanhol |
91
+ | fi | Finlandês |
92
+ | fr | Francês |
93
+ | it | Italiano |
94
+ | ja | Japonês |
95
+ | ko | Coreano |
96
+ | nl | Holandês |
97
+ | pl | Polonês |
98
+ | pt | Português |
99
+ | ro | Romeno |
100
+ | ru | Russo |
101
+ | sv | Sueco |
102
+ | tr | Turco |
103
+ | zh | Chinês |
104
+
105
+ **Total:** 15 idiomas.
106
 
107
  ---
108
 
109
+ # 📚 Dataset de Treinamento
110
 
111
+ O modelo foi treinado utilizando o dataset:
112
 
113
  **Comunidade-Synapse-BR/dataset-multilingue-750k**
114
 
115
+ Características do conjunto de dados:
116
 
117
+ - Aproximadamente **750 mil textos**
118
+ - 15 idiomas
119
+ - Distribuição balanceada
120
+ - Textos codificados em UTF-8
121
+ - Dados limpos e sem duplicações
122
+ - Divisão em treino, validação e teste
123
+ - Otimizado para identificação de idiomas
124
 
125
  ---
126
 
127
+ # 🎯 Casos de Uso
128
 
129
+ O Synapse-LangID pode ser utilizado em:
130
 
131
+ - Identificação automática de idiomas
132
+ - Pipelines de NLP
133
+ - Motores de busca
134
+ - Sistemas de tradução
135
+ - Limpeza de datasets
136
+ - Filtragem de documentos
137
+ - Roteamento por idioma
138
+ - Pré-processamento de texto
139
+ - Organização de documentos
140
+ - Aplicações de Inteligência Artificial
141
 
142
  ---
143
 
144
+ # ⚡ Instalação
 
 
145
 
146
  ```bash
147
  pip install transformers torch
 
149
 
150
  ---
151
 
152
+ # 🤗 Exemplo utilizando Pipeline
153
 
154
  ```python
155
  from transformers import pipeline
 
164
 
165
  ---
166
 
167
+ # 💻 Exemplo em Python
168
 
169
  ```python
170
  import torch
 
175
  tokenizer = AutoTokenizer.from_pretrained(repo)
176
  model = AutoModelForSequenceClassification.from_pretrained(repo)
177
 
178
+ texto = "Olá, tudo bem?"
179
 
180
  inputs = tokenizer(
181
+ texto,
182
  return_tensors="pt",
183
  truncation=True,
184
  max_length=128
 
187
  with torch.no_grad():
188
  outputs = model(**inputs)
189
 
190
+ probabilidades = outputs.logits.softmax(dim=-1)
191
 
192
+ classe = model.config.id2label[
193
+ probabilidades.argmax().item()
194
+ ]
195
 
196
+ print(classe)
197
  ```
198
 
199
  ---
200
 
201
+ # 📊 Exemplos de Predição
202
 
203
+ | Texto | Idioma |
204
+ |--------|---------|
205
+ | Hello world | Inglês |
206
+ | Olá mundo | Português |
207
+ | Bonjour | Francês |
208
+ | Hola amigos | Espanhol |
209
+ | Ciao a tutti | Italiano |
210
+ | 今日はいい天気ですね | Japonês |
211
+ | 안녕하세요 | Coreano |
212
+ | Привет | Russo |
213
 
214
  ---
215
 
216
+ # 📈 Desempenho
217
 
218
+ O Synapse-LangID apresenta melhor desempenho em:
219
 
220
+ - Frases completas
221
+ - Parágrafos
222
+ - Documentação
223
+ - Notícias
224
+ - Conversas do cotidiano
225
 
226
+ O desempenho pode diminuir em casos como:
227
 
228
+ - Textos extremamente curtos
229
+ - Frases com múltiplos idiomas
230
+ - Sequências aleatórias de caracteres
231
+ - Apenas números
232
+ - Apenas emojis
233
+ - Uso excessivo de gírias da internet
234
 
235
+ Novas métricas serão adicionadas em futuras versões.
236
 
237
  ---
238
 
239
+ # ⚠️ Limitações
240
 
241
+ Embora apresente bom desempenho em identificação automática de idiomas, nenhum classificador é perfeito.
242
 
243
+ O modelo pode apresentar dificuldades em situações como:
244
 
245
+ - Mensagens muito curtas
246
+ - Mistura de idiomas (*code-switching*)
247
+ - Conteúdo ambíguo
248
+ - Textos com pouca informação linguística
 
249
 
250
+ Para aplicações críticas, recomenda-se utilizar validação humana como camada adicional de segurança.
251
 
252
  ---
253
 
254
+ # 📂 Arquivos do Repositório
255
 
256
  ```
257
  config.json
 
264
 
265
  ---
266
 
267
+ # 📜 Licença
268
 
269
+ Este modelo é distribuído sob a licença **Apache License 2.0**.
270
 
271
+ Consulte o repositório para mais informações.
272
 
273
  ---
274
 
275
+ # 📚 Citação
276
 
277
+ Caso este modelo contribua para sua pesquisa ou projeto, considere citá-lo.
278
 
279
  ```bibtex
280
  @misc{synapse_langid_2026,
 
287
 
288
  ---
289
 
290
+ # 🤝 Sobre a Comunidade Synapse BR
 
 
291
 
292
+ A **Comunidade Synapse BR** é uma iniciativa brasileira dedicada ao desenvolvimento de modelos de inteligência artificial, datasets e ferramentas de código aberto.
293
 
294
+ Nossa missão é tornar a inteligência artificial mais acessível por meio de tecnologias eficientes, leves e abertas, contribuindo para fortalecer a presença do Brasil no ecossistema global de IA.
295
 
296
+ Contribuições, sugestões e relatos de problemas são sempre bem-vindos.