-
Notifications
You must be signed in to change notification settings - Fork 1
Key Java Classes
Simplenlg is a simple Java class library, which does basic NLG lexicalisation and realisation; it is primarily designed for data-to-text applications. As seen previously, this package is required by the WYSIWYM package to generate feedback texts. This version of simpleNLG has been adapted to return lists of AnchorStrings, instead of concatenated Strings:
- AnchorString: contains a String and an Anchor. An Anchor is a mark attributes that have no value, and serve as locations where new object may be added. When clicked, the anchor reveals a pop-up menu showing types of objects permitted for the attribute.
- FeedbackText: holds the text (consisting of AnchorStrings) that the user sees and edits. Other classes can request the AnchorStrings one by one using next().
-
SemanticGraph: holds the information to be presented in natural language. Its nodes correspond to ontology individuals or data literals. Its edges correspond to properties. Its root node corresponds to the resource that is being uploaded, viewed or searched, which is the topic of the text. The semantic graph is a data structure that, coupled with the domain ontologies and their linguistic specifications, contains enough information to generate both RDF and natural language descriptions. Each module has its own type of semantic graph
-
SGNode is a node in the Semantic Graph. It has alphabetized lists of the incoming and outgoing nodes. Each type of SGNode represents a type of data literal (e.g. SGStringNode, SGDoubleNode). Each paragraph of the generated text corresponds to an individual, i.e. an SGNode in the semantic graph. That node is the topic of the paragraph, and the paragraph should contain all the information about it.
-
FeedbackTextGenerator: steers the process of turning the semantic graph into a feedback text. The FeedbackTextGenerator receives and checks any information the user adds through the interface, adds it to the semantic graph and regenerates the feedback text. It ensures that all anchors are up-to-date and that no information that is invalid for the domain ontologies can be added to the semantic graph.
-
OntologyReader: Contains a Jena model of the TBox statements, and contains methods to extract info about the structure of the ontology. Required by the FeedbackTextGenerator to read info from the ontology.
-
RDFReader: extracts existing ABox statements from the Sesame archive and presents it in the feedback text. (Jena class)
- Build the Semantic Graph Transformer (SGT) representing a list of RDF statements (
AutomaticGenerator.buildGraphFromSesameRepo()) - Create a new BrowsingGenerator from the SGT, sesameReader and ontologyReader
-
BrowsingGenerator.getSurfaceText(): Create a ContentPlanner which will lexicalise() each SGNode of the SGT by using the Language Specification files (see section about Lexicon). It returns a list ofDependencyTreeTransformerthat each represents one sentence in the text. - Create a
SurfaceRealiserand realize each<DependencyTreeTransformer>by using the simpleNLG package. This returns a List of AnchorString that together form the FeedbackText.
Therefore we have 2 different types of graphs:
- A Semantic Graph that corresponds to the RDF statements. Each predicate of those statement are represented by an edge in the graph. Each subject and object is represented by a node.
- A Dependency Tree graph that corresponds to the actual words that together form the generated text. This graph is generated by translating each elements of the Semantic Graph with its corresponding Language Specification file.


