Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deriving values for e1 e2 #3

Open
ghost opened this issue May 10, 2018 · 2 comments
Open

deriving values for e1 e2 #3

ghost opened this issue May 10, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented May 10, 2018

Hi , I was able to get the classification label , based on the approach you suggested , But i am not able to figure out how to get the relation label ?

i inverted the labelsmapping and was able to pass all_predictions in an iterator , to get the labels out .

for prediction in all_predictions: labelsMapping = { 0:'Other', 1 : 'Message-Topic(e1,e2)', 2 :'Message-Topic(e2,e1)', 3 : 'Product-Producer(e1,e2)', 4 :'Product-Producer(e2,e1)', 5 : 'Instrument-Agency(e1,e2)', 6 :'Instrument-Agency(e2,e1)', 7 : 'Entity-Destination(e1,e2)', 8 : 'Entity-Destination(e2,e1)', 9 : 'Cause-Effect(e1,e2)', 10 : 'Cause-Effect(e2,e1)', 11 : 'Component-Whole(e1,e2)', 12 :'Component-Whole(e2,e1)', 13 : 'Entity-Origin(e1,e2)', 14 :'Entity-Origin(e2,e1)', 15 : 'Member-Collection(e1,e2)', 16 : 'Member-Collection(e2,e1)', 17 : 'Content-Container(e1,e2)', 18 : 'Content-Container(e2,e1)'} print(labelsMapping[int(prediction)])

but i am not able to figure out how to get into the values for effect e1, e2 etc .. could you help me out with this ?

@roomylee
Copy link
Owner

@neo2603 I'm really sorry, but I can not fully understand your question.
I understand that you want to know which words in the input sentence correspond to e1 and e2 of the predictive label, right?
For example, when model predicts a sentence "The company fabricates plastic chairs." as "Product-Producer(e2,e1)", do you wonder what is equivalent to e1, e2 in Product-Producer(e2,e1) ?

@roomylee
Copy link
Owner

roomylee commented May 15, 2018

@neo2603 Newly updated code might be helpful...

labelsMapping = {0: 'Other',

Here is new description about official evaluation of SemEval 2010 Task #8
https://github.com/roomylee/cnn-relation-extraction#evalutation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant