slczgwh / REDN

Downstream Model Design of Pre-trained Language Model for Relation Extraction Task
MIT License
95 stars 14 forks source link

WebNLG json #9

Closed wbaes closed 4 years ago

wbaes commented 4 years ago

Hi, I was trying to run this model on the WebNLG data, but receive a JSONdecodeError. Looking at the opennre/framework/dataloader.py in opennre, it seems that it only decodes the json format used for the other benchmarks in OpenNRE. So I'm wondering how you managed to train and test WebNLG, did you change the json format?

slczgwh commented 4 years ago

{"token": ["Alan", "Bean", ",", "who", "was", "part", "of", "Apollo", "12", ",", "was", "born", "in", "Wheeler", ",", "Texas", "on", "March", "15th", ",", "1932", "and", "is", "now", "retired", "."], "relation": "was a crew member of", "h": {"pos": [1, 2]}, "t": {"pos": [8, 9]}} {"token": ["Alan", "Bean", ",", "who", "was", "part", "of", "Apollo", "12", ",", "was", "born", "in", "Wheeler", ",", "Texas", "on", "March", "15th", ",", "1932", "and", "is", "now", "retired", "."], "relation": "birthPlace", "h": {"pos": [1, 2]}, "t": {"pos": [15, 16]}} {"token": ["Alan", "Bean", "is", "a", "citizen", "of", "the", "United", "State", "and", "graduated", "from", "UT", "Austin", "in", "1955", ".", "He", "was", "a", "crew", "member", "of", "Apollo", "12", "and", "is", "currently", "retired", "."], "relation": "was a crew member of", "h": {"pos": [1, 2]}, "t": {"pos": [24, 25]}} {"token": ["Alan", "Bean", "is", "a", "United", "States", "citizen", "born", "in", "Wheeler", ",", "Texas", "on", "15", "March", "1932", "and", "who", "graduated", "from", "UT", "Austin", "BS", "in", "1955", "."], "relation": "nationality", "h": {"pos": [1, 2]}, "t": {"pos": [5, 6]}} {"token": ["Alan", "Bean", "is", "a", "United", "States", "citizen", "born", "in", "Wheeler", ",", "Texas", "on", "15", "March", "1932", "and", "who", "graduated", "from", "UT", "Austin", "BS", "in", "1955", "."], "relation": "birthPlace", "h": {"pos": [1, 2]}, "t": {"pos": [11, 12]}}

slczgwh commented 4 years ago

We change it like this

wbaes commented 4 years ago

Okay, thanks