Concernant Standford Postagger

OutOfCommon Messages postés 5 Date d'inscription samedi 2 mai 2015 Statut Membre Dernière intervention 19 mai 2015 - 19 mai 2015 à 12:35
Whismeril Messages postés 19040 Date d'inscription mardi 11 mars 2003 Statut Contributeur Dernière intervention 9 mai 2024 - 19 mai 2015 à 13:12
je veux avoir tous les noms, les verbes, les adjectifs,...(all parts of speech) à partir d'une phrase. c'est ma première utilisation de StandfordPostagger sous Eclipse le problème est qu'une exception est survenue :
Exception in thread "main" edu.stanford.nlp.io.RuntimeIOException: Unrecoverable error while loading a tagger model
at edu.stanford.nlp.tagger.maxent.MaxentTagger.readModelAndInit(MaxentTagger.java:770)
at edu.stanford.nlp.tagger.maxent.MaxentTagger.<init>(MaxentTagger.java:298)
at edu.stanford.nlp.tagger.maxent.MaxentTagger.<init>(MaxentTagger.java:263)
at standford.tagTextToFile.main(tagTextToFile.java:12)
Caused by: java.io.IOException: Unable to resolve "taggers/left3words-distsim-wsj-0-18.tagger" as either class path, filename or URL
at edu.stanford.nlp.io.IOUtils.getInputStreamFromURLOrClasspathOrFileSystem(IOUtils.java:481)
at edu.stanford.nlp.tagger.maxent.MaxentTagger.readModelAndInit(MaxentTagger.java:765)
... 3 more



Le code est :
package standford;

import java.io.*;
import edu.stanford.nlp.tagger.maxent.MaxentTagger;

public class tagTextToFile {

public static void main(String[] args) throws IOException,
ClassNotFoundException {
// Initialize the tagger

MaxentTagger tagger = new MaxentTagger(

"taggers/left3words-distsim-wsj-0-18.tagger");
// The sample string

String sample = "This is a sample text";

// The tagged string

String tagged = tagger.tagString(sample);

// Output the result

System.out.println(tagged);
}
}


peut quelqu'un m'expliquer!! merci

1 réponse

Whismeril Messages postés 19040 Date d'inscription mardi 11 mars 2003 Statut Contributeur Dernière intervention 9 mai 2024 656
19 mai 2015 à 13:12
Et bonjour?
0
Rejoignez-nous