Package org.dbpedia.spotlight.model

Examples of org.dbpedia.spotlight.model.SpotlightConfiguration


*/
public class SpotterEvaluator {

  public static void main(String[] args) throws IOException, ConfigurationException, JSONException, InitializationException, SpottingException, org.json.JSONException {

    SpotlightConfiguration configuration = new SpotlightConfiguration("conf/server.properties");

        LingPipeFactory lingPipeFactory = new LingPipeFactory(new File(configuration.getTaggerFile()), new IndoEuropeanSentenceModel());

    //AnnotatedDataset evaluationCorpus = new AnnotatedDataset(new File("/Users/jodaiber/Documents/workspace/ba/" +
    //    "BachelorThesis/01 Evaluation/02 Annotation/Software/custom/src/annotation/final.test.json"),
    //    AnnotatedDataset.Format.JSON, spotlightFactory);
//
    AnnotatedDataset evaluationCorpus =
        new AnnotatedDataset(new File("/home/pablo/eval/csaw/original"),
            AnnotatedDataset.Format.CSAW, lingPipeFactory);
   
    /**
     * Base:
     */
    SelectorResult baseResult = getDatasetBaseResult(evaluationCorpus);
    System.out.println(baseResult);


    /**
     * No selection:
     */
    Spotter spotter = new LingPipeSpotter(new File(configuration.getSpotterConfiguration().getSpotterFile()), configuration.getAnalyzer());
    SelectorResult spotterBaseResult = getSelectorResult(spotter, evaluationCorpus);
    spotterBaseResult.printResult(baseResult);
   
   
    /**
     * Advanced Spotter:
     */
    Spotter spotterWithSelector = SpotterWithSelector.getInstance(
        spotter,
        new CoOccurrenceBasedSelector(configuration.getSpotterConfiguration()),
        new LingPipeTaggedTokenProvider(lingPipeFactory)
    );

    SelectorResult selectorResultCoOc = getSelectorResult(spotterWithSelector, evaluationCorpus);
    selectorResultCoOc.printResult(baseResult);
View Full Code Here


  }

  public void setUp() throws Exception {
    super.setUp();

    SpotlightConfiguration configuration = new SpotlightConfiguration("conf/dev.properties");
        LingPipeFactory lingPipeFactory = new LingPipeFactory(new File(configuration.getTaggerFile()), new IndoEuropeanSentenceModel());

    lingPipeTaggedTokenProvider1 = new LingPipeTaggedTokenProvider(lingPipeFactory);
    lingPipeTaggedTokenProvider1.initialize(text1);

    lingPipeTaggedTokenProvider2 = new LingPipeTaggedTokenProvider(lingPipeFactory);
View Full Code Here

    }

    public void setUp() throws Exception {
        super.setUp();

    SpotlightFactory luceneFactory = new SpotlightFactory(new SpotlightConfiguration("conf/server.properties"));
    textUtil = luceneFactory.textUtil();
    }
View Full Code Here

        {
            LOG.error("server.properties is requested to continue...");
           return;
        }

        SpotlightConfiguration configuration = new SpotlightConfiguration(args[0]);


        int spotterNr = 0;

        switch(spotterNr) {
            case 0: {
                String openNLPDir = "/Users/jodaiber/Desktop/DBpedia/";
                SurfaceFormDictionary sfDictProbThresh3 = ExactSurfaceFormDictionary.fromLingPipeDictionary(dictionary, false);
                System.out.println("Dictionary size: " + sfDictProbThresh3.size());
                File stopwordsFile = new File(openNLPDir+"stopwords.txt");
                spotter = OpenNLPChunkerSpotter.fromDir(openNLPDir,configuration.getI18nLanguageCode(),sfDictProbThresh3,stopwordsFile);
                break;
            }
            case 1: {
                spotter = new LingPipeSpotter(dictionary, configuration.getAnalyzer());
                break;
            }
        }

View Full Code Here

    private final static Log LOG = LogFactory.getLog(SpotterEvaluatorPrecisionRecall.class);

  public static void main(String[] args) throws IOException, JSONException, ConfigurationException, InitializationException, org.json.JSONException {


    SpotlightConfiguration configuration = new SpotlightConfiguration("conf/dev.properties");

        LingPipeFactory lingPipeFactory = new LingPipeFactory(new File(configuration.getTaggerFile()), new IndoEuropeanSentenceModel());

        LOG.info("Reading gold standard.");
        AnnotatedDataset evaluationCorpus =
        new AnnotatedDataset(new File("/home/pablo/eval/csaw/original"),
            AnnotatedDataset.Format.CSAW, lingPipeFactory);
View Full Code Here

public class SpotterPerformanceEvaluator {


  public static void main(String[] args) throws InitializationException, ConfigurationException, IOException, JSONException, SpottingException {

    SpotlightConfiguration configuration = new SpotlightConfiguration("conf/server.properties");
    SpotlightFactory spotlightFactory = new SpotlightFactory(configuration);


    /**
     * Read test corpus:
     */

    BufferedReader bufferedReader = new BufferedReader(new FileReader(
        new File("/Users/jodaiber/Documents/workspace/ba/BachelorThesis/LaTeX/figures/performance/corpus.json")
    ));
    String jsonString = bufferedReader.readLine();
    JSONObject jsonObject = new JSONObject(jsonString);


    ///**
    // * No selection:
    // */
    Spotter spotter = new LingPipeSpotter(new File(configuration.getSpotterConfiguration().getSpotterFile()), configuration.getAnalyzer());
    //
    //extract(jsonObject, spotter);


    /**
     * Advanced Spotter:
     */
    Spotter spotterWithSelector = SpotterWithSelector.getInstance(
        spotter,
        new CoOccurrenceBasedSelector(configuration.getSpotterConfiguration()),
        spotlightFactory.taggedTokenProvider()
    );

    extract(jsonObject, spotterWithSelector);

View Full Code Here

  List<String> words;
  OccurrenceDataProviderSQL occurrenceDataProviderUnigram;

  public OccurrenceDataProviderSQLTest(String name) throws InitializationException, ConfigurationException {
        super(name);
        SpotlightConfiguration config = new SpotlightConfiguration("conf/server.properties");
    SpotlightFactory luceneFactory = new SpotlightFactory(config);


    OccurrenceDataProviderSQL.initialize(config.getSpotterConfiguration());
    occurrenceDataProviderUnigram = OccurrenceDataProviderSQL.getInstance();
    String text = "PLEASANT GROVE, Ala. — The death toll in five Southern states rose sharply Thursday morning " +
        "to nearly 200 after devastating storms ripped through the region, spawning a deadly tornado in " +
        "downtown Tuscaloosa, Ala., and leaving a trail of flattened homes and buildings in an area already " +
        "battered by storms. States of emergency have been declared from Alabama to Virginia, and " +
View Full Code Here

    private static void initByPropertiesFile(String configFileName) throws  InitializationException {

        //We are using the old-style configuration file:
        //Initialization, check values
        try {
            configuration = new SpotlightConfiguration(configFileName);
        } catch (Exception e) {
            e.printStackTrace();
            System.err.println("\n"+ usage);
            System.exit(1);
        }
View Full Code Here

  }

 
  public static void main(String[] args) throws ConfigurationException, IOException, JSONException, InitializationException {

    SpotlightConfiguration configuration = new SpotlightConfiguration("conf/server.properties");


    AnnotatedDatasetEnricherNGram annotatedDatasetEnricherNGram = new AnnotatedDatasetEnricherNGram(configuration);
    SpotlightFactory spotlightFactory = new SpotlightFactory(configuration);
   
View Full Code Here

    SpotlightConfiguration config = null;



    public OpenNLPSpottersTest() throws ConfigurationException {
        config = new SpotlightConfiguration("conf/dev.properties");
    }
View Full Code Here

TOP

Related Classes of org.dbpedia.spotlight.model.SpotlightConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.