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

Can this model give a knowledge graph according to the input sentence? #9

Closed
zysNLP opened this issue Oct 22, 2019 · 4 comments
Closed

Comments

@zysNLP
Copy link

zysNLP commented Oct 22, 2019

Can this model give a knowledge graph according to the input sentence?
Such as "One absolutely cardinal reason is the fact that universities offer an opportunity to intensify the knowledge in a particular field of interest."
Maybe this is a long sentence, I want to ask if our model has such a function?

@debjitpaul
Copy link

You can generate concepts (ConceptNet) or person's intention/motivation (Atomic) given a sentence (as it uses the pretrained-GPT). But, it was trained using transformer, therefore the length of the sentence is important. You can check there pretained model and also play a bit with the interactive model. COMET was trained to generate concept (for ConceptNet i.e., predict the concept given the concept and relation) or reactions and intention given a event. Size of the event or input concept do matter.

@atcbosselut
Copy link
Owner

As @debjitpaul alluded to, COMET is a neural knowledge base. In theory, you can use the method to generate a temporary knowledge graph for any sequence. You're only limited by what the maximum event length for the model is. For this particular codebase, I believe the maximum sentence length COMET takes in is 17 tokens because that's the maximum length of an event in ATOMIC.

You can definitely play around with setting a different max size for the input here:

self.max_event = max([max([l[0] for l in self.masks[split]["total"]])

which should allow you to train models that have larger input contexts. Or you can split larger sentences into smaller phrases. Even if the neural knowledge base can handle longer contexts, you're going to get less accurate information if the input has a lot of unnecessary details.

You can also use interactive mode to try out custom contexts less than 17 tokens long or play with the demo here: https://mosaickg.apps.allenai.org/

@atcbosselut
Copy link
Owner

I'd also mention that ConceptNet COMET may also behave differently because it is trained on shorter incomplete phrases.

@guotong1988
Copy link

Same question. Thank you.

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

4 participants