Package org.dbpedia.spotlight.spot.cooccurrence.training

Examples of org.dbpedia.spotlight.spot.cooccurrence.training.AnnotatedDataset


    //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:
     */
 
View Full Code Here


    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);

        LOG.info(String.format("Read %s annotations.",evaluationCorpus.getInstances().size()));


    /**
     * Base:
     */
    SelectorResult baseResult = getDatasetBaseResult(evaluationCorpus);
    LOG.info(baseResult);

        LOG.info("Reformatting.");
        Map<SurfaceFormOccurrence, AnnotatedSurfaceFormOccurrence> goldSurfaceFormOccurrences = new HashMap<SurfaceFormOccurrence, AnnotatedSurfaceFormOccurrence>();
    for(AnnotatedSurfaceFormOccurrence annotatedSurfaceFormOccurrence : evaluationCorpus.getInstances()) {
            SurfaceFormOccurrence sfo = annotatedSurfaceFormOccurrence.toSurfaceFormOccurrence();
            goldSurfaceFormOccurrences.put(sfo, annotatedSurfaceFormOccurrence);
            //goldSurfaceFormOccurrences.put(getNameVariation(sfo), annotatedSurfaceFormOccurrence);
        }
        List<Text> documents = evaluationCorpus.getTexts();


        evaluate(documents, goldSurfaceFormOccurrences, baseResult, lingPipeFactory, configuration);

        LOG.info("Done.");
View Full Code Here

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

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

    AnnotatedDataset evaluationCorpus =
        new AnnotatedDataset(new File(args[0]),
            AnnotatedDataset.Format.CSAW, spotlightFactory);

    int tp = 0, fp = 0, fn = 0;

    Set<DBpediaResourceOccurrence> goldAnnotations = evaluationCorpus.toDBpediaResourceOccurrences();
    writeAnnotations(spotlightFactory, evaluationCorpus,
        new File(args[1]));

    /**
     * Read all annotations made by a configuration of DBpedia Spotlight.
View Full Code Here

TOP

Related Classes of org.dbpedia.spotlight.spot.cooccurrence.training.AnnotatedDataset

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.