Update README.md
Browse files
README.md
CHANGED
@@ -1,75 +1,56 @@
|
|
1 |
-
---
|
2 |
-
library_name: transformers
|
3 |
-
license: mit
|
4 |
-
base_model: distilbert-base-uncased
|
5 |
-
tags:
|
6 |
-
- question-answering
|
7 |
-
- distilbert
|
8 |
-
- squad
|
9 |
-
- fine-tuning
|
10 |
-
datasets:
|
11 |
-
- squad
|
12 |
-
|
13 |
-
-
|
14 |
-
|
15 |
-
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
type:
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
type:
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
value: 请在此填写您的 F1 分数
|
33 |
-
---
|
34 |
|
35 |
# my_awesome_qa_model
|
36 |
|
37 |
-
|
38 |
|
39 |
-
|
40 |
|
41 |
-
- **Loss
|
42 |
|
43 |
-
##
|
44 |
-
|
45 |
-
该模型基于 DistilBERT,是 BERT 的精简版本,参数更少,速度更快,但性能仍接近原始 BERT。通过在 SQuAD 数据集上微调,模型学习了从给定的上下文中抽取回答问题的能力。
|
46 |
-
|
47 |
-
## 预期用途与限制
|
48 |
-
|
49 |
-
### 预期用途
|
50 |
-
|
51 |
-
- **问答系统**:适用于需要从文本中抽取答案的应用,如聊天机器人、信息检索等。
|
52 |
-
- **教育目的**:演示如何微调预训练模型以执行特定任务。
|
53 |
-
|
54 |
-
### 限制
|
55 |
-
|
56 |
-
- **语言局限**:模型仅在英文数据上进行训练,对其他语言的支持可能有限。
|
57 |
-
- **知识截止**:模型的知识截止于其训练数据,无法理解训练后发生的事件。
|
58 |
-
- **领域适应性**:在特定领域(如医学、法律)可能表现不佳,需要在相关领域数据上进一步微调。
|
59 |
-
|
60 |
-
## 使用方法
|
61 |
|
62 |
```python
|
63 |
from transformers import pipeline
|
64 |
|
65 |
-
#
|
66 |
question_answerer = pipeline(
|
67 |
"question-answering",
|
68 |
model="real-jiakai/my_awesome_qa_model",
|
69 |
tokenizer="real-jiakai/my_awesome_qa_model"
|
70 |
)
|
71 |
|
72 |
-
#
|
73 |
context_en = """
|
74 |
Donald Trump was the 45th president of the United States, serving from 2017 to 2021.
|
75 |
"""
|
@@ -80,22 +61,20 @@ result_en = question_answerer(question=question_en, context=context_en)
|
|
80 |
print("Answer:", result_en['answer'])
|
81 |
```
|
82 |
|
83 |
-
##
|
84 |
|
85 |
-
|
86 |
|
87 |
-
##
|
88 |
|
89 |
-
|
90 |
|
91 |
```
|
92 |
-
@misc{
|
93 |
-
author = {
|
94 |
-
title = {
|
95 |
year = {2024},
|
96 |
-
publisher = {Hugging Face},
|
97 |
-
howpublished = {Hugging Face Model Repository},
|
98 |
url = {https://huggingface.co/real-jiakai/my_awesome_qa_model},
|
99 |
-
|
100 |
}
|
101 |
```
|
|
|
1 |
+
---
|
2 |
+
library_name: transformers
|
3 |
+
license: mit
|
4 |
+
base_model: distilbert-base-uncased
|
5 |
+
tags:
|
6 |
+
- question-answering
|
7 |
+
- distilbert
|
8 |
+
- squad
|
9 |
+
- fine-tuning
|
10 |
+
datasets:
|
11 |
+
- squad
|
12 |
+
model-index:
|
13 |
+
- name: my_awesome_qa_model
|
14 |
+
results:
|
15 |
+
- task:
|
16 |
+
type: question-answering
|
17 |
+
name: Question Answering
|
18 |
+
dataset:
|
19 |
+
name: SQuAD v1.1
|
20 |
+
type: squad
|
21 |
+
split: validation
|
22 |
+
metrics:
|
23 |
+
- name: Exact Match
|
24 |
+
type: exact_match
|
25 |
+
value: Please fill in your EM score
|
26 |
+
- name: F1 Score
|
27 |
+
type: f1
|
28 |
+
value: Please fill in your F1 score
|
29 |
+
language:
|
30 |
+
- en
|
31 |
+
---
|
|
|
|
|
32 |
|
33 |
# my_awesome_qa_model
|
34 |
|
35 |
+
This model is a fine-tuned version of [distilbert-base-uncased](https://huggingface.co/distilbert-base-uncased), trained on the [SQuAD v1.1 dataset](https://huggingface.co/datasets/squad).
|
36 |
|
37 |
+
It achieved the following results on the validation set:
|
38 |
|
39 |
+
- **Loss**: 1.7489
|
40 |
|
41 |
+
## How to Use
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
```python
|
44 |
from transformers import pipeline
|
45 |
|
46 |
+
# Load the model
|
47 |
question_answerer = pipeline(
|
48 |
"question-answering",
|
49 |
model="real-jiakai/my_awesome_qa_model",
|
50 |
tokenizer="real-jiakai/my_awesome_qa_model"
|
51 |
)
|
52 |
|
53 |
+
# English example
|
54 |
context_en = """
|
55 |
Donald Trump was the 45th president of the United States, serving from 2017 to 2021.
|
56 |
"""
|
|
|
61 |
print("Answer:", result_en['answer'])
|
62 |
```
|
63 |
|
64 |
+
## License
|
65 |
|
66 |
+
This model is licensed under the [MIT](https://opensource.org/license/mit) License.
|
67 |
|
68 |
+
## Citation
|
69 |
|
70 |
+
If you use this model in your work, please cite:
|
71 |
|
72 |
```
|
73 |
+
@misc{my_awesome_qa_model,
|
74 |
+
author = {real-jiakai},
|
75 |
+
title = {my_awesome_qa_model},
|
76 |
year = {2024},
|
|
|
|
|
77 |
url = {https://huggingface.co/real-jiakai/my_awesome_qa_model},
|
78 |
+
publisher = {Hugging Face}
|
79 |
}
|
80 |
```
|