olgaduchovny
commited on
Commit
•
c20426f
1
Parent(s):
3f0f342
Update README.md
Browse files
README.md
CHANGED
@@ -5,7 +5,8 @@ language:
|
|
5 |
tags:
|
6 |
- pytorch
|
7 |
- ner
|
8 |
-
-
|
|
|
9 |
|
10 |
inference: false
|
11 |
|
@@ -36,10 +37,23 @@ model = Model(
|
|
36 |
model_path_or_name="olgaduchovny/t5-base-ner-mit-movie",
|
37 |
tokenizer_path_or_name="olgaduchovny/t5-base-ner-mit-movie"
|
38 |
)
|
39 |
-
options = [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
instruction = "please extract entities and their types from the input sentence, " \
|
41 |
"all entity types are in options"
|
42 |
-
text = "
|
43 |
generation_kwargs = {
|
44 |
"num_beams": 2,
|
45 |
"max_length": 128
|
@@ -50,14 +64,5 @@ pred_spans = model.predict(
|
|
50 |
instruction=instruction,
|
51 |
options=options
|
52 |
)
|
53 |
-
>>> [(
|
54 |
-
```
|
55 |
-
|
56 |
-
## Prediction Sample
|
57 |
-
```
|
58 |
-
Sentence: The protest , which attracted several thousand supporters , coincided with the 18th anniversary of Spain 's constitution .
|
59 |
-
Instruction: please extract entities and their types from the input sentence, all entity types are in options
|
60 |
-
Options: ORG, PER, LOC
|
61 |
-
Prediction (raw text): Spain is a LOC.
|
62 |
-
Prediction (span): [(99, 104, 'LOC')]
|
63 |
-
```
|
|
|
5 |
tags:
|
6 |
- pytorch
|
7 |
- ner
|
8 |
+
- text generation
|
9 |
+
- seq2seq
|
10 |
|
11 |
inference: false
|
12 |
|
|
|
37 |
model_path_or_name="olgaduchovny/t5-base-ner-mit-movie",
|
38 |
tokenizer_path_or_name="olgaduchovny/t5-base-ner-mit-movie"
|
39 |
)
|
40 |
+
options = [
|
41 |
+
"ACTOR",
|
42 |
+
"AWARD",
|
43 |
+
"CHARACTER",
|
44 |
+
"DIRECTOR",
|
45 |
+
"GENRE",
|
46 |
+
"OPINION",
|
47 |
+
"ORIGIN",
|
48 |
+
"PLOT",
|
49 |
+
"QUOTE",
|
50 |
+
"RELATIONSHIP",
|
51 |
+
"SOUNDTRACK",
|
52 |
+
"YEAR"
|
53 |
+
]
|
54 |
instruction = "please extract entities and their types from the input sentence, " \
|
55 |
"all entity types are in options"
|
56 |
+
text = "are there any good romantic comedies out right now"
|
57 |
generation_kwargs = {
|
58 |
"num_beams": 2,
|
59 |
"max_length": 128
|
|
|
64 |
instruction=instruction,
|
65 |
options=options
|
66 |
)
|
67 |
+
>>> [(19, 36, 'GENRE'), (41, 50, 'YEAR')]
|
68 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|