File size: 816 Bytes
b448ba9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
library_name: transformers
language:
- en
- fr
- de
tags:
- v1.0.0
---


#### How to use

You can use this model with Transformers *pipeline* for NER.

<!-- Provide a longer summary of what this model is. -->
```python
from transformers import pipeline

MODEL_NAME = "emanuelaboros/lang-detect"

lang_pipeline = pipeline("lang-detect", model=MODEL_NAME, 
                        trust_remote_code=True,
                        device='cpu')

sentence = """En l'an 1348, au plus fort des ravages de la peste noire à travers l'Europe,
          le Royaume de France se trouvait à la fois au bord du désespoir et face à une opportunité."""

langs = lang_pipeline(sentence)
langs

```

```
{'label': 'fr', 'confidence': 99.87}
```
Works with lists of sentences also.

### BibTeX entry and citation info

```
```