Package org.dbpedia.spotlight.model

Examples of org.dbpedia.spotlight.model.SpotlightFactory


    }

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

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



  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

  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 " +
        "President Obama said in a statement that the federal government had pledged its assistance." +
        "Raj Rajaratnam, the billionaire investor who once ran one of the world’s largest hedge funds, was found guilty on Wednesday of fraud and conspiracy by a federal jury in Manhattan. He is the most prominent figure convicted in the government’s crackdown on insider trading on Wall Street.\n" +
        "Mr. Rajaratnam, who was convicted on all 14 counts, could face as much as 19 and a half years in prison under federal sentencing guidelines, prosecutors said on Wednesday. (The law allows up to 25 years.) He is to be sentenced on July 29.\n" +
        "Mr. Rajaratnam, dressed in a black suit and a khaki green tie, had no expression as the verdict was read in the overflowing courtroom.\n" +
        "His lawyer, John Dowd, said he would appeal.\n" +
        "Prosecutors had asked that Mr. Rajaratnam be placed in custody, arguing that he was a flight risk. They said that he had the means to leave the country, noting that he owned property in Sri Lanka and Singapore.";

    words = Arrays.asList(
        luceneFactory.lingPipeFactory().getTokenizerFactoryInstance().tokenizer(text.toCharArray(), 0, text.length()).tokenize());
  }
View Full Code Here

            e.printStackTrace();
            System.err.println("\n"+ usage);
            System.exit(1);
        }
        // Set static annotator that will be used by Annotate and Disambiguate
        final SpotlightFactory factory  = new SpotlightFactory(configuration);
        setDisambiguators(factory.disambiguators());
        setSpotters(factory.spotters());
        setNamespacePrefix(configuration.getDbpediaResource());
        setSparqlExecuter(configuration.getSparqlEndpoint(), configuration.getSparqlMainGraph());
        setSimilarityThresholds(configuration.getSimilarityThresholds());

    }
View Full Code Here

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


    AnnotatedDatasetEnricherNGram annotatedDatasetEnricherNGram = new AnnotatedDatasetEnricherNGram(configuration);
    SpotlightFactory spotlightFactory = new SpotlightFactory(configuration);
   
    AnnotatedDataset trainingData = new AnnotatedDataset(
        new File("/Users/jodaiber/Documents/workspace/ba/BachelorThesis/01 Evaluation/02 Annotation/Software/custom/src/annotation/final.train.json"),
        AnnotatedDataset.Format.JSON, spotlightFactory);
    annotatedDatasetEnricherNGram.writeDatasetXRFF(trainingData, new File("/Users/jodaiber/Desktop/final.ngram.xrff"));
View Full Code Here

   * @param configuration SpotlightConfiguration to create a SpotlightFactory from
   * @throws IOException Error in reading annotation files.
   * @throws ConfigurationException Error in Configuration.
   */
  protected AnnotatedDatasetEnricher(SpotlightConfiguration configuration) throws IOException, ConfigurationException {
    spotlightFactory = new SpotlightFactory(configuration);
  }
View Full Code Here

  }

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

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

    AnnotatedDatasetEnricherUnigram annotatedDatasetEnricherUnigram = new AnnotatedDatasetEnricherUnigram(configuration);
    AnnotatedDataset trainingData = new AnnotatedDataset(
        new File("/Users/jodaiber/Documents/workspace/ba/BachelorThesis/01 Evaluation/02 Annotation/Software/custom/src/annotation/final.train.json"),
        AnnotatedDataset.Format.JSON, spotlightFactory);
View Full Code Here

TOP

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

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.