Get field results
Command Description
Get the result of the specified field in the Information Extraction result
Command Prototype
sRet = Mage.ExtractTextExtractInfo(value,extractor,template_name,field_name,update_time,index,std_state)
Command parameter
parameter | mandatory | type | default value | Instructions |
---|---|---|---|---|
value | True | expression | value | Use the "Information Extraction" command to output the variable to and cycle through the value |
extractor | True | expression | {} | Select extractor for Information Extraction |
template_name | True | string | "" | Select a template for Information Extraction |
field_name | True | string | "" | Select output fields from the template |
update_time | True | string | "" | It cannot be modified. The version update time is obtained dynamically. If the version used is inconsistent with the Information Extraction result, a prompt will be given at runtime |
index | True | number | 0 | The index result of the same field in the specified template starts from 0. If it exceeds the index range, the process will be interrupted and an error will be reported |
std_state | True | boolean | False | If it is "No", the original value is taken; if it is "Yes", the Normalization value is taken |
Return result
SRet, Assign the result of running the command to this variable.
Run instance
/*********************************Get Field Name List***************************************
Command Prototype:
sRet = Mage.ExtractTextExtractInfo(value,{},"","","",0,false)
Input Parameters:
value -- Information extraction result. Note: The value obtained by using the output variable of the "Information Extraction" command and iterating through it.
extractor -- Extractor. Note: Select the extractor for information extraction (configuration includes Pubkey, Secret, Url, where Pubkey and Secret need to be obtained from the specified model in Mage).
template_name -- Template name. Note: Select the template for information extraction.
field_name -- Field name. Note: Select the output field in the template.
update_time -- Update time. Note: Cannot be modified, dynamically obtains the version update time. If it is inconsistent with the version used by the information extraction result, a runtime warning will be displayed.
index -- Specify result index. Note: Specify the index result of the same field in the template, starting from 0. Exceeding the index range will interrupt the process and report an error.
std_state -- Get normalized value. Note: When "No", get the original value; when "Yes", get the normalized value.
Output Parameter:
sRet -- The variable where the output of the function call will be saved.
Notes:
1. To use Mage, ensure network connectivity is available.
2. Mage has usage limits, pay attention to the remaining quota.
3. Can be used in combination with the text information extraction command.
********************************************************************************/
Dim arrayRet = ""
Dim sRet = ""
arrayRet = Mage.NLPTextExtract("The company's operating revenue last year was 300,000 yuan, showing a good trend. In addition, the after-tax net profit was 50,000 yuan, a year-on-year increase of 12% compared to before. The company has more than 30 doctors and 60 masters.",{"Pubkey":"8ffHXjLv0u6nFiYM6WorRchN","Secret":"USMv2z9fABExxeeNRyWpvZwVaKcVbmLO","Url":"https://mage.uibot.com.cn"},30000)
sRet = Mage.ExtractTextExtractInfo(arrayRet[0],{"Pubkey":Pubkey,"Secret":Secret,"Url":"https://mage.uibot.com.cn"},"Net Profit","After-tax Net Profit","2021-09-18 09:50:38",0,False)
TracePrint(sRet)