MarcBrun commited on
Commit
9f81c71
1 Parent(s): fc3b4d4

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +69 -0
README.md ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ - es
5
+ - eu
6
+ widget:
7
+ - text: "When was Florence Nightingale born?"
8
+ context: "Florence Nightingale, known for being the founder of modern nursing, was born in Florence, Italy, in 1820."
9
+ example_title: "English"
10
+ - text: "¿Por qué provincias pasa el Tajo?"
11
+ context: "El Tajo es el río más largo de la península ibérica, a la que atraviesa en su parte central, siguiendo un rumbo este-oeste, con una leve inclinación hacia el suroeste, que se acentúa cuando llega a Portugal, donde recibe el nombre de Tejo.
12
+
13
+ Nace en los montes Universales, en la sierra de Albarracín, sobre la rama occidental del sistema Ibérico y, después de recorrer 1007 km, llega al océano Atlántico en la ciudad de Lisboa. En su desembocadura forma el estuario del mar de la Paja, en el que vierte un caudal medio de 456 m³/s. En sus primeros 816 km atraviesa España, donde discurre por cuatro comunidades autónomas (Aragón, Castilla-La Mancha, Madrid y Extremadura) y un total de seis provincias (Teruel, Guadalajara, Cuenca, Madrid, Toledo y Cáceres)."
14
+ example_title: "Español"
15
+ - text: "Zer beste izenak ditu Tartalo?"
16
+ context: "Tartalo euskal mitologiako izaki begibakar artzain erraldoia da. Tartalo izena zenbait euskal hizkeratan herskari-bustidurarekin ahoskatu ohi denez, horrelaxe ere idazten da batzuetan: Ttarttalo. Euskal Herriko zenbait tokitan, Torto edo Anxo ere esaten diote."
17
+ example_title: "Euskara"
18
+ ---
19
+
20
+ # ixambert-base-cased finetuned for QA
21
+
22
+ This is a basic implementation of the multilingual model ["ixambert-base-cased"](https://huggingface.co/ixa-ehu/ixambert-base-cased), fine-tuned on an experimental version of SQuAD1.1 in Basque (1/3 size of original SQuAD1.1), that is able to answer basic factual questions.
23
+
24
+ ## Overview
25
+
26
+ * **Language model:** ixambert-base-cased
27
+ * **Languages:** English, Spanish and Basque
28
+ * **Downstream task:** Extractive QA
29
+ * **Training data:** Experimental SQuAD1.1 in Basque
30
+ * **Eval data:** Experimental SQuAD1.1 in Basque
31
+ * **Infrastructure:** 1x GeForce RTX 2080
32
+
33
+ ## Outputs
34
+
35
+ The model outputs the answer to the question, the start and end positions of the answer in the original context, and a score for the probability for that span of text to be the correct answer. For example:
36
+
37
+ ```python
38
+ {'score': 0.9667195081710815, 'start': 101, 'end': 105, 'answer': '1820'}
39
+ ```
40
+
41
+ ## How to use
42
+
43
+ ```python
44
+ from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline
45
+
46
+ model_name = "MarcBrun/ixambert-finetuned-squad-eu"
47
+
48
+ # To get predictions
49
+ context = "Florence Nightingale, known for being the founder of modern nursing, was born in Florence, Italy, in 1820"
50
+ question = "When was Florence Nightingale born?"
51
+ qa = pipeline("question-answering", model=model_name, tokenizer=model_name)
52
+ pred = qa(question=question,context=context)
53
+
54
+ # To load the model and tokenizer
55
+ model = AutoModelForQuestionAnswering.from_pretrained(model_name)
56
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
57
+ ```
58
+
59
+ ## Hyperparameters
60
+
61
+ ```
62
+ batch_size = 8
63
+ n_epochs = 3
64
+ learning_rate = 2e-5
65
+ optimizer = AdamW
66
+ lr_schedule = linear
67
+ max_seq_len = 384
68
+ doc_stride = 128
69
+ ```