mcsabai commited on
Commit
d04ce6e
1 Parent(s): 4956b28

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +12 -5
README.md CHANGED
@@ -13,14 +13,14 @@ widget:
13
 
14
  ## MODEL DESCRIPTION
15
 
16
- huBERT base model (cased) fine-tuned on SQuAD v2 (NEW!!)
17
 
18
  <p> <i> "SQuAD2.0 combines the 100,000 questions in SQuAD1.1 with over 50,000 unanswerable questions written adversarially by crowdworkers to look similar to answerable ones. To do well on SQuAD2.0, systems must not only answer questions when possible, but also determine when no answer is supported by the paragraph and abstain from answering." </i> [1] </p>
 
19
  - huBert model + Tokenizer: https://huggingface.co/SZTAKI-HLT/hubert-base-cc
20
  - Hungarian SQUAD v2 dataset: Machine Translated SQuAD dataset (Google Translate API)
21
 
22
  ## Model in action
23
-
24
  - Fast usage with pipelines:
25
 
26
  ```python
@@ -28,14 +28,21 @@ from transformers import pipeline
28
  qa_pipeline = pipeline(
29
  "question-answering",
30
  model="mcsabai/huBert-fine-tuned-hungarian-squadv2",
31
- tokenizer="mcsabai/huBert-fine-tuned-hungarian-squadv2"
 
 
32
  )
33
  predictions = qa_pipeline({
34
- 'context': "Anita vagyok és Budapesten élek már több mint 4 éve.",
35
- 'question': "Hol lakik Anita?"
36
  })
37
  print(predictions)
38
  # output:
39
  # {'score': 0.9892364144325256, 'start': 16, 'end': 26, 'answer': 'Budapesten'}
40
  ```
 
 
 
 
 
41
  [1] https://rajpurkar.github.io/SQuAD-explorer/
 
13
 
14
  ## MODEL DESCRIPTION
15
 
16
+ huBERT base model (cased) fine-tuned on SQuADv2 (NEW!!)
17
 
18
  <p> <i> "SQuAD2.0 combines the 100,000 questions in SQuAD1.1 with over 50,000 unanswerable questions written adversarially by crowdworkers to look similar to answerable ones. To do well on SQuAD2.0, systems must not only answer questions when possible, but also determine when no answer is supported by the paragraph and abstain from answering." </i> [1] </p>
19
+
20
  - huBert model + Tokenizer: https://huggingface.co/SZTAKI-HLT/hubert-base-cc
21
  - Hungarian SQUAD v2 dataset: Machine Translated SQuAD dataset (Google Translate API)
22
 
23
  ## Model in action
 
24
  - Fast usage with pipelines:
25
 
26
  ```python
 
28
  qa_pipeline = pipeline(
29
  "question-answering",
30
  model="mcsabai/huBert-fine-tuned-hungarian-squadv2",
31
+ tokenizer="mcsabai/huBert-fine-tuned-hungarian-squadv2",
32
+ topk = 1,
33
+ handle_impossible_answer = True
34
  )
35
  predictions = qa_pipeline({
36
+ 'context': "Máté vagyok és Budapesten élek már több mint 4 éve.",
37
+ 'question': "Hol lakik Máté?"
38
  })
39
  print(predictions)
40
  # output:
41
  # {'score': 0.9892364144325256, 'start': 16, 'end': 26, 'answer': 'Budapesten'}
42
  ```
43
+ Two important parameter:
44
+ - topk (int, optional, defaults to 1) — The number of answers to return (will be chosen by order of likelihood). Note that we return less than topk answers if there are not enough options available within the context.
45
+ - handle_impossible_answer (bool, optional, defaults to False): Whether or not we accept impossible as an answer.
46
+
47
+
48
  [1] https://rajpurkar.github.io/SQuAD-explorer/