Author Topic: Natural Language Processing  (Read 5217 times)

0 Members and 1 Guest are viewing this topic.

Offline Binder News

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 785
  • Rating: +46/-3
  • Zombie of Tomorrow
    • View Profile
Natural Language Processing
« on: November 05, 2011, 10:17:17 pm »
So, I've been wondering for a while now, how would I go about something like Natural Language Processing? Preferably, I would want to write the code in C/C++, but I don't really care that much. So, any ideas anyone?

-Bindernews
Spoiler For userbars:







Hacker-in-training!   Z80 Assembly Programmer     Axe Programmer
C++ H4X0R             Java Coder                           I <3 Python!

Perdidisti ludum     Cerebrum non habes

"We are humans first, no matter what."
"Fame is a vapor, popularity an accident, and riches take wings. Only one thing endures, and that is character."
Spoiler For Test Results:





Offline Geekboy1011

  • The Oneironaut
  • Donator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2031
  • Rating: +119/-2
  • Dream that Awakening dream
    • View Profile
Re: Natural Language Processing
« Reply #1 on: November 05, 2011, 11:33:58 pm »
you mean as in like a interactive fiction parser or something else?

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Natural Language Processing
« Reply #2 on: November 05, 2011, 11:37:03 pm »
what's your end goal? to be able to ask your program a question and have it come up with a logical answer, or have it be able to break down the parts of a sentence i.e. sentences into clauses & phrases, clauses & phrases into individual parts of speech?


Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Natural Language Processing
« Reply #3 on: November 06, 2011, 12:00:44 am »
The important questions are really how much information needs to be extracted and what the application is.

* Qwerty.55 checks his personal library

Aww, all I have on the subject are a few papers on Natural Language Generation, which is basically the opposite problem.

« Last Edit: November 06, 2011, 12:01:11 am by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: Natural Language Processing
« Reply #4 on: November 06, 2011, 12:23:25 am »
everyone else said it, but i have to repeat: to what end?
if you're making a game that uses text as input, searching for a few keywords and phrases can be enough, but other things are more difficult.

Offline Binder News

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 785
  • Rating: +46/-3
  • Zombie of Tomorrow
    • View Profile
Re: Natural Language Processing
« Reply #5 on: November 06, 2011, 12:24:42 am »
The goal would be to be able to take a semi-natural language, make an Abstract Syntax Tree, and generate code in C/C++, Java, etc.
What I mean by semi-natural language is that there can be rules, so: "set the variable MyInt to the value of 5." should be the same as "let the variable MyInt equal 5." However, I don't mind if there are sever limits on what is can process.

Spoiler For userbars:







Hacker-in-training!   Z80 Assembly Programmer     Axe Programmer
C++ H4X0R             Java Coder                           I <3 Python!

Perdidisti ludum     Cerebrum non habes

"We are humans first, no matter what."
"Fame is a vapor, popularity an accident, and riches take wings. Only one thing endures, and that is character."
Spoiler For Test Results:





Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: Natural Language Processing
« Reply #6 on: November 06, 2011, 12:34:59 am »
that sounds like a situation that could be handled through keywords as well. for example, your parser could take things like "let" or "set" as tip off words that the following is an equals statement, have "variable" indicate that the next word is a varname, etcetera.

the hardest part of something like this would probably be words that can be interpreted to mean different things according to context. for example, "and" could be used to separate different lines of code:
set variable MyName to 5 and increment it. (incidentally, dealing with pronouns could be tough as well)
or
increment variable MyName while it is less than 4 and greater than 1

the only way i can think of for dealing with something like that is to have while make whatever is next be interpreted as a boolean value, up until the next punctuation.
« Last Edit: November 06, 2011, 12:35:31 am by shmibs »

Offline Binder News

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 785
  • Rating: +46/-3
  • Zombie of Tomorrow
    • View Profile
Re: Natural Language Processing
« Reply #7 on: November 06, 2011, 12:39:15 am »
Humm. You're right, that would be a problem. The good thing is, if there is too much ambiguity, I can just throw an error.
And pronouns wouldn't be too hard to deal with. At least I don't think so. The real problem for me is determining meaning using context.
Spoiler For userbars:







Hacker-in-training!   Z80 Assembly Programmer     Axe Programmer
C++ H4X0R             Java Coder                           I <3 Python!

Perdidisti ludum     Cerebrum non habes

"We are humans first, no matter what."
"Fame is a vapor, popularity an accident, and riches take wings. Only one thing endures, and that is character."
Spoiler For Test Results:





Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Natural Language Processing
« Reply #8 on: November 06, 2011, 12:51:20 am »
What is the scope of this project? Is it to make a full language or just to make certain programming routines easier?
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Binder News

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 785
  • Rating: +46/-3
  • Zombie of Tomorrow
    • View Profile
Re: Natural Language Processing
« Reply #9 on: November 06, 2011, 01:35:51 am »
I'm not sure. Right now, it's really just an experiment to determine the limits of the idea, and to play around with it a little.
Right now, I just want it to be able to process the text. If I ever get that working, I might make it into something. The real goal is just to see if it's doable.
Spoiler For userbars:







Hacker-in-training!   Z80 Assembly Programmer     Axe Programmer
C++ H4X0R             Java Coder                           I <3 Python!

Perdidisti ludum     Cerebrum non habes

"We are humans first, no matter what."
"Fame is a vapor, popularity an accident, and riches take wings. Only one thing endures, and that is character."
Spoiler For Test Results:





Offline JL235

  • LV3 Member (Next: 100)
  • ***
  • Posts: 57
  • Rating: +13/-0
    • View Profile
    • Play My Code
Re: Natural Language Processing
« Reply #10 on: November 06, 2011, 10:36:46 am »
One of the problems with a natural language program is that lots of fiddly stuff, like the maths controlling how a sprite moves on a screen, can't easily be expressed.

But you might want to take a look at logic based programming languages such as Prolog, as they are pretty much used exclusively for this type of work. They make it easier to build the relationships needed between words, to allow you to better work out context.

Looking on Wikipedia I also found this natural programming language, which looks pretty cool. It's hello world program is:
Code: [Select]
I want window and the window title is Hello World.
Build games in the browser at PlayMyCode.com, @playmycode

Offline Binder News

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 785
  • Rating: +46/-3
  • Zombie of Tomorrow
    • View Profile
Re: Natural Language Processing
« Reply #11 on: November 06, 2011, 11:08:10 am »
Yes. That's very close to what I'm trying to achieve. However, I hate how it looks like baby talk.
Thanks a ton. But please, continue to discuss.
Spoiler For userbars:







Hacker-in-training!   Z80 Assembly Programmer     Axe Programmer
C++ H4X0R             Java Coder                           I <3 Python!

Perdidisti ludum     Cerebrum non habes

"We are humans first, no matter what."
"Fame is a vapor, popularity an accident, and riches take wings. Only one thing endures, and that is character."
Spoiler For Test Results:





Offline ExtendeD

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: Natural Language Processing
« Reply #12 on: November 06, 2011, 12:20:07 pm »
Try third party libraries such as OpenNLP (unfortunately in Java). It may do the whole parsing job but it should really help you with the initial language parsing.
Ndless.me with the finest TI-Nspire programs

Offline Binder News

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 785
  • Rating: +46/-3
  • Zombie of Tomorrow
    • View Profile
Re: Natural Language Processing
« Reply #13 on: November 06, 2011, 12:48:24 pm »
Awesome, thanks. for the tip. I'll be sure to look into it.
Spoiler For userbars:







Hacker-in-training!   Z80 Assembly Programmer     Axe Programmer
C++ H4X0R             Java Coder                           I <3 Python!

Perdidisti ludum     Cerebrum non habes

"We are humans first, no matter what."
"Fame is a vapor, popularity an accident, and riches take wings. Only one thing endures, and that is character."
Spoiler For Test Results: