Search in sources :

Example 21 with Sentence

use of edu.stanford.nlp.simple.Sentence in project Info-Evaluation by TechnionYP5777.

the class AnalyzeParagraphTest method test8.

@Test
public void test8() {
    final Sentence sent = new Sentence("David Cassidy was arrested for driving under the influence on Jan 10 after he allegedly took a breathalyzer test and was found to be over twice the legal limit.\n");
    final TableTuple tt = new AnalyzeParagragh(sent, "2015").Analyze();
    assertEquals("David Cassidy", tt.getName());
    assertEquals("driving under influence", tt.getReason());
    assertEquals("01/10/2015", tt.getDate());
}
Also used : TableTuple(main.database.TableTuple) AnalyzeParagragh(main.Analyze.AnalyzeParagragh) Sentence(edu.stanford.nlp.simple.Sentence) Test(org.junit.Test)

Example 22 with Sentence

use of edu.stanford.nlp.simple.Sentence in project Info-Evaluation by TechnionYP5777.

the class AnalyzeParagraphTest method test11.

@Test
public void test11() {
    final Sentence sent = new Sentence("Juan Diego Fernandez was arrested for cheating by Axl Rose on Jan 25 1992 .");
    final TableTuple tt = new AnalyzeParagragh(sent, "1992").Analyze();
    assertEquals("Juan Diego Fernandez", tt.getName());
    assertEquals("01/25/1992", tt.getDate());
    assertEquals("cheating", tt.getReason());
}
Also used : TableTuple(main.database.TableTuple) AnalyzeParagragh(main.Analyze.AnalyzeParagragh) Sentence(edu.stanford.nlp.simple.Sentence) Test(org.junit.Test)

Example 23 with Sentence

use of edu.stanford.nlp.simple.Sentence in project Info-Evaluation by TechnionYP5777.

the class AnalyzeParagraphTest method test9.

@Test
public void test9() {
    final Sentence sent = new Sentence("Soulja Boy was arrested for possession of a loaded gun in Los Angeles on Jan 22.\n");
    final TableTuple tt = new AnalyzeParagragh(sent, "2015").Analyze();
    assertEquals("Soulja Boy", tt.getName());
    assertEquals("possession of gun", tt.getReason());
    assertEquals("01/22/2015", tt.getDate());
}
Also used : TableTuple(main.database.TableTuple) AnalyzeParagragh(main.Analyze.AnalyzeParagragh) Sentence(edu.stanford.nlp.simple.Sentence) Test(org.junit.Test)

Example 24 with Sentence

use of edu.stanford.nlp.simple.Sentence in project Info-Evaluation by TechnionYP5777.

the class InteractiveAnalyzeParagraphTest method test3.

@Test
public void test3() {
    final Sentence sent = new Sentence("Vin Diesel was arrested for furious driving on August 14, 2002 in California");
    final InteractiveTableTuple itt = new AnalyzeParagragh(sent, "2002").InteractiveAnalyze();
    assertEquals("Vin Diesel", itt.getName());
    assertEquals("08/14/2002", itt.getDate());
    for (ReasonPair ¢ : itt.getReasons()) System.out.println(¢.getReason() + " with probability: " + ¢.getProbability());
}
Also used : AnalyzeParagragh(main.Analyze.AnalyzeParagragh) ReasonPair(main.database.ReasonPair) Sentence(edu.stanford.nlp.simple.Sentence) InteractiveTableTuple(main.database.InteractiveTableTuple) Test(org.junit.Test)

Example 25 with Sentence

use of edu.stanford.nlp.simple.Sentence in project Info-Evaluation by TechnionYP5777.

the class InteractiveAnalyzeParagraphTest method test1.

@Test
public void test1() {
    final Sentence sent = new Sentence("Justin Bieber was arrested for drunk driving in Georgia on February 22, 2015 .");
    final InteractiveTableTuple itt = new AnalyzeParagragh(sent, "2015").InteractiveAnalyze();
    assertEquals("Justin Bieber", itt.getName());
    assertEquals("02/22/2015", itt.getDate());
    for (ReasonPair ¢ : itt.getReasons()) System.out.println(¢.getReason() + " with probability: " + ¢.getProbability());
}
Also used : AnalyzeParagragh(main.Analyze.AnalyzeParagragh) ReasonPair(main.database.ReasonPair) Sentence(edu.stanford.nlp.simple.Sentence) InteractiveTableTuple(main.database.InteractiveTableTuple) Test(org.junit.Test)

Aggregations

Sentence (edu.stanford.nlp.simple.Sentence)29 Test (org.junit.Test)18 AnalyzeParagragh (main.Analyze.AnalyzeParagragh)16 TableTuple (main.database.TableTuple)12 CoreLabel (edu.stanford.nlp.ling.CoreLabel)5 Span (edu.stanford.nlp.ie.machinereading.structure.Span)3 CoreMap (edu.stanford.nlp.util.CoreMap)3 SentenceField (edu.stanford.nlp.util.TSVSentenceIterator.SentenceField)3 ArrayList (java.util.ArrayList)3 List (java.util.List)3 CoreLabelTokenFactory (edu.stanford.nlp.process.CoreLabelTokenFactory)2 ScoredPassage (io.anserini.qa.passage.ScoredPassage)2 StringReader (java.io.StringReader)2 InteractiveTableTuple (main.database.InteractiveTableTuple)2 ReasonPair (main.database.ReasonPair)2 edu.stanford.nlp.classify (edu.stanford.nlp.classify)1 NERTag (edu.stanford.nlp.ie.KBPRelationExtractor.NERTag)1 IOUtils (edu.stanford.nlp.io.IOUtils)1 RuntimeIOException (edu.stanford.nlp.io.RuntimeIOException)1 CoreAnnotations (edu.stanford.nlp.ling.CoreAnnotations)1