Update README.md
Browse files
README.md
CHANGED
@@ -6,6 +6,7 @@ library_name: transformers
|
|
6 |
pipeline_tag: text2text-generation
|
7 |
---
|
8 |
|
|
|
9 |
```python
|
10 |
import torch
|
11 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
@@ -13,7 +14,7 @@ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
|
13 |
tokenizer = AutoTokenizer.from_pretrained("yuyijiong/mt0-xl-bf16-sentiment-quadruple")
|
14 |
model = AutoModelForSeq2SeqLM.from_pretrained("yuyijiong/mt0-xl-bf16-sentiment-quadruple", device_map="auto", torch_dtype=torch.bfloat16)
|
15 |
|
16 |
-
text = '情感四元组(
|
17 |
input_ids = tokenizer(text,return_tensors="pt", padding=True)['input_ids'].cuda(0)
|
18 |
with torch.no_grad():
|
19 |
with torch.autocast('cuda'):
|
|
|
6 |
pipeline_tag: text2text-generation
|
7 |
---
|
8 |
|
9 |
+
抽取情感四元组、三元组、二元组等
|
10 |
```python
|
11 |
import torch
|
12 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
|
|
14 |
tokenizer = AutoTokenizer.from_pretrained("yuyijiong/mt0-xl-bf16-sentiment-quadruple")
|
15 |
model = AutoModelForSeq2SeqLM.from_pretrained("yuyijiong/mt0-xl-bf16-sentiment-quadruple", device_map="auto", torch_dtype=torch.bfloat16)
|
16 |
|
17 |
+
text = '情感四元组(对象,观点,方面,极性)抽取任务 (补全null): 【已经开了4袋,普遍出现米沾在包装上了,看起来放了很久的样子】'
|
18 |
input_ids = tokenizer(text,return_tensors="pt", padding=True)['input_ids'].cuda(0)
|
19 |
with torch.no_grad():
|
20 |
with torch.autocast('cuda'):
|