Spaces:
Paused
Paused
CountingMstar
commited on
Commit
β’
2914830
1
Parent(s):
e90a1b6
Update README.md
Browse files
README.md
CHANGED
@@ -82,4 +82,82 @@ You can load the trained model through the training process described above and
|
|
82 |
Thank you.
|
83 |
|
84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
82 |
Thank you.
|
83 |
|
84 |
|
85 |
+
---
|
86 |
+
# AI Tutor BERT (μΈκ³΅μ§λ₯ κ³ΌμΈ μ μλ BERT)
|
87 |
+
μ΄ λͺ¨λΈμ μΈκ³΅μ§λ₯(AI) κ΄λ ¨ μ©μ΄ λ° μ€λͺ
μ νμΈνλ(fine-tuning)ν BERT λͺ¨λΈμ
λλ€.
|
88 |
+
|
89 |
+
|
90 |
+
μ΅κ·Ό μΈκ³΅μ§λ₯μ κ΄ν κ΄μ¬μ΄ λμμ§λ©΄μ λ§μ μ¬λμ΄ μΈκ³΅μ§λ₯ κ΄λ ¨ μμ
λ° νλ‘μ νΈλ₯Ό μ§ννκ³ μμ΅λλ€. κ·Έλ¬λ μΈκ³΅μ§λ₯ κ΄λ ¨ λνμμμΌλ‘μ μ΄λ¬ν μμμ λΉν΄ μΈκ³΅μ§λ₯ μ΄λ³΄μλ€μ΄ μ μμλ€μ μ μλ μ μ©ν μλ£λ νμΉ μμ΅λλ€. λλΆμ΄ κ°μμ μμ€κ³Ό λΆμΌμ κ°μΈνλ κ°μ λν λΆμ‘±ν μν©μ΄μ΄μ λ§μ μ¬λλ€μ΄ μΈκ³΅μ§λ₯ νμ΅μ μμνκΈ° μ΄λ €μνκ³ μμ΅λλ€. μ΄λ¬ν λ¬Έμ λ₯Ό ν΄κ²°νκ³ μ, μ ν¬ νμ μΈκ³΅μ§λ₯ μ©μ΄ λλ©μΈμμ κ³ΌμΈ μ μλ μν μ νλ μΈμ΄λͺ¨λΈμ λ§λ€μμ΅λλ€. λͺ¨λΈμ μ’
λ₯, νμ΅ λ°μ΄ν°μ
, μ¬μ©λ² λ±μ΄ μλμ μ€λͺ
λμ΄ μμΌλ μμΈν μ½μ΄λ³΄μκ³ , κΌ μ¬μ©ν΄ 보μκΈ° λ°λλλ€.
|
91 |
+
|
92 |
+
|
93 |
+
## Model
|
94 |
+
https://huggingface.co/bert-base-uncased
|
95 |
+
|
96 |
+
|
97 |
+
λͺ¨λΈμ κ²½μ° μμ°μ΄ μ²λ¦¬ λͺ¨λΈ μ€ κ°μ₯ μ λͺ
ν Googleμμ κ°λ°ν BERTλ₯Ό μ¬μ©νμ΅λλ€. μμΈν μ€λͺ
μ μ μ¬μ΄νΈλ₯Ό μ°Έκ³ νμκΈ° λ°λλλ€. μ§μμλ΅μ΄ μ£ΌμΈ κ³ΌμΈ μ μλλ΅κ², BERT μ€μμλ μ§μμλ΅μ νΉνλ Question and Answering λͺ¨λΈμ μ¬μ©νμμ΅λλ€. λΆλ¬μ€λ λ²μ λ€μκ³Ό κ°μ΅λλ€.
|
98 |
+
```
|
99 |
+
from transformers import BertForQuestionAnswering
|
100 |
+
|
101 |
+
model = BertForQuestionAnswering.from_pretrained("bert-base-uncased")
|
102 |
+
```
|
103 |
+
|
104 |
+
## Dataset
|
105 |
+
### Wikipedia
|
106 |
+
https://en.wikipedia.org/wiki/Main_Page
|
107 |
+
### activeloop
|
108 |
+
https://www.activeloop.ai/resources/glossary/arima-models/
|
109 |
+
### Adrien Beaulieu
|
110 |
+
https://product.house/100-ai-glossary-terms-explained-to-the-rest-of-us/
|
111 |
+
|
112 |
+
|
113 |
+
```
|
114 |
+
Context: 'Feature engineering or feature extraction or feature discovery is the process of extracting features (characteristics, properties, attributes) from raw data. Due to deep learning networks, such as convolutional neural networks, that are able to learn features by themselves, domain-specific-based feature engineering has become obsolete for vision and speech processing. Other examples of features in physics include the construction of dimensionless numbers such as Reynolds number in fluid dynamics; then Nusselt number in heat transfer; Archimedes number in sedimentation; construction of first approximations of the solution such as analytical strength of materials solutions in mechanics, etc..'
|
115 |
+
|
116 |
+
Question: 'What is large language model?'
|
117 |
+
|
118 |
+
Answer: 'A large language model (LLM) is a type of language model notable for its ability to achieve general-purpose language understanding and generation.'
|
119 |
+
```
|
120 |
+
|
121 |
+
|
122 |
+
νμ΅ λ°μ΄ν°μ
μ μΈκ³΅μ§λ₯ κ΄λ ¨ λ¬Έλ§₯, μ§λ¬Έ, κ·Έλ¦¬κ³ μλ΅ μ΄λ κ² 3κ°μ§λ‘ ꡬμ±μ΄ λμ΄μμ΅λλ€. μλ΅(μ λ΅) λ°μ΄ν°λ λ¬Έλ§₯ λ°μ΄ν° μμ ν¬ν¨λμ΄ μκ³ , λ¬Έλ§₯ λ°μ΄ν°μ λ¬Έμ₯ μμλ₯Ό λ°κΏμ£Όμ΄ λ°μ΄ν°λ₯Ό μ¦κ°νμμ΅λλ€. μ§λ¬Έ λ°μ΄ν°λ μ£Όμ κ° λλ μΈκ³΅μ§λ₯ μ©μ΄λ‘ μ€μ νμ΅λλ€. μμ μμλ₯Ό 보μλ©΄ μ΄ν΄νμκΈ° νΈνμ€ κ²λλ€. μ΄ λ°μ΄ν° μλ 3300μ¬ κ°λ‘ data ν΄λμ pickle νμΌ ννλ‘ μ μ₯λμ΄ μκ³ , λ°μ΄ν°λ Wikipedia λ° λ€λ₯Έ μ¬μ΄νΈλ€μ μμ htmlμ μ΄μ©νμ¬ μΆμΆ λ° κ°κ³΅νμ¬ μ μνμμ΅λλ€. ν΄λΉ μΆμ²λ μμ κ°μ΅λλ€.
|
123 |
+
|
124 |
+
|
125 |
+
## Training and Result
|
126 |
+
https://github.com/CountingMstar/AI_BERT/blob/main/MY_AI_BERT_final.ipynb
|
127 |
+
|
128 |
+
|
129 |
+
νμ΅ λ°©μμ data ν΄λμ λ°μ΄ν°μ BERT Question and Answering λͺ¨λΈμ λΆμ΄μ μ§νλ©λλ€. μμΈν λͺ¨λΈ νμ΅ λ° μ¬μ©λ²μ μμ λ§ν¬μ μ€λͺ
λμ΄ μμ΅λλ€.
|
130 |
+
|
131 |
+
```
|
132 |
+
N_EPOCHS = 10
|
133 |
+
optim = AdamW(model.parameters(), lr=5e-5)
|
134 |
+
```
|
135 |
+
|
136 |
+
|
137 |
+
μν¬ν¬(epoch)λ 10μ μ¬μ©νμΌλ©°, μλ΄ μ΅ν°λ§μ΄μ Έμ λ¬λλ μ΄νΈλ 5e-5λ₯Ό μ¬μ©νμ΅λλ€.
|
138 |
+
|
139 |
+
|
140 |
+
|
141 |
+
<img src="https://github.com/CountingMstar/AI_BERT/assets/90711707/72142ff8-f5c8-47ea-9f19-1e6abb4072cd" width="500" height="400"/>
|
142 |
+
<img src="https://github.com/CountingMstar/AI_BERT/assets/90711707/2dd78573-34eb-4ce9-ad4d-2237fc7a5b1e" width="500" height="400"/>
|
143 |
+
|
144 |
+
|
145 |
+
κ²°κ³Όλ μ κ·Έλνλ€κ³Ό κ°μ΄ λ§μ§λ§ μν¬ν¬ κΈ°μ€ loss = 6.917126256477786, accuracy = 0.9819078947368421λ‘ μλΉν νμ΅μ΄ μ λ λͺ¨μ΅μ 보μ¬μ€λλ€.
|
146 |
+
|
147 |
+
|
148 |
+
|
149 |
+
## How to use?
|
150 |
+
|
151 |
+
|
152 |
+
```
|
153 |
+
model = torch.load("./models/AI_BERT_final_10.pth")
|
154 |
+
```
|
155 |
+
|
156 |
+
μ νμ΅ κ³Όμ μ ν΅ν΄ νμ΅λ λͺ¨λΈμ λΆλ¬μ μ¬μ©νμλ©΄ λ©λλ€.
|
157 |
+
|
158 |
+
|
159 |
+
κ°μ¬ν©λλ€.
|
160 |
+
|
161 |
+
|
162 |
+
|
163 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|