whether Visual Prolog can do natural language processing?

Discussions related to Visual Prolog
Li
Posts: 12
Joined: 21 Dec 2014 4:15

whether Visual Prolog can do natural language processing?

Unread post by Li » 21 Dec 2014 4:35

If it is able to do such things,can you recommend some books,articles,tutorial,whatever,etc.Thank you very much. :D :D :D
I am a rookee coming here to learn from friends.

dominique f pannier
VIP Member
Posts: 98
Joined: 23 Sep 2002 23:01

Unread post by dominique f pannier » 21 Dec 2014 9:18

Hi,
Natural language processing is a world of its own. There is a priori no reason to think that a computer language is better than another to do such a thing. But a main feature of that world is that it requires many original modelling tools. The advantadge of VIP is that it's very well adapted to that function. With practice, you can build a collection of tools whithout ever loosing sight of your goal because you need to focus on the language computer logic : with VIP, this one becomes almost transparent.
So I think it's good to bring in the idea natural language processing with VIP.
I also think that the best recommendation is to start practising directly VIP with simple language treatments.
Regards
Dominique Pannier

Li
Posts: 12
Joined: 21 Dec 2014 4:15

Re:

Unread post by Li » 21 Dec 2014 11:36

dominique f pannier wrote:Hi,
Natural language processing is a world of its own. There is a priori no reason to think that a computer language is better than another to do such a thing. But a main feature of that world is that it requires many original modelling tools. The advantadge of VIP is that it's very well adapted to that function. With practice, you can build a collection of tools whithout ever loosing sight of your goal because you need to focus on the language computer logic : with VIP, this one becomes almost transparent.
So I think it's good to bring in the idea natural language processing with VIP.
I also think that the best recommendation is to start practising directly VIP with simple language treatments.

Thank you very much.But maybe I have not express myself clearly.Let me show an example.In swi-prolog,There is such a function:

?- L=[write,'Hello World'],G=..L,call(G).
Hello World
L = [write, 'Hello World'],
G = write('Hello World').

whether visual prolog has similar built-in predicates with "=.." and "call".
Thank you. :D :D :D
I am a rookee coming here to learn from friends.

Li
Posts: 12
Joined: 21 Dec 2014 4:15

Unread post by Li » 22 Dec 2014 2:42

:D :D :D
I am a rookee coming here to learn from friends.

User avatar
Thomas Linder Puls
VIP Member
Posts: 1624
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 22 Dec 2014 8:17

Visual Prolog does not have facilities for making calls in that way, you will have to create an interpreting predicate yourself:

Code: Select all

class predicates     interpret : (string List). clauses     interpret(["forward", LenStr, Unit]) :-         Len = tryToTerm(integer, LenStr),         !,         forward(Len Unit).     ...       interpret([F|Args]) :-         stdio::writef("Could not interpret %(%)\n", F, string::concatWithDelimiter(Args, ", ")).       interpret([]) :-         stdio::write("Nothing to interpret\n").
Regards Thomas Linder Puls
PDC

dominique f pannier
VIP Member
Posts: 98
Joined: 23 Sep 2002 23:01

Unread post by dominique f pannier » 22 Dec 2014 9:06

Well, I see that what you mean by "natural language processing" is at a starting level.
I think then you should deal with the problem with some method :
1) you can get answers to such questions in the book Visual Prolog for Tyros which will gradualy show you how VIP works.
1) you should later run and analyse Visual Prolog Examples which provides you different tools that you can test with your own data.

The code you have to write to answer at your first question is the following one :

Code: Select all

stdio::write("Hello World", "\n").
that you put at the suggested place in the main.pro class of a console project like below :

Code: Select all

implement main     open core   clauses     run() :-         stdio::write("Hello World", "\n"). % place your own code here   end implement main   goal     console::runUtf8(main::run).
I let you study how to answer at the second one.
Regards
Dominique Pannier

Li
Posts: 12
Joined: 21 Dec 2014 4:15

Re:

Unread post by Li » 23 Dec 2014 3:12

Thomas Linder Puls wrote:Visual Prolog does not have facilities for making calls in that way, you will have to create an interpreting predicate yourself:

Code: Select all

class predicates     interpret : (string List). clauses     interpret(["forward", LenStr, Unit]) :-         Len = tryToTerm(integer, LenStr),         !,         forward(Len Unit).     ...       interpret([F|Args]) :-         stdio::writef("Could not interpret %(%)\n", F, string::concatWithDelimiter(Args, ", ")).       interpret([]) :-         stdio::write("Nothing to interpret\n").

Wow:lol: :lol: :lol: .Thank you Thomas.It's so great an idea.You are so talent.
I am a rookee coming here to learn from friends.

Li
Posts: 12
Joined: 21 Dec 2014 4:15

Re:

Unread post by Li » 23 Dec 2014 3:15

dominique f pannier wrote:Well, I see that what you mean by "natural language processing" is at a starting level.
I think then you should deal with the problem with some method :
1) you can get answers to such questions in the book Visual Prolog for Tyros which will gradualy show you how VIP works.
1) you should later run and analyse Visual Prolog Examples which provides you different tools that you can test with your own data.

The code you have to write to answer at your first question is the following one :

Code: Select all

stdio::write("Hello World", "\n").
that you put at the suggested place in the main.pro class of a console project like below :

Code: Select all

implement main     open core   clauses     run() :-         stdio::write("Hello World", "\n"). % place your own code here   end implement main   goal     console::runUtf8(main::run).
I let you study how to answer at the second one.

Thank you dear.Thanks for your instruction.I will do that.
I am a rookee coming here to learn from friends.

Li
Posts: 12
Joined: 21 Dec 2014 4:15

Re:

Unread post by Li » 24 Dec 2014 13:01

Thomas Linder Puls wrote:Visual Prolog does not have facilities for making calls in that way, you will have to create an interpreting predicate yourself:

Code: Select all

class predicates     interpret : (string List). clauses     interpret(["forward", LenStr, Unit]) :-         Len = tryToTerm(integer, LenStr),         !,         forward(Len Unit).     ...       interpret([F|Args]) :-         stdio::writef("Could not interpret %(%)\n", F, string::concatWithDelimiter(Args, ", ")).       interpret([]) :-         stdio::write("Nothing to interpret\n").

Dear Thomas :D :-) Merry Cristmas.
Now I'm faced with another problem. :D :D :D need for your help again.

I want to define a new domain.

Here,for "integer" I can define a new domain like "lightWeight = integer[0..50]"
But for "real",if I imitate to define "lightWeight = real[0..50]" ,it will be an error.How should I do it
And for "string",if I want to define a new domain,which only has three elements such as"a,b,c",how should I do it
I am a rookee coming here to learn from friends.

User avatar
Thomas Linder Puls
VIP Member
Posts: 1624
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 26 Dec 2014 0:00

For a real domain you will have to include "digits" in the definition like this:

Code: Select all

domains     limited = [0..50] digits 16.
(16 is actually the only sensible choice).

You cannot define a sub-set of string like you propose, but you can define a functor domain with a fixed set of functors/enumerators:

Code: Select all

domains      fixed = a; b; c.
That domain only have the three possible values a, b and c, but they are not like strings enclosed in quotes.
Regards Thomas Linder Puls
PDC

Li
Posts: 12
Joined: 21 Dec 2014 4:15

Re:

Unread post by Li » 26 Dec 2014 1:17

Thomas Linder Puls wrote:For a real domain you will have to include "digits" in the definition like this:

Code: Select all

domains     limited = [0..50] digits 16.
(16 is actually the only sensible choice).

You cannot define a sub-set of string like you propose, but you can define a functor domain with a fixed set of functors/enumerators:

Code: Select all

domains      fixed = a; b; c.
That domain only have the three possible values a, b and c, but they are not like strings enclosed in quotes.
Thank you verry much.You have given me so much help.Someday you come to China,I invite you for dinner :D :D :D
I am a rookee coming here to learn from friends.

Post Reply