[Attempto] Auto-discard notification

Kaarel Kaljurand kaljurand at gmail.com
Sun Apr 3 13:29:27 CEST 2016


Dear Phan Vo,

getting only half of the output indicates that on Windows the ACE
paragraph break (\n\n) is not handled correctly. (I don't have an
access to a Windows machine now, so I cannot check.) What characters
are in your test.txt file exactly (if you look at it with a
hexeditor)?

The ACE lexicon format is explained here:
http://attempto.ifi.uzh.ch/site/docs/ace_lexicon.html. It's a simple
Prolog-based format, i.e. you can load it into Prolog and explore it
with commands like:

$ swipl

?- ['lexicon/clex_lexicon.pl'].
true.

?- noun_sg(X, Y, Z).
X = 'VisaCard',
Y = 'visa-card',
Z = neutr ;
X = Y, Y = 'grown-up',
Z = human ;
X = Y, Y = 'persona-non-grata',
Z = human .
...

By default lexicon/clex_lexicon.pl is compiled into the parser. You
can replace it with a larger lexicon downloadable from
https://github.com/Attempto/Clex. Or you can create your own custom
lexicon.
You will have to recompile to make this lexicon part of ape.exe. To
ignore the build-in lexicon, use -noclex. To override the build-in
lexicon, use -ulextext or -ulexfile. (I've added a -ulexfile example
to https://github.com/Attempto/APE/blob/master/README.md)

My recommendation for using APE and custom lexicons.

1. Compile ape.exe with an empty lexicon, or use -noclex. The Clex is
good for demonstrating ACE on a large fragment of English, but it is
unlikely to be a good fit to any specific domain (that your
application is likely to deal with)
2. Run ape.exe in the HTTP mode, so that you can easily call it from
your favorite language
3. Represent the lexicon in your favorite format (JSON, CSV, XML),
i.e. a format that is most compatible with your application or lexicon
editor. What is important is that you maintain an efficient lookup
table "word form" -> "possible corresponding lexicon entries"
4. Write a simple converter from your lexicon representation to the
ACE lexicon format
5. Call APE only with small inputs (a single paragraph of ACE text at
a time) providing just the needed entries as part of ulextext (i.e. do
not create any temporary files just to call the parser). (In principle
you could also parse multiple paragraphs in parallel because the
meaning of an ACE text does not depend on the paragraph order, but
then you'd need to start multiple HTTP servers, because a single
server currently just runs a single worker, see the comment in ape.pl)
6. Combine the parse results in your application to reason about them further

(This approach is used by AceWiki and ACE View, so there is some
helper code in Java to convert lexicon entries in to their Prolog
representation, see https://github.com/Attempto/APE/tree/master/java)

Best,
Kaarel

On Sun, Apr 3, 2016 at 4:05 AM, Phan Vo Thu Nhat
<s3220976 at student.rmit.edu.au> wrote:
> Dear Kaarel,
>
> No, I am not, but it confuses me because I am new. I have tested your given
> commands, but receiving a half of your expected result. Here is mine:
>
> ape.exe -file test.txt -solo owlfsspp
>
> Prefix(:=<http://attempto.ifi.uzh.ch/ontologies/owlswrl/test#>)
> Prefix(ace:=<http://attempto.ifi.uzh.ch/ace#>)
> Ontology(<http://attempto.ifi.uzh.ch/ontologies/owlswrl/test>
>    ClassAssertion(
>       ObjectSomeValuesFrom(
>          :like
>          :man
>       )
>       :Mary
>    )
> )
>
> As you can see, I dont have "SubClassOf...". By the way, I read the help
> command-line arguments and see -ulexfile FILENAME, but dont know how to
> execute it properly. I am interested in creating my own lexicon (e.g.
> creating a dataset with some keywords) for research purpose. If possible,
> can you provide me a guide to create a small lexicon file, and how to let
> the parser use it instead of the default one? How can I check the current
> lexicon the parser is using?
>
> Thank you in advance and have a nice day.
>
> On 3 April 2016 at 00:31, Kaarel Kaljurand <kaljurand at gmail.com> wrote:
>>
>> Hi,
>>
>> I've updated the documentation to use double quotes (see
>> https://github.com/Attempto/APE/blob/master/README.md)
>>
>> APE supports loading the input from a local file using the -file argument.
>>
>> $ printf "There is a man.\nMary likes him.\n\nMary likes every man.\n" >
>> ace.txt
>> $ cat ace.txt
>> There is a man.
>> Mary likes him.
>>
>> Mary likes every man.
>> $ ./ape.exe -file ace.txt -solo owlfsspp
>> Prefix(:=<http://attempto.ifi.uzh.ch/ontologies/owlswrl/test#>)
>> Prefix(ace:=<http://attempto.ifi.uzh.ch/ace#>)
>> Ontology(<http://attempto.ifi.uzh.ch/ontologies/owlswrl/test>
>>    ClassAssertion(
>>       ObjectSomeValuesFrom(
>>          :like
>>          :man
>>       )
>>       :Mary
>>    )
>>    SubClassOf(
>>       :man
>>       ObjectSomeValuesFrom(
>>          ObjectInverseOf(
>>             :like
>>          )
>>          ObjectOneOf(
>>             :Mary
>>          )
>>       )
>>    )
>> )
>>
>> I haven't tested it on Windows recently though. Are you saying that it
>> does not work?
>>
>> Best,
>> Kaarel
>>
>> On Sat, Apr 2, 2016 at 2:11 PM, Phan Vo Thu Nhat
>> <s3220976 at student.rmit.edu.au> wrote:
>> > Dear Kaarel,
>> >
>> > Thank you for your reply, I really appreciate your time of helping.
>> >
>> > In respect of your given commands, yes the first one behaves as I want
>> > to
>> > see but the second one still displays nothing. I cross-check the test
>> > commands I have input and realize that they all use single quotation
>> > marks
>> > (for unix enviroment !?). For Windows, it should be double quotation
>> > marks,
>> > so that is why it is not working.
>> >
>> > The purpose of the second command that I try is to test if I can read
>> > multiple English sentences from a local file, then expect to get a
>> > result.
>> > Is there any ACE parsing engine syntax to make it possible?
>> >
>> > Thank you in advance.
>> >
>> > Regards,
>> > Phan Vo
>> >
>> > On 2 April 2016 at 22:12, Kaarel Kaljurand <kaljurand at gmail.com> wrote:
>> >>
>> >> Hi,
>> >>
>> >> both commands work correctly in my case. (But I'm using Linux and an
>> >> older version of SWI-Prolog.)
>> >>
>> >> Can you try the slightly different commands:
>> >>
>> >>     ape.exe -text "John waits." -cdrsxml -csyntax
>> >>
>> >>     ape.exe -file
>> >> http://attempto.ifi.uzh.ch/site/acetexts/example1.ace.txt -solo owlxml
>> >> -guess
>> >>
>> >> Do these behave differently?
>> >>
>> >> Best,
>> >> Kaarel
>> >>
>> >> On Sat, Apr 2, 2016 at 12:11 PM,  <attempto-bounces at lists.ifi.uzh.ch>
>> >> wrote:
>> >> > The attached message has been automatically discarded.
>> >> >
>> >> > ---------- Forwarded message ----------
>> >> > From: Phan Vo Thu Nhat <s3220976 at student.rmit.edu.au>
>> >> > To: attempto at lists.ifi.uzh.ch
>> >> > Cc:
>> >> > Date: Sat, 2 Apr 2016 21:11:25 +1100
>> >> > Subject: Need help with Attempto configuration
>> >> > Dear Attempto team,
>> >> >
>> >> > I am a research student. I have basically configured ACE parsing
>> >> > engine
>> >> > in my PC and try to test a few command lines, but I get this error:
>> >> >
>> >> > Illegal argument: arglist_namevaluelist/2
>> >> >
>> >> > Here are command lines I input:
>> >> >
>> >> > ape.exe -text 'John waits.' -cdrsxml -csyntax
>> >> > ape.exe -file
>> >> > http://attempto.ifi.uzh.ch/site/acetexts/example1.ace.txt
>> >> > -solo owlxml
>> >> >
>> >> > The second one seems to display nothing (please refer to my attached
>> >> > pic). Thus, I stuck at finding the source of this issue. Can you
>> >> > please help
>> >> > me?
>> >> >
>> >> > --
>> >> > Thank you in advance.
>> >> >
>> >> > Regards,
>> >> > Phan Vo
>> >> >
>> >
>> >
>> >
>> >
>> > --
>> > Thank you in advance.
>> >
>> > Regards,
>> > Phan Vo
>
>
>
>
> --
> Thank you in advance.
>
> Regards,
> Phan Vo


More information about the attempto mailing list