Text relation extraction: Model testing
After model training is complete, go to the Model Hub, find the newly trained model, and click Publish. You can test the model after it is published.
Test text format
For text relation extraction models, you can input plain text for all model types except the UIE few-shot relation extraction model. This model has special requirements for the Content input format.
UIE few-shot text relation extraction
Input format for Content:
The input must be in JSON format. For example, to extract relations such as "Person-Place of Birth", "Person-Time of Birth", "Organization-Location", and "Organization-Founder", structure the input as shown in Example 1:
{
"content": "Henry Sims, born on March 27, 1990, in Baltimore, MD, is an American professional basketball player, a center for the NBA Philadelphia 76ers.",
"labels": [
["Person", ["Place of birth(Geographical location)", "Time of birth(Time)"]],
["Organization", ["Location(Geographical location)", "Founder(Person)"]]
]
}Alternatively, you can structure the input as shown in Example 2:
{
"content": "Henry Sims, born on March 27, 1990, in Baltimore, MD, is an American professional basketball player, a center for the NBA Philadelphia 76ers.",
"labels": [
["Person", "Place of birth(Geographical location)"],
["Person", "Time of birth(Time)"],
["Organization", "Location(Geographical location)"],
["Organization", "Founder(Person)"]
]
}On the model testing interface, you can test the model by uploading a file or entering text. The NLP Self-Learning Platform also lets you call the model using an API or a software development kit (SDK). For more information, see the API and SDK documentation.