Farjana Khan
unread,Mar 12, 2018, 9:55:55 AM3/12/18Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to DKPro Similarity Users
I got Similarity Score like this: NaN
My Code:
String text1= "i am going to school";
String text2= "i am going";
JCas JCas1 =JCasFactory.createJCas();
JCas1.setDocumentLanguage("en");
JCas1.setDocumentText(text1);
JCas JCas2 = JCasFactory.createJCas();
JCas2.setDocumentLanguage("en");
JCas2.setDocumentText(text2);
Annotation a1 = new Annotation(JCas1);
a1.setBegin(0);
a1.setEnd(text1.length());
Annotation a2 = new Annotation(JCas2);
a2.setBegin(0);
a2.setEnd(text2.length());
TypeTokenRatioComparator comparator=new TypeTokenRatioComparator();
double result = 0.0;
try {
result =comparator.getSimilarity( JCas1,JCas2,a1,a2);
} catch (SimilarityException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
system.out.print(result);
}
Here is take TypeTokenRatioComparator class.Could you give me some info what is the actual ?
actually i want get similarity by using this class. still now i have not clear info how to call
TypeTokenRatioComparator.getSimilarity(JCas jcas1, JCas jcas2, Annotation coveringAnnotation1,
Annotation coveringAnnotation2)
Please help me.....