zjunlp / KnowPrompt

[WWW 2022] KnowPrompt: Knowledge-aware Prompt-tuning with Synergistic Optimization for Relation Extraction
MIT License
191 stars 34 forks source link

code #21

Closed githubgtl closed 1 year ago

githubgtl commented 1 year ago

sorry to borther you,I have seen your paper and code, but I couldn't see any prompt method,I just see the relation between two entities have the different #perfermence from trditional relation perfermence.Is there any unseen code published?

njcx-ai commented 1 year ago

Hi, thanks for your attention on our paper. This paper proposes prompts based on entity relationship constraints (shorter), rather than large prompt words. The specific prompt words are spliced together with the input, and the specific format is shown in Figure 2 in the paper.

githubgtl commented 1 year ago

yes,i see your figure 2 in your paper , but your code seems to encode the relation directly,there is no connection between sentence and your relation structure

njcx-ai commented 1 year ago

You can refer to https://github.com/zjunlp/KnowPrompt/blob/5f1ce468c33d9d8f4067a3edd70bbf810bc5fff4/lit_models/transformer.py#L167C38-L167C38

githubgtl commented 1 year ago

OK ,thank you for your help

githubgtl commented 1 year ago

OK ,thank you for your help

githubgtl commented 1 year ago

If i want to change the model to apply chinese, I only change the model path and dataset, Right?

zxlzr commented 1 year ago

Yes, if your label is Chinese, you may also change the to use a Chinese verberlizer, just change the label words.

njcx-ai commented 1 year ago

Some fixed English prompts in the code should also need to be modified.