In order to accurately and quickly achieve relation extraction from few-shot emergency plan texts,KMKP based on knowledge prompts was proposed. First,a prompt template was constructed,utilizing learnable typed entity markers that incorporate relation semantics. The effectiveness of input guidance on the pre-trained language model (PLM) was thereby enhanced by these markers. Second,the boundary loss function was utilized to optimize model training,enabling the PLM to learn specific dependency relationships in the emergency domain and apply structured constraints to [MASK] predictions. Third,a gradient-free emergency knowledge storage database was created using the training data,and a knowledge retrieval mechanism was constructed by integrating KNN algorithm. The feature connections between training and prediction data can be captured through this mechanism and the gradient-free normation was used to correct the predictions of PLM. Finally,the experimental validation and analysis were performed using four public datasets under few-shot settings (1-,8-,and 16-shot). The results show that compared to the state-of-the-art model,KnowPrompt,F1 score is boosted by an average of 2.1%,2.8%,and 1.9% by KMKP. In a 16-shot emergency plan instance test,a relation extraction accuracy of 91.02% is achieved by KMKP. Catastrophic forgetting and overfitting issues in few-shot scenarios are effectively mitigated.
| 科 Family | 属数 Number of genus | 种数 Number of species | 占总种数比例 Percentage of total species (%) | 属 Genus | 种数 Number of species | 占总种数比例 Percentage of total species (%) |
|---|---|---|---|---|---|---|
| 鹅膏菌科Amanitaceae | 2 | 11 | 5.26 | 鹅膏菌属 Amanita | 10 | 4.78 |
| 小菇科 Mycenaceae | 2 | 12 | 5.74 | 丝盖伞属 Inocybe | 5 | 2.39 |
| 多孔菌科 Polyporaceae | 8 | 14 | 6.70 | 蜡蘑属 Laccaria | 5 | 2.39 |
| 红菇科 Russulaceae | 3 | 23 | 11.00 | 小皮伞属 Marasmius | 6 | 2.87 |
| 小菇属 Mycena | 11 | 5.26 | ||||
| 光柄菇属 Pluteus | 5 | 2.39 | ||||
| 红菇属 Russula | 17 | 8.13 | ||||
| 栓菌属 Trametes | 5 | 2.39 |