Datasets:
patriziobellan
commited on
Commit
•
e5ff948
1
Parent(s):
014889f
Update README.md
Browse files
README.md
CHANGED
@@ -124,16 +124,41 @@ To have a complete explanation of each process element tag please refer to the [
|
|
124 |
### Relations Extraction
|
125 |
- *document name*: a string used to represent the name of the document.
|
126 |
- *tokens*: a list of string representing the words of the document
|
127 |
-
- *tokens-IDs*: a list of interger representing the word position within a sentence
|
128 |
-
- *
|
129 |
-
- *
|
130 |
-
|
131 |
-
- *source-head-
|
132 |
-
- *
|
133 |
-
- *
|
134 |
-
- *target-head-
|
135 |
-
|
136 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
### Data Splits
|
138 |
|
139 |
The data was not splited. It contains the test set only.
|
|
|
124 |
### Relations Extraction
|
125 |
- *document name*: a string used to represent the name of the document.
|
126 |
- *tokens*: a list of string representing the words of the document
|
127 |
+
- *tokens-IDs*: a list of interger representing the word position within a sentence.
|
128 |
+
- *ner_tags*: a list of string representing the annotation for each word. (see ner-tags above)
|
129 |
+
- *sentence-IDs*: a list of interger representing the sentence number for each word of the document.
|
130 |
+
- *relations*:: a list of document relations.
|
131 |
+
- *source-head-sentence-ID*: a list of sentence ID pointing to the sentence number of the head (first token) of the source entity.
|
132 |
+
- *source-head-word-ID*: a list of token ID pointing to the word ID of the head (first token) of the source entity.
|
133 |
+
- *relation-type*: a list of relation tags.
|
134 |
+
- *target-head-sentence-ID*: a list of sentence ID pointing to the sentence number of the head (first token) of the target entity.
|
135 |
+
- *target-head-word-ID*: a list of token ID pointing to the word ID of the head (first token) of the target entity.
|
136 |
+
|
137 |
+
For instance, a relation is defined by the instances of *source-head-sentence-ID*, *source-head-word-ID*, *relation-type*, *target-head-sentence-ID*, and *target-head-word-ID* at the same index position.
|
138 |
+
In the following example, the first relation of the first document is shown:
|
139 |
+
```python
|
140 |
+
document_1=modelhub_dataset['test'][0]
|
141 |
+
relation = {
|
142 |
+
'source-head-sentence-ID': document_1['relations']['source-head-sentence-ID'][0],
|
143 |
+
'source-head-word-ID': document_1['relations']['source-head-word-ID'][0],
|
144 |
+
'relation-type': document_1['relations']['relation-type'][0],
|
145 |
+
'target-head-sentence-ID': document_1['relations']['target-head-sentence-ID'][0],
|
146 |
+
'target-head-word-ID': document_1['relations']['target-head-sentence-ID'][0],
|
147 |
+
}
|
148 |
+
print(relation)
|
149 |
+
```
|
150 |
+
the output is:
|
151 |
+
```python
|
152 |
+
{'relation-type': 'uses',
|
153 |
+
'source-head-sentence-ID': 1,
|
154 |
+
'source-head-word-ID': 4,
|
155 |
+
'target-head-sentence-ID': 1,
|
156 |
+
'target-head-word-ID': 1}
|
157 |
+
```
|
158 |
+
That means:
|
159 |
+
the entity in sentence number *1*, starting at the token position *4* has a *uses* relation with the entity in sentence number *1* starting at token position *1*
|
160 |
+
|
161 |
+
|
162 |
### Data Splits
|
163 |
|
164 |
The data was not splited. It contains the test set only.
|