public class SemWeb2NLVerbalizer extends Object implements BVerbalizer, Comparator<org.aksw.gerbil.transfer.nif.data.NamedEntity>
| Modifier and Type | Field and Description |
|---|---|
private static HashSet<String> |
BLACKLISTED_PROPERTIES |
private TripleConverter |
converter |
private org.dllearner.kb.sparql.SparqlEndpoint |
endpoint |
private static org.slf4j.Logger |
LOGGER |
private boolean |
usePronouns |
private boolean |
useSurfaceForms |
| Constructor and Description |
|---|
SemWeb2NLVerbalizer(org.dllearner.kb.sparql.SparqlEndpoint endpoint) |
SemWeb2NLVerbalizer(org.dllearner.kb.sparql.SparqlEndpoint endpoint,
boolean usePronouns,
boolean useSurfaceForms) |
| Modifier and Type | Method and Description |
|---|---|
private boolean |
annotateDocument(org.aksw.gerbil.transfer.nif.Document document,
org.apache.jena.rdf.model.Resource resource) |
private boolean |
annotateDocument(org.aksw.gerbil.transfer.nif.Document document,
org.apache.jena.rdf.model.Resource subject,
org.apache.jena.rdf.model.Resource object) |
private boolean |
annotateDocument(org.aksw.gerbil.transfer.nif.Document document,
org.apache.jena.rdf.model.Statement s) |
int |
compare(org.aksw.gerbil.transfer.nif.data.NamedEntity n1,
org.aksw.gerbil.transfer.nif.data.NamedEntity n2) |
org.aksw.gerbil.transfer.nif.Document |
generateDocument(List<org.apache.jena.rdf.model.Statement> triples,
String sfFilePath) |
private String |
getEnglishLabel(String resource) |
private String |
getGender(String uri) |
private Map<String,String> |
getLabelsForResources(org.apache.jena.rdf.model.Statement statements,
String sfFilePath) |
private String |
getSurfaceForm(String resource,
String sfFilePath) |
private String |
getType(String uri) |
static void |
main(String[] args) |
void |
replaceSubjectWithPronoun(org.aksw.gerbil.transfer.nif.Document document,
String subjectUri)
Replaces the first occurrence of the statements subject with a pronoun.
|
private org.aksw.gerbil.transfer.nif.Document |
replaceSubjectWithSurfaceForms(org.aksw.gerbil.transfer.nif.Document document,
org.apache.jena.rdf.model.Statement statements,
String sfFilePath) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcomparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongprivate static final org.slf4j.Logger LOGGER
private final TripleConverter converter
private final org.dllearner.kb.sparql.SparqlEndpoint endpoint
private final boolean usePronouns
private final boolean useSurfaceForms
public SemWeb2NLVerbalizer(org.dllearner.kb.sparql.SparqlEndpoint endpoint)
public SemWeb2NLVerbalizer(org.dllearner.kb.sparql.SparqlEndpoint endpoint,
boolean usePronouns,
boolean useSurfaceForms)
public org.aksw.gerbil.transfer.nif.Document generateDocument(List<org.apache.jena.rdf.model.Statement> triples, String sfFilePath)
generateDocument in interface BVerbalizerprivate boolean annotateDocument(org.aksw.gerbil.transfer.nif.Document document,
org.apache.jena.rdf.model.Statement s)
public void replaceSubjectWithPronoun(org.aksw.gerbil.transfer.nif.Document document,
String subjectUri)
document - subjectUri - private org.aksw.gerbil.transfer.nif.Document replaceSubjectWithSurfaceForms(org.aksw.gerbil.transfer.nif.Document document,
org.apache.jena.rdf.model.Statement statements,
String sfFilePath)
throws IOException
IOExceptionprivate Map<String,String> getLabelsForResources(org.apache.jena.rdf.model.Statement statements, String sfFilePath) throws IOException
IOExceptionprivate String getSurfaceForm(String resource, String sfFilePath) throws IOException
IOExceptionprivate boolean annotateDocument(org.aksw.gerbil.transfer.nif.Document document,
org.apache.jena.rdf.model.Resource resource)
private boolean annotateDocument(org.aksw.gerbil.transfer.nif.Document document,
org.apache.jena.rdf.model.Resource subject,
org.apache.jena.rdf.model.Resource object)
public static void main(String[] args)
public int compare(org.aksw.gerbil.transfer.nif.data.NamedEntity n1,
org.aksw.gerbil.transfer.nif.data.NamedEntity n2)
compare in interface Comparator<org.aksw.gerbil.transfer.nif.data.NamedEntity>Copyright © 2020. All rights reserved.