Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# bert-base for KLUE Relation Extraction task.
|
2 |
+
Fine-tuned klue/bert-base using KLUE RE dataset.
|
3 |
+
- KLUE Official Webpage : https://klue-benchmark.com/
|
4 |
+
- KLUE Official Github : https://github.com/KLUE-benchmark/KLUE
|
5 |
+
- KLUE RE Github : https://github.com/ainize-team/klue-re-workspace
|
6 |
+
- Run KLUE RE on free GPU : <a href="https://ainize.ai/workspace/create?imageId=hnj95592adzr02xPTqss&git=https://github.com/ainize-team/klue-re-workspace">Ainize Workspace</a>
|
7 |
+
|
8 |
+
<br>
|
9 |
+
|
10 |
+
# Usage
|
11 |
+
<pre><code>
|
12 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
13 |
+
|
14 |
+
tokenizer = AutoTokenizer.from_pretrained("ainize/klue-bert-base-re")
|
15 |
+
model = AutoModelForSequenceClassification.from_pretrained("ainize/klue-bert-base-re")
|
16 |
+
|
17 |
+
# Add "<subj>", "</subj>" to both ends of the subject object and "<obj>", "</obj>" to both ends of the object object.
|
18 |
+
sentence = "<subj>์ํฅ๋ฏผ</subj>์ <obj>๋ํ๋ฏผ๊ตญ</obj>์์ ํ์ด๋ฌ๋ค."
|
19 |
+
|
20 |
+
encodings = tokenizer(sentence,
|
21 |
+
max_length=128,
|
22 |
+
truncation=True,
|
23 |
+
padding="max_length",
|
24 |
+
return_tensors="pt")
|
25 |
+
|
26 |
+
outputs = model(**encodings)
|
27 |
+
|
28 |
+
logits = outputs['logits']
|
29 |
+
|
30 |
+
preds = torch.argmax(logits, dim=1)
|
31 |
+
</code></pre>
|
32 |
+
|
33 |
+
# About us
|
34 |
+
- <a href="https://ainize.ai/teachable-nlp">Teachable NLP</a> - Train NLP models with your own text without writing any code
|
35 |
+
- <a href="https://ainize.ai/">Ainize</a> - Deploy ML project using free gpu
|