|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--KEAKeyphraseExtractor
Extracts keyphrases from the documents in a given directory. Assumes that the file names for the documents end with ".txt". Puts extracted keyphrases into corresponding files ending with ".key" (if those are not already present). Optionally an encoding for the documents/keyphrases can be defined (e.g. for Chinese text). Documents for which ".key" exists, are used for evaluation. Valid options are:
-l "directory name"
Specifies name of directory.
-m "model name"
Specifies name of model.
-e "encoding"
Specifies encoding.
-n
Specifies number of phrases to be output (default: 5).
-d
Turns debugging mode on.
-a
Also write stemmed phrase and score into ".key" file.
Constructor Summary | |
KEAKeyphraseExtractor()
|
Method Summary | |
java.util.Hashtable |
collectStems()
Collects the stems of the file names. |
void |
extractKeyphrases(java.util.Hashtable stems)
Builds the model from the files |
boolean |
getAdditionalInfo()
Get the value of AdditionalInfo. |
boolean |
getDebug()
Get the value of debug. |
java.lang.String |
getDirName()
Get the value of dirName. |
java.lang.String |
getEncoding()
Get the value of encoding. |
java.lang.String |
getModelName()
Get the value of modelName. |
int |
getNumPhrases()
Get the value of numPhrases. |
java.lang.String[] |
getOptions()
Gets the current option settings. |
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options. |
void |
loadModel()
Loads the extraction model from the file. |
static void |
main(java.lang.String[] ops)
The main method. |
void |
setAdditionalInfo(boolean newAdditionalInfo)
Set the value of AdditionalInfo. |
void |
setDebug(boolean newdebug)
Set the value of debug. |
void |
setDirName(java.lang.String newdirName)
Set the value of dirName. |
void |
setEncoding(java.lang.String newencoding)
Set the value of encoding. |
void |
setModelName(java.lang.String newmodelName)
Set the value of modelName. |
void |
setNumPhrases(int newnumPhrases)
Set the value of numPhrases. |
void |
setOptions(java.lang.String[] options)
Parses a given list of options controlling the behaviour of this object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public KEAKeyphraseExtractor()
Method Detail |
public boolean getAdditionalInfo()
public void setAdditionalInfo(boolean newAdditionalInfo)
newAdditionalInfo
- Value to assign to AdditionalInfo.public int getNumPhrases()
public void setNumPhrases(int newnumPhrases)
newnumPhrases
- Value to assign to numPhrases.public boolean getDebug()
public void setDebug(boolean newdebug)
newdebug
- Value to assign to debug.public java.lang.String getEncoding()
public void setEncoding(java.lang.String newencoding)
newencoding
- Value to assign to encoding.public java.lang.String getModelName()
public void setModelName(java.lang.String newmodelName)
newmodelName
- Value to assign to modelName.public java.lang.String getDirName()
public void setDirName(java.lang.String newdirName)
newdirName
- Value to assign to dirName.public void setOptions(java.lang.String[] options) throws java.lang.Exception
-l "directory name"
Specifies name of directory.
-m "model name"
Specifies name of model.
-e "encoding"
Specifies encoding.
-n
Specifies number of phrases to be output (default: 5).
-d
Turns debugging mode on.
-a
Also write stemmed phrase and score into ".key" file.
setOptions
in interface weka.core.OptionHandler
options
- the list of options as an array of strings
java.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface weka.core.OptionHandler
public java.util.Enumeration listOptions()
listOptions
in interface weka.core.OptionHandler
public java.util.Hashtable collectStems() throws java.lang.Exception
java.lang.Exception
public void extractKeyphrases(java.util.Hashtable stems) throws java.lang.Exception
java.lang.Exception
public void loadModel() throws java.lang.Exception
java.lang.Exception
public static void main(java.lang.String[] ops)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |