tag:blogger.com,1999:blog-22050725670575068252024-02-08T11:52:33.124-08:00Déductions SoftwareJean-Marc Vanelhttp://www.blogger.com/profile/10810879427512120091noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-2205072567057506825.post-27863351167016133872012-07-12T08:32:00.000-07:002012-07-12T08:44:25.684-07:00Trying FRED, a tool for producing RDF/OWL ontologies from natural language sentences<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div style="font-family: Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; margin-bottom: 1em; margin-top: 1em; padding: 0px;">
<cite>FRED - <a href="http://wit.istc.cnr.it/stlab-tools/fred" style="background-image: url(file:///home/jmv/jmv_ubuntu_11.4/jmvanel.free.fr/images/external.gif); background-position: 100% 50%; background-repeat: no-repeat no-repeat; color: blue; padding-right: 13px;">http://wit.istc.cnr.it/stlab-tools/fred</a> - </cite><cite>A tool for automatically producing RDF/OWL ontologies and linked data from natural language sentences, currently limited to English.</cite></div>
<div style="font-family: Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; margin-bottom: 1em; margin-top: 1em; padding: 0px;">
<cite>FRED is based on C&C [1] and Boxer [2], a NLP tool that transforms natural language text into a logical form compliant to Discourse Representation Theory. We process Boxer output and apply a set of heuristics and semantic transformations in order to obtain RDF designed for the Semantic Web. In this process, we emphasize the relation to linguistic frames, supporting FrameNet and VerbNet vocabularies, and to ontology design patterns.</cite></div>
<div style="font-family: Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; margin-bottom: 1em; margin-top: 1em; padding: 0px;">
</div>
<div style="font-family: Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; margin-bottom: 1em; margin-top: 1em; padding: 0px;">
<br /></div>
<div style="font-family: Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; margin-bottom: 1em; margin-top: 1em; padding: 0px;">
So I tried first some examples from <a href="http://attempto.ifi.uzh.ch/site/docs/ace_nutshell.html" style="background-image: url(file:///home/jmv/jmv_ubuntu_11.4/jmvanel.free.fr/images/external.gif); background-position: 100% 50%; background-repeat: no-repeat no-repeat; color: blue; padding-right: 13px;">ATTEMPTO ACE 6.6 in a Nutshell</a> :</div>
<div style="font-family: Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; margin-bottom: 1em; margin-top: 1em; padding: 0px;">
<cite>A customer inserts a card and the machine checks the code.</cite></div>
<div style="font-family: Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; margin-bottom: 1em; margin-top: 1em; padding: 0px;">
Not bad ! FRED uses this class and predicates :</div>
<div style="font-family: Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; margin-bottom: 1em; margin-top: 1em; padding: 0px;">
<<a href="http://www.ontologydesignpatterns.org/ont/dul/DUL.owl#Event" style="background-image: url(file:///home/jmv/jmv_ubuntu_11.4/jmvanel.free.fr/images/external.gif); background-position: 100% 50%; background-repeat: no-repeat no-repeat; color: blue; padding-right: 13px;">http://www.ontologydesignpatterns.org/ont/dul/DUL.owl#<b>Event</b></a>> .</div>
<div style="font-family: Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; margin-bottom: 1em; margin-top: 1em; padding: 0px;">
<<a href="http://www.ontologydesignpatterns.org/ont/vn/abox/role/agent" style="background-image: url(file:///home/jmv/jmv_ubuntu_11.4/jmvanel.free.fr/images/external.gif); background-position: 100% 50%; background-repeat: no-repeat no-repeat; color: blue; padding-right: 13px;">http://www.ontologydesignpatterns.org/ont/vn/abox/role/<b>agent</b></a>></div>
<div style="font-family: Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; margin-bottom: 1em; margin-top: 1em; padding: 0px;">
<<a href="http://www.ontologydesignpatterns.org/ont/vn/abox/role/theme" style="background-image: url(file:///home/jmv/jmv_ubuntu_11.4/jmvanel.free.fr/images/external.gif); background-position: 100% 50%; background-repeat: no-repeat no-repeat; color: blue; padding-right: 13px;">http://www.ontologydesignpatterns.org/ont/vn/abox/role/<b>theme</b></a>></div>
<div style="font-family: Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; margin-bottom: 1em; margin-top: 1em; padding: 0px;">
respectively for the sentence, the grammatical subject, and the direct complement.</div>
<div style="font-family: Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; margin-bottom: 1em; margin-top: 1em; padding: 0px;">
NOTE: The Options: "FrameNet roles NER Tìpalo WSD" do not have tooltips, so it's not easy to know what they mean.</div>
<div style="font-family: Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; margin-bottom: 1em; margin-top: 1em; padding: 0px;">
<br /></div>
<div style="font-family: Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; margin-bottom: 1em; margin-top: 1em; padding: 0px;">
</div>
<div style="font-family: Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; margin-bottom: 1em; margin-top: 1em; padding: 0px;">
<cite>A customer inserts a VisaCard or inserts a MasterCard, and inserts a code.</cite></div>
<div style="font-family: Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; margin-bottom: 1em; margin-top: 1em; padding: 0px;">
The disjunction (or) is not reflected at all in the output. Neither is the negation correctly represented:</div>
<div style="font-family: Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; margin-bottom: 1em; margin-top: 1em; padding: 0px;">
<cite>It is false that a customer inserts a card.</cite></div>
<div style="font-family: Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; margin-bottom: 1em; margin-top: 1em; padding: 0px;">
</div>
<div style="font-family: Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; margin-bottom: 1em; margin-top: 1em; padding: 0px;">
<br /></div>
<div style="font-family: Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; margin-bottom: 1em; margin-top: 1em; padding: 0px;">
Now I'll try an example of mine that works with EulerGUI:</div>
<div style="font-family: Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; margin-bottom: 1em; margin-top: 1em; padding: 0px;">
<cite>If a user U has-as-friend a person X, and has-as-friend a person Y, and X is not Y,</cite></div>
<div style="font-family: Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; margin-bottom: 1em; margin-top: 1em; padding: 0px;">
<cite>and X has-as-friend Z, and Y has-as-friend Z, and Z is not U</cite></div>
<div style="font-family: Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; margin-bottom: 1em; margin-top: 1em; padding: 0px;">
<cite>then Z is-a-proposed-friend-for U.</cite></div>
<div style="font-family: Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; margin-bottom: 1em; margin-top: 1em; padding: 0px;">
It's clear that the if-then structure is not understood. Even a simple sentence like this is wrong :</div>
<div style="font-family: Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; margin-bottom: 1em; margin-top: 1em; padding: 0px;">
<cite>If the code is valid then the ATM accepts the card.</cite></div>
<div style="font-family: Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; margin-bottom: 1em; margin-top: 1em; padding: 0px;">
FRED tries to be smart, and "thinks" that the ATM is a foaf:Organisation !</div>
</div>Jean-Marc Vanelhttp://www.blogger.com/profile/10810879427512120091noreply@blogger.com1tag:blogger.com,1999:blog-2205072567057506825.post-24499699894578247322012-07-12T08:31:00.000-07:002012-07-12T08:31:39.441-07:00Example with ACE Controled Natural Language => OWL => N3 rules<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<h2 style="text-align: -webkit-auto;">
Example with ACE Controled Natural Language => OWL => N3 rules</h2>
<div style="text-align: -webkit-auto;">
ATTEMPTO ACE is a Controled Natural Language, that is, a formal language but looking like normal english. It is usable as a modeling and specification language for EulerGUI framework.</div>
<div style="text-align: -webkit-auto;">
See : <a href="http://eulergui.svn.sourceforge.net/viewvc/eulergui/trunk/eulergui/html/documentation.html#L1038">Working with controlled (formal) english : ATTEMPTO ACE</a> ,</div>
<div style="text-align: -webkit-auto;">
<a href="http://eulergui.svn.sourceforge.net/viewvc/eulergui/trunk/eulergui/html/documentation.html#L6735">Overall diagrams</a></div>
<div style="text-align: -webkit-auto;">
</div>
<div style="text-align: -webkit-auto;">
Run APE in command line :</div>
<pre style="text-align: -webkit-auto;">% ape.exe -uri http://eulergui.sf.net/contact.owl -ulexfile <span class="IMPORTANT_CODE">foaf-lexicon.pl</span> -text '<strong>If P is a person that has-homepage something and has-current-project something then P is an n:interesting-contact .</strong>' -solo owlxml > <span class="IMPORTANT_CODE">interesting-contact2.owl</span></pre>
<div style="text-align: -webkit-auto;">
Run EulerGUI from command line, reading the OWL file just generated :</div>
<pre style="text-align: -webkit-auto;">eg <span class="IMPORTANT_CODE">interesting-contact2.owl</span> <a href="htpp://jmvanel.free.fr/jmv.rdf">htpp://jmvanel.free.fr/jmv.rdf</a></pre>
<div style="text-align: -webkit-auto;">
jmv.rdf is my FOAF profile on the Internet.</div>
<div style="text-align: -webkit-auto;">
<br /></div>
<div style="text-align: -webkit-auto;">
The translation of OWL into N3 is :</div>
<pre style="text-align: -webkit-auto;">@prefix ns2: <http://eulergui.sf.net/contact.owl#>.
{ ?VAR <http://xmlns.com/foaf/0.1/currentProject> ?t0.
?VAR <http://xmlns.com/foaf/0.1/homepage> ?t2.
?VAR a <http://xmlns.com/foaf/0.1/Person>
} => {
?VAR a ns2:interesting-contact}.</pre>
<div style="text-align: -webkit-auto;">
<br /></div>
<div style="text-align: -webkit-auto;">
Now click on the button to launch Drools engine. Since the URI <code><htpp://jmvanel.free.fr/jmv.rdf#me></code> ( that's me ) has a foaf:currentProjet and a foaf:homepage , it is inferred that he is an interesting-contact . To confirm this, one can either use the user Knowledge Base display in tools to see the whole KB. Or one can use the N3 shell to ask this query (just paste it with Ctrl-V) :</div>
<pre style="text-align: -webkit-auto;">?X a ns2:interesting-contact .</pre>
<div style="text-align: -webkit-auto;">
The answer appears at once :</div>
<pre style="text-align: -webkit-auto;"><http://jmvanel.free.fr/jmv.rdf#me> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://eulergui.sf.net/contact.owl#interesting-contact> .</pre>
<pre style="text-align: -webkit-auto;">
</pre>
<div style="text-align: -webkit-auto;">
</div>
<div style="text-align: -webkit-auto;">
<strong>Under the hood</strong></div>
<div style="text-align: -webkit-auto;">
There is a local lexicon file for ATTEMPTO APE : <a href="https://deductions.svn.sourceforge.net/svnroot/deductions/ape/foaf-lexicon.pl">foaf-lexicon.pl</a> , that tells how to verbalize the foaf concepts in english :</div>
<pre style="text-align: -webkit-auto;">cat foaf-lexicon.pl
tv_finsg('has-homepage' , iri('http://xmlns.com/foaf/0.1/homepage') ).
tv_infpl('have-homepage' , iri('http://xmlns.com/foaf/0.1/homepage') ).
tv_finsg('has-current-project' , iri('http://xmlns.com/foaf/0.1/currentProject') ).
tv_infpl('have-current-project' , iri('http://xmlns.com/foaf/0.1/currentProject') ).
noun_sg( person, iri('http://xmlns.com/foaf/0.1/Person'), neutr) .
noun_pl( persons, iri('http://xmlns.com/foaf/0.1/Person'), neutr) .</pre>
<pre style="text-align: -webkit-auto;">
</pre>
<div style="text-align: -webkit-auto;">
</div>
<div style="text-align: -webkit-auto;">
<strong>How to run the demonstration</strong></div>
<ol style="text-align: -webkit-auto;">
<li>install ATTEMPTO APE, see <a href="http://attempto.ifi.uzh.ch/site/downloads/">http://attempto.ifi.uzh.ch/site/downloads/</a></li>
<li>download <a href="https://deductions.svn.sourceforge.net/svnroot/deductions/ape/foaf-lexicon.pl">foaf-lexicon.pl</a> from the link</li>
<li>download EulerGUI , preferably the latest snapshot from <a href="http://sourceforge.net/projects/eulergui/files/eulergui/1.11/">http://sourceforge.net/projects/eulergui/files/eulergui/1.11/</a> ; that is an executable (Java) jarEulerGUI Manual is available from help menu</li>
<li>run commands as above</li>
</ol>
</div>Jean-Marc Vanelhttp://www.blogger.com/profile/10810879427512120091noreply@blogger.com0tag:blogger.com,1999:blog-2205072567057506825.post-82974234401184562732012-07-12T08:26:00.000-07:002012-07-12T08:26:43.820-07:00Wellcome to Déductions sofware blog !<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="http://deductions-software.com/">Déductions sofware</a> <span style="background-color: white;">is a service company dedicated to help you to build software that is more flexible, rigourous, and less costly .</span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;">To do so, we leverage on a set of collaborating Open Source tools :</span><br />
<br />
<ul style="text-align: left;">
<li><span style="background-color: white;">the Semantic Web technological stack</span></li>
<li><span style="background-color: white;">inference (rule) engines like Drools</span></li>
<li><span style="background-color: #66ffff; color: #000033; line-height: 20px; margin: 0px; padding: 0px; text-align: -webkit-auto; text-indent: 16px;">controled (formal) English (ATTEMPTO), to express </span><span style="background-color: #66ffff; color: #000033; line-height: 20px; text-align: -webkit-auto; text-indent: 16px;">the logic and business expertise</span><span style="background-color: #66ffff; color: #000033; line-height: 20px; margin: 0px; padding: 0px; text-align: -webkit-auto; text-indent: 16px;">. </span><span style="background-color: #66ffff; color: #000033; line-height: 20px; margin: 0px; padding: 0px; text-align: -webkit-auto; text-indent: 16px;">This formalism, human readable, expresses both the business rules, and the structuration into classes and properties.</span></li>
</ul>
</div>Jean-Marc Vanelhttp://www.blogger.com/profile/10810879427512120091noreply@blogger.com0