Search in sources :

Example 1 with LLMStringSim

use of edu.illinois.cs.cogcomp.sim.LLMStringSim in project cogcomp-nlp by CogComp.

the class LlmSimTest method llmNERSimTest.

@Ignore
@Test
public void llmNERSimTest() {
    String config = "config/test.configurations.properties";
    Metric llm = new LLMStringSim(config);
    String s1 = "Donald Trump turn off the light";
    String s2 = "Trump turn off the light";
    String s3 = "Shaoshi turn off the light";
    double score = llm.compare(s1, s2).score;
    double score2 = llm.compare(s1, s3).score;
    System.out.println(score + " " + score2);
    assert (score > score2);
}
Also used : Metric(edu.illinois.cs.cogcomp.sim.Metric) LLMStringSim(edu.illinois.cs.cogcomp.sim.LLMStringSim) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 2 with LLMStringSim

use of edu.illinois.cs.cogcomp.sim.LLMStringSim in project cogcomp-nlp by CogComp.

the class LlmSimTest method llmSimTest.

@Test
public void llmSimTest() {
    String config = "config/configurations.properties";
    Metric llm = new LLMStringSim(config);
    String s1 = "please turn on the light";
    String s2 = "please turn off the TV";
    String s3 = "please close the door";
    double score = llm.compare(s1, s2).score;
    double score2 = llm.compare(s1, s3).score;
    assert (score > score2);
}
Also used : Metric(edu.illinois.cs.cogcomp.sim.Metric) LLMStringSim(edu.illinois.cs.cogcomp.sim.LLMStringSim) Test(org.junit.Test)

Example 3 with LLMStringSim

use of edu.illinois.cs.cogcomp.sim.LLMStringSim in project cogcomp-nlp by CogComp.

the class LlmSimTest method llmphraseSimTest.

@Ignore
@Test
public void llmphraseSimTest() {
    String config = "config/test2.configurations.properties";
    Metric llm = new LLMStringSim(config);
    String s1 = "please turn off the light";
    String s2 = "please turn the light";
    String s3 = "please turn on the light";
    double score = llm.compare(s1, s2).score;
    double score2 = llm.compare(s1, s3).score;
    assert (score < score2);
}
Also used : Metric(edu.illinois.cs.cogcomp.sim.Metric) LLMStringSim(edu.illinois.cs.cogcomp.sim.LLMStringSim) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

LLMStringSim (edu.illinois.cs.cogcomp.sim.LLMStringSim)3 Metric (edu.illinois.cs.cogcomp.sim.Metric)3 Test (org.junit.Test)3 Ignore (org.junit.Ignore)2