hanaml.Get.Related.Term.Rd
hanaml.Get.Related.Term is a R wrapper for SAP SAP HANA Text Mining get related term algorithm.
hanaml.Get.Related.Term(
pred.data,
ref.data = NULL,
top = NULL,
threshold = NULL,
lang = NULL
)
DataFrame
The prediction data for classification.
DataFrame, optional
The reference data for classification.
Defaults to NULL.
integer, optional
Only show top N results. If 0, it shows all.
Defaults to 0.
double, optional
Only the results which score bigger than this value will be put into the result table.
c('EN', 'DE', 'ES', 'FR', 'RU'), optional
Specify the language type. HANA cloud instance currently supports 'EN', 'DE', 'ES', 'FR' and 'RU'.
If NULL, it will do the auto detection.
Defaults to NULL.
DataFrame
DataFrame of get related doc result.
Input DataFrame data:
> ref_df$Collect()
ID CONTENT CATEGORY
1 doc1 term1 term2 term2 term3 term3 term3 CATEGORY_1
2 doc2 term2 term3 term3 term4 term4 term4 CATEGORY_1
3 doc3 term3 term4 term4 term5 term5 term5 CATEGORY_2
4 doc4 term3 term4 term4 term5 term5 term5 term5 term5 term5 CATEGORY_2
5 doc5 term4 term6 CATEGORY_3
6 doc6 term4 term6 term6 term6 CATEGORY_3
> pred_df$Collect()
CONTENT
1 term3
Call the function:
> result <- hanaml.Get.Related.Term(pred_df, ref_df)
Output:
> result$Collect()
ID SCORE
1 term2 0.923760
2 term1 0.774597
3 term4 0.550179
4 term5 0.346410