public class EntityExtractionResourceBuilder extends Object
YagoEntityCandidateFinderFactory.YagoEntityCandidateFinder
,
YagoEntityContextScorerFactory.YagoEntityContextScorer
and YagoEntityExactMatcherFactory.YagoEntityExactMatcher
. These
resources are a text File of entity aliases, and a lucene index of contextual
data.
The directory of the stripped down Yago tsv files is required. This directory
can be built with SeedBuilder
.Modifier and Type | Class and Description |
---|---|
static class |
EntityExtractionResourceBuilder.StreamLooper
Helper class to iterate through the lines of a Reader to do a bit of work
on each.
|
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_ALIAS_NAME
Default file name for the alias text file.
|
static String |
DEFAULT_CONTEXT_NAME
Default directory name for the lucene index.
|
Constructor and Description |
---|
EntityExtractionResourceBuilder() |
Modifier and Type | Method and Description |
---|---|
void |
buildAll(String seedDirectoryPath)
Builds the alias text file and the lucene index in the default root
directory.
|
void |
buildAll(String seedDirectoryPath,
String destinationPath)
Builds the alias text file and the lucene index in the specified root
directory.
|
void |
buildCandidateAliasFile(String seedDirectoryPath)
Builds the alias text file in the default location.
|
void |
buildCandidateAliasFile(String seedDirectoryPath,
String destinationPath)
Builds the alias text file in the specified location.
|
void |
buildContextLuceneIndex(String seedDirectoryPath)
Builds the lucene index in the default path.
|
void |
buildContextLuceneIndex(String seedDirectoryPath,
String destinationPath)
Builds the lucene index at the specified path.
|
static String |
getAliasFrom(String rootName) |
static String |
getDefaultAliasFilePath() |
static String |
getDefaultIndexDirectoryPath() |
static String |
getDefaultRootPath() |
static void |
main(String[] args)
Defualt main.
|
static BufferedReader |
openFileAsReadStream(String path) |
static BufferedWriter |
openFileAsWriteStream(String path) |
public static String DEFAULT_ALIAS_NAME
public static String DEFAULT_CONTEXT_NAME
public EntityExtractionResourceBuilder()
public void buildCandidateAliasFile(String seedDirectoryPath)
seedDirectoryPath
- = path location of the stripped down Yago .tsv files.public void buildCandidateAliasFile(String seedDirectoryPath, String destinationPath)
seedDirectoryPath
- = path location of the stripped down Yago .tsv files.destinationPath
- = path to build the alias text file.public void buildContextLuceneIndex(String seedDirectoryPath)
seedDirectoryPath
- = path location of the stripped down Yago .tsv files.public void buildContextLuceneIndex(String seedDirectoryPath, String destinationPath)
seedDirectoryPath
- destinationPath
- public void buildAll(String seedDirectoryPath)
seedDirectoryPath
- public void buildAll(String seedDirectoryPath, String destinationPath)
seedDirectoryPath
- destinationPath
- public static String getDefaultRootPath()
public static String getDefaultAliasFilePath()
public static String getDefaultIndexDirectoryPath()
public static String getAliasFrom(String rootName)
public static BufferedReader openFileAsReadStream(String path) throws FileNotFoundException
FileNotFoundException
public static BufferedWriter openFileAsWriteStream(String path) throws IOException
IOException