init
Browse files
README.md
CHANGED
|
@@ -33,6 +33,93 @@ An example of `test` of `nell` looks as follows.
|
|
| 33 |
}
|
| 34 |
```
|
| 35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
### Citation Information
|
| 37 |
```
|
| 38 |
@inproceedings{xiong-etal-2018-one,
|
|
|
|
| 33 |
}
|
| 34 |
```
|
| 35 |
|
| 36 |
+
## Statistics
|
| 37 |
+
|
| 38 |
+
- Entity Types
|
| 39 |
+
|
| 40 |
+
| entity_type | tail | head |
|
| 41 |
+
|:-------------------------|-------:|-------:|
|
| 42 |
+
| geopoliticallocation | 14 | 24 |
|
| 43 |
+
| crustacean | 25 | 11 |
|
| 44 |
+
| amphibian | 0 | 2 |
|
| 45 |
+
| criminal | 1 | 0 |
|
| 46 |
+
| arthropod | 41 | 32 |
|
| 47 |
+
| videogame | 0 | 4 |
|
| 48 |
+
| mlsoftware | 0 | 1 |
|
| 49 |
+
| animal | 30 | 97 |
|
| 50 |
+
| politician | 58 | 23 |
|
| 51 |
+
| organization | 2 | 32 |
|
| 52 |
+
| insect | 270 | 230 |
|
| 53 |
+
| coach | 245 | 1 |
|
| 54 |
+
| personmexico | 20 | 13 |
|
| 55 |
+
| personus | 6 | 1 |
|
| 56 |
+
| automobilemaker | 54 | 274 |
|
| 57 |
+
| chemical | 0 | 1 |
|
| 58 |
+
| astronaut | 1 | 0 |
|
| 59 |
+
| company | 147 | 1 |
|
| 60 |
+
| arachnid | 6 | 1 |
|
| 61 |
+
| software | 0 | 42 |
|
| 62 |
+
| biotechcompany | 11 | 0 |
|
| 63 |
+
| mammal | 0 | 23 |
|
| 64 |
+
| product | 0 | 62 |
|
| 65 |
+
| sportsgame | 0 | 74 |
|
| 66 |
+
| sport | 74 | 93 |
|
| 67 |
+
| agriculturalproduct | 0 | 87 |
|
| 68 |
+
| location | 2 | 0 |
|
| 69 |
+
| hobby | 0 | 10 |
|
| 70 |
+
| vehicle | 0 | 2 |
|
| 71 |
+
| director | 1 | 0 |
|
| 72 |
+
| planet | 1 | 0 |
|
| 73 |
+
| athlete | 59 | 34 |
|
| 74 |
+
| food | 0 | 4 |
|
| 75 |
+
| grain | 0 | 2 |
|
| 76 |
+
| politicianus | 360 | 352 |
|
| 77 |
+
| automobilemodel | 0 | 100 |
|
| 78 |
+
| coffeedrink | 0 | 11 |
|
| 79 |
+
| city | 161 | 42 |
|
| 80 |
+
| person | 96 | 14 |
|
| 81 |
+
| bodypart | 69 | 0 |
|
| 82 |
+
| female | 3 | 3 |
|
| 83 |
+
| journalist | 1 | 0 |
|
| 84 |
+
| geopoliticalorganization | 17 | 1 |
|
| 85 |
+
| visualizablescene | 3 | 3 |
|
| 86 |
+
| professor | 0 | 1 |
|
| 87 |
+
| reptile | 0 | 4 |
|
| 88 |
+
| drug | 0 | 1 |
|
| 89 |
+
| stateorprovince | 0 | 38 |
|
| 90 |
+
| beverage | 0 | 27 |
|
| 91 |
+
| school | 0 | 11 |
|
| 92 |
+
| county | 4 | 10 |
|
| 93 |
+
| male | 5 | 3 |
|
| 94 |
+
| celebrity | 2 | 4 |
|
| 95 |
+
| country | 317 | 27 |
|
| 96 |
+
| personaustralia | 5 | 4 |
|
| 97 |
+
| sportsteam | 0 | 295 |
|
| 98 |
+
| fruit | 0 | 1 |
|
| 99 |
+
| island | 0 | 1 |
|
| 100 |
+
| invertebrate | 43 | 14 |
|
| 101 |
+
| personnorthamerica | 3 | 1 |
|
| 102 |
+
| personeurope | 1 | 0 |
|
| 103 |
+
| vegetable | 0 | 8 |
|
| 104 |
+
| legume | 0 | 1 |
|
| 105 |
+
|
| 106 |
+
- Relation Types
|
| 107 |
+
|
| 108 |
+
| relation | relation |
|
| 109 |
+
|:-----------------------------------------------|-----------:|
|
| 110 |
+
| concept:agriculturalproductcamefromcountry | 140 |
|
| 111 |
+
| concept:animalsuchasinvertebrate | 415 |
|
| 112 |
+
| concept:athleteinjuredhisbodypart | 69 |
|
| 113 |
+
| concept:automobilemakerdealersincity | 178 |
|
| 114 |
+
| concept:automobilemakerdealersincountry | 96 |
|
| 115 |
+
| concept:geopoliticallocationresidenceofpersion | 143 |
|
| 116 |
+
| concept:politicianusendorsespoliticianus | 386 |
|
| 117 |
+
| concept:producedby | 213 |
|
| 118 |
+
| concept:sportschoolincountry | 103 |
|
| 119 |
+
| concept:sportsgamesport | 74 |
|
| 120 |
+
| concept:teamcoach | 341 |
|
| 121 |
+
|
| 122 |
+
|
| 123 |
### Citation Information
|
| 124 |
```
|
| 125 |
@inproceedings{xiong-etal-2018-one,
|
stats.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pandas as pd
|
| 2 |
+
from datasets import load_dataset
|
| 3 |
+
|
| 4 |
+
data = load_dataset("fewshot_link_prediction", "nell", split='test')
|
| 5 |
+
df = data.to_pandas()
|
| 6 |
+
|
| 7 |
+
print("\nEntity Types")
|
| 8 |
+
tail = df.groupby("tail_type")['relation'].count().to_dict()
|
| 9 |
+
head = df.groupby("head_type")['relation'].count().to_dict()
|
| 10 |
+
k = set(list(tail.keys()) + list(head.keys()))
|
| 11 |
+
df_types = pd.DataFrame([{"entity_type": _k, "tail": tail[_k] if _k in tail else 0, "head": head[_k] if _k in head else 0} for _k in k])
|
| 12 |
+
print(df_types.to_markdown(index=False))
|
| 13 |
+
|
| 14 |
+
print("\nRelation Types")
|
| 15 |
+
print(df.groupby("relation")['relation'].count().to_markdown())
|
| 16 |
+
|
| 17 |
+
|