US 12,288,027 B2
Text sentence processing method and apparatus, computer device, and storage medium
Zhiyuan Liu, Shenzhen (CN); Hao Peng, Shenzhen (CN); Tianyu Gao, Shenzhen (CN); Xu Han, Shenzhen (CN); Yankai Lin, Shenzhen (CN); Peng Li, Shenzhen (CN); Maosong Sun, Shenzhen (CN); and Jie Zhou, Shenzhen (CN)
Assigned to TENCENT TECHNOLOGY (SHENZHEN) COMPANY LIMITED, Shenzhen (CN)
Filed by Tencent Technology (Shenzhen) Company Limited, Shenzhen (CN)
Filed on Dec. 1, 2022, as Appl. No. 18/073,517.
Application 18/073,517 is a continuation of application No. PCT/CN2021/102688, filed on Jun. 28, 2021.
Claims priority of application No. 202010847425.1 (CN), filed on Aug. 21, 2020.
Prior Publication US 2023/0100376 A1, Mar. 30, 2023
Int. Cl. G06F 17/00 (2019.01); G06F 40/166 (2020.01); G06F 40/279 (2020.01); G06F 40/30 (2020.01)
CPC G06F 40/279 (2020.01) [G06F 40/166 (2020.01); G06F 40/30 (2020.01)] 20 Claims
OG exemplary drawing
 
1. A method for training a relationship extraction model performed by a computer device, the method comprising:
acquiring sample text sentences, the sample text sentences comprising entity pairs and relationship labels of the entity pairs;
extracting positive example sentence pairs and negative example sentence pairs from the sample text sentences according to the relationship labels, and performing positive-negative example sampling on the positive example sentence pairs and the negative example sentence pairs, to obtain a training set;
inputting the training set into a relationship extraction model to generate loss values, the loss values comprising a contrastive loss value, the contrastive loss value being used for representing a difference between a similarity of sentences in the positive example sentence pairs and a similarity of sentences in the negative example sentence pairs; and
adjusting parameters of the relationship extraction model according to the loss values, and returning to the operation of extracting positive example sentence pairs and negative example sentence pairs from the sample text sentences according to the relationship labels to perform iterative training until a training end condition is met, to obtain an updated relationship extraction model, the updated relationship extraction model being configured to identify an entity relationship of an entity pair in a text sentence.