Using S5 inside Drupal.
Olga Caprotti, University of Gothenburg Milen Chechev, Ontotext Ramona Enache, University of Gothenburg Meritxell Gonzalez, Universitat Politècnica de Catalunya Aarne Ranta, University of Gothenburg Jordi Saludes, Universitat Politècnica de Catalunya
MOLTO - Multilingual Online Translations is an EU project targeting the production of tools for high quality translations of online materials. The demo includes the ongoing work on using the grammar formalism GF with semantic web technologies for building an information retrieval system accessed via multilingual queries. The central result is a library for query primitives available in 5 languages that was furthermore used to develop queries for the PROTON ontology and for the biomedical patents domain. Further CNLs under consideration in MOLTO come from the domains of mathematics, business processes, and cultural heritage.
MOLTO deals with CNLs in two ways:
Java front-end to a GF service, modeled after the GF Webservice / GF Cloud Service
Documentation:
Starting (requires GF version 2012-11-14 or newer):
$ GF_RESTRICTED=yes gf --server=41297 --document-root `pwd`/document-root
(Might require the full path to the document-root directory.)
Note that the document root must contain a writeable subdirectory tmp
for the storage
commands to work.
See usage examples in tools/test_gfws.sh
.
JPGF could be another possible backend, but currently calls to it have not been implemented.
Testing against the locally running GF server.
$ mvn test
Building the jar-file.
$ mvn package -DskipTests
Building the website
$ mvn site
The Eclipse (or any other IDE) project files are not included in this repository. To generate the required Eclipse files, run:
$ mvn -Declipse.workspace=/home/yourname/workspace/ eclipse:configure-workspace
$ mvn eclipse:eclipse
Download the jar if building from source should fail:
PDF generated from the Landslide: http://www.molto-project.eu/sites/default/files/Lexicon_extraction_in_MO...
Raw markdown code below.
Krasimir Angelov, Lauri Carlson, Ramona Enache, Inari Listenmaa, Aarne Ranta, Shafqat Virk
Lexicon
Use cases
Monolingual
Multilingual
DictEng.gf: a_priori_Adv = mkAdv "a priori"; aardvark_N = mkN "aardvark" ; ab_initio_Adv = mkAdv "ab initio"; aback_Adv = mkAdv "aback"; abactinal_A = mkA "abactinal" ; abandon_V2 = mkV2 (mkV "abandon");
DictGer.gf: a_priori_Adv = mkAdv "a priori" ; aachener_N = reg2N "Aachener" "Aachener" masculine ; aal_N = reg2N "Aal" "Aale" masculine ; aalfang_N = reg2N "Aalfang" "Aalfänge" masculine ; aasvogel_N = reg2N "Aasvogel" "Aasvögel" masculine ; abaenderbar_A = regA "abänderbar" ;
DictEngGer.gf: abandon_V2 = dirV2 (irregV "verlassen" "verlasst" "verließ" "verließe" "verlassen" ); abase_V2 = dirV2 (irregV "erniedrigen" "erniedrigt" "erniedrigte" "erniedrigte" "erniedrigt"); abasement_N = mkN "Erniedrigung";
LinkedDictGer: brother_08111676_N = reg2N "Bruder" "Brüder" masculine ; brother_08112052_N = reg2N "Bruder" "Brüder" masculine ; brother_08112265_N = reg2N "Kamerad" "Kameraden" masculine ;
Option 1: All synonyms in abstract syntax
Include every combination of lemma and word sense
brother_08111676_N
brother_08112961_N
...
buddy_08112961_N
Important for parsing
Option 2: One synonym per word sense
Include only single word senses, one lemma represents
brother_08111676_N
brother_08112961_N
...
buddy_09877951_N
Enough for linearization purposes
term1:fi-koira-N_-_ont-Dog syn:frame "N" ; gf:lin "mkN str" ; term:hasDesignation exp1:fi-koira-N ; term:hasReferent ont0:Dog . term1:fi-aviomies-N_-_ont-Husband syn:frame "jonkun N" ; gf:lin "mkN2 (mkN str) (casePrep genitive)" ; term:hasDesignation exp1:fi-aviomies-N ; term:hasReferent ont0:Husband . term1:fi-kieltää-V_-_sem-Forbid syn:frame "V jotakuta olemasta" ; gf:lin "mkV2Vf (mkV str) (casePrep partitive) infElat" ; term:hasDesignation exp1:fi-kieltää-V ; term:hasReferent sem0:Forbid .
syn:frame and gf:lin
. The former is a user-friendly way to annotate valency, the latter is a GF constructor. They have a mapping
-->
syn:frame
: user-friendly way to annotate valencygf:lin
: GF constructorsyn:frame
to gf:lin
:[] gf:mapping [ syn:frame "N" ; gf:lin "mkN str" ] , [ syn:frame "jonkun N" ; gf:lin "mkN2 (mkN str) (casePrep genitive)" ], [ syn:frame "V jotakuta olemasta" ; gf:lin "mkV2Vf (mkV str) (casePrep partitive) infElat" ] .
ont_Dog = mkN "koira" ; ont_Husband = mkN2 (mkN "aviomies") (casePrep genitive) ; sem_Forbid = mkV2Vf (mkV "kieltää") (casePrep partitive) infElat ;
Work by Shafqat Mumtaz Virk and K. V. S. Prasad
Explanation of the graph:
Work by Krasimir Angelov, Aarne Ranta
How much do grammars leak? and Probabilistic Robust Parsing with Parallel Multiple Context-Free Grammars, submitted in COLING 2012 (not accepted)
Work by Ramona Enache
Ontology-based lexicon management in a multilingual translation system – a survey of use cases - PhD thesis, Chalmers/UGOT, forthcoming: Shafqat Virk, ___ - Conference papers
-->
Attachment | Size |
---|---|
Lexicon_extraction_in_MOLTO.pdf | 158.68 KB |
Contributors: Jordi Saludes, Ares Ribó, Sebastian Xambó, Olga Caprotti, Aarne Ranta, Krasimir Angelov, Ramona Enach, Adam Slaski, Thomas Hallgren, Shafqat Mumtaz Virk
.notes: Contributors for Fre, Rus?
Goal:
To provide mathematics in natural language in many natural languages.
Including interfacing with math software.
Contributors: Kaarel Kaljurand, Thomas Hallgren, Aarne Ranta, Jordi Saludes
The cloud services for mathematics provide linearization and parsing of mathematical text in many languages, as supported by the Mathematical Grammar Library.
Multilingual semantic wiki on mathematics
Exploitation scenarios: e.g. a browser plugin that, upon highlighting, translates the mathematical text, sends it to a computational engine, prompts the user for some decision, explains some symbol, searches in a mathematically meaningful way.
Contributors: Kaarel Kaljurand, Olga Caprotti, Jordi Saludes, Aarne Ranta, Ares Ribó
Running on ACE wiki here.
Mixed formula/natural lenguage rendering of mathematics.
Support for qualified variables in quantifiers:
Aimed at expressing theorem statements and exercises.
A predictive parser allows a contributor to construct a well-formed statement or exercise.
In English, Italian or Spanish.
Automatically rendered in the reader language.
A contributor is aware of ambiguous interpretations.
Ambiguities
Contributors: Ares Ribó, Jordi Saludes, Sebastian Xambó
Goal: Querying a Computer Algebra System by natural language.
.notes: This is also shown in the Query technologies flagship
A command line tool for computing using natural language and aural replies.
An embedded interface in the Sage notebook. Using natural language in a Sage cell by prefixing it with expressions like %english
.
Contributors: Ares Ribó, Olga Caprotti, Thomas Hallgren, Aarne Ranta, Jordi Saludes
Tools for:
Writing a problem.
The current prototype allows to state word problems of the following form:
Human (has or owns) (numeral or some) class
how many class does Human (have or own)?
where class is: animals, rabbits, cows, fruits, apples, etc. and Human: John or Mary.
in the languages: English, Swedish, Spanish and Catalan.
Classes and objects can be extended by adding entries to the WPEntities
module.
We considered two levels of discourse:
The plain language is for direct communication with the user, natural language;
The core language is for the reasoner to work with.
The fact that John has seven fruit is represented by the GF tree:
fromProp (E1owns john (gen Fruit n7))
and in Prolog by:
own(john, 7 * fruit)
while in core, it converts to the Prolog assertion:
p(X, fruit, own(john, X)) - 7 * unit(fruit)).
The latter is more suited to reasoning with it.
Conjunctions are disaggregated: namely
is converted into:
Questions make the unknown explicit in the core expressions:
is represented in plain as:
find(own(mary,apple))
and in core as:
find(X, apple, own(mary,X))
% abs:fromProp (E1owns john (gen Fruit n7))
% Eng:John has seven fruit .
p(X, fruit, own(john, X)) - 7 * unit(fruit).
% abs:fromProp (E1owns john (aplus (ConsAmount (gen Apple n2)
% (BaseAmount (some Orange) (gen Banana n3)))))
% Eng:John has two apples , some oranges and three bananas .
p(Y, apple, own(john, Y)) - 2 * unit(apple).
p(Z, banana, own(john, Z)) - 3 * unit(banana).
p(V, orange, own(john, V)) - some(orange).
% abs:fromQuestion (Q1owns john Orange)
% Eng:how many oranges does John have ?
find(W, orange, own(john, W)).
To process a given word problem, the student must construct a set of of statements in core language that model that given word problem.
The authoring interpreter saves a word problem in a Prolog file consisting of:
A GF abstract tree for the plain sentence of a problem. This is written as a Prolog comment.
Core statements in Prolog format that correspond to the plain expression.
When the dialog interpreter is started on a word problem file, the system uses the GF abstract lines to display the statement of the problem in the selected language.
Next, the student must go through a sequence of steps to have the problem correctly modeled by:
assigning variables to given data and to unknowns
discovering relations among the given data
stating equations involving these unknowns
Assigning variables
At the beginnig the student must choose variables to designate unknowns that are relevant to the problem.
This includes the target
unknowns (they appear as arguments of find
clauses) and expressions
like some apples.
Discovering relations
In this step the student has to combine information from different statements into new relations.
For example, decomposing the fruits that John has into the apples and bananas that John has.
Stating equations
In the next step, the student converts the relations uncovered in the previous step into numerical equations.
This step finishes when there are enough equations to determine the unknowns of the problem.
The system checks that the student's equations are consistent equations and are entailed by the problem information.
Final
At the last step, the system displays the solution for the unknowns of the problem and exits.
Attachment | Size |
---|---|
sage-wf.pdf | 28.17 KB |
wproblems-wf.pdf | 54.2 KB |
wiki-translations.png | 34.37 KB |
Existing background technologies
Every country that does not border a sea is a landlocked-country.
SubClassOf(
ObjectIntersectionOf(
:country
ObjectComplementOf(
ObjectSomeValuesFrom(
:border
:sea
)
)
)
:landlocked-country
)
Which country is a landlocked-country?
ObjectIntersectionOf(
:country
:landlocked-country
)
(Stable AceWiki: single language: OWL-compatible subset of ACE)
(Stable AceWiki: single grammar: OWL-compatible subset of ACE)
Syntactic vs semantic reasoning
(Stable AceWiki: single reasoner: OWL-reasoner with multiple implementations)
is based on the GF Webservice and the GF online editor.
This should be viewable nicely using S5 engine based purely on web technologies. It allows us to create presentations for our meetings directly as wiki pages, so they are archived and we need not duplicate efforts. The look will be consistent for all the users. Since we can also use other types of nodes (supposedly), we do the work only once by editing tasks, deliverables etc and then present it in a slideshow fashion. At least this should work in theory: in practice I just spent 2 hours debugging the Drupal S5 module.
BTW, Eric Meyer's S5 package is available on its own locally and works fine.
Presentations carve text up into sections based on HTML headings. The level of the heading is discarded, and the heading text itself is held apart as a title for the text.
The TOC is made by child pages.
Here again we try to add a new page to the presentation
Say I have a Prezi presentation, can I embed it?
Yes, apparently you need to select "FULL HTML" as the Input format for the Body of the node.
Generates a slideshow using the slides that power the html5-slides presentation.
A python
with the jinja2
, markdown
, and pygments
modules is required.
Here we show just how sample slides from the landslide distribution, written in the markdown format, can also be pushed to S5 to generate a slide presentation. MOLTO partners can check their slides by adding a new wiki page underneath here.
Sample slide src attached.
<p>
sslides.md
python render.py
presentation.html
.fx: foo bar
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean magna tellus, fermentum nec venenatis nec, dapibus id metus. Phasellus nulla massa, consequat nec tempor et, elementum viverra est. Duis sed nisl in eros adipiscing tempor.
Integer in dignissim ipsum. Integer pretium nulla at elit facilisis eu feugiat velit consectetur.
Donec risus tortor, dictum sollicitudin ornare eu, egestas at purus. Cras consequat lacus vitae lectus faucibus et molestie nisl gravida. Donec tempor, tortor in varius vestibulum, mi odio laoreet magna, in hendrerit nibh neque eu eros.
© é
Hello Gentlemen
Are you prepared to see beyond the veil of reason? - DeceasedCrab
First code block:
!python
while True:
print "Everything's gonna be allright"
Second code block:
!php
<?php exec('python render.py --help'); ?>
Third code block:
!xml
<?xml version="1.0" encoding="UTF-8"?>
<img src="madonna.jpg" alt='Foligno Madonna, by Raphael' />
This is Raphael's "Foligno" Madonna, painted in
1511–1512.
Another code block:
!java
if (markdown && isEasy()) {
return true;
}
An image:
Landslide can generate QR codes:
.qr: 450|http://github.com/adamzap/landslide
This is a slide with no heading. It works too.
This slide has presenter notes.
Press p
to open a new window for the presenter with its notes.
Hello from presenter notes
Attachment | Size |
---|---|
slides.md_.txt | 2.76 KB |