Ruby & Artificial Intelligence

Discussion in 'Ruby' started by Pranjal Jain, Apr 24, 2008.

  1. Pranjal Jain

    Pranjal Jain Guest

    HI friends

    Does anybody have any fair idea how we can use ruby for AI.

    Any website or help will be great.

    Thanks in advance.
    --
    Posted via http://www.ruby-forum.com/.
     
    Pranjal Jain, Apr 24, 2008
    #1
    1. Advertising

  2. Pranjal Jain

    Jano Svitok Guest

    On Thu, Apr 24, 2008 at 12:33 PM, Pranjal Jain
    <> wrote:
    > HI friends
    >
    > Does anybody have any fair idea how we can use ruby for AI.
    >
    > Any website or help will be great.
    >
    > Thanks in advance.


    If you tell more precisely what kind of AI do you mean, you'll get
    better answers. AI is a pretty wide term.
    (are you developing an expert system/game/language processing/...?
    What are you looking for - reasoning engine, neural network
    engine,...?)
     
    Jano Svitok, Apr 24, 2008
    #2
    1. Advertising

  3. Pranjal Jain

    BiHi Guest

    BiHi, Apr 24, 2008
    #3
  4. Pranjal Jain

    Pranjal Jain Guest

    HI
    By AI I mean "language processing" here.
    I am looking for any material which can help me.

    Jano Svitok wrote:
    > On Thu, Apr 24, 2008 at 12:33 PM, Pranjal Jain
    > <> wrote:
    >> HI friends
    >>
    >> Does anybody have any fair idea how we can use ruby for AI.
    >>
    >> Any website or help will be great.
    >>
    >> Thanks in advance.

    >
    > If you tell more precisely what kind of AI do you mean, you'll get
    > better answers. AI is a pretty wide term.
    > (are you developing an expert system/game/language processing/...?
    > What are you looking for - reasoning engine, neural network
    > engine,...?)


    --
    Posted via http://www.ruby-forum.com/.
     
    Pranjal Jain, Apr 24, 2008
    #4
  5. Pranjal Jain

    Ken Bloom Guest

    On Thu, 24 Apr 2008 07:25:21 -0500, Pranjal Jain wrote:

    > HI
    > By AI I mean "language processing" here. I am looking for any material
    > which can help me.


    I do this kind of thing, but most of my processing is done in an SQL
    database, so I use Ruby to drive the database. For things like taggers
    and parsers, which are typically available in Java, I've been inclined to
    work with them by writing Java (or Groovy) code. On the other hand, stuff
    that's available as a C library, I'm inclined to wrap as a Ruby extension
    (usually with the help of SWIG) then write Groovy code to interact with
    it.

    But if you have specific questions about resources, feel free to ask.

    --Ken


    --
    Ken (Chanoch) Bloom. PhD candidate. Linguistic Cognition Laboratory.
    Department of Computer Science. Illinois Institute of Technology.
    http://www.iit.edu/~kbloom1/
     
    Ken Bloom, Apr 24, 2008
    #5
  6. Pranjal Jain

    Pranjal Jain Guest

    Hi

    Suppose I am having a sentence like this

    "Navigate to the application page. Enter the user field with
    credentials"
    When I give this sentence to the computer, it should be able to
    understand the key words like "Enter", "User field", "Credentials".
    It should be able to make a priority on "Enter & Navigation",

    then it should write the user name & password in desired field.

    If I am unable to explain you clearly please give me your gmail id. so
    that i can chat there you freely.

    Mine is

    Thanks in advance :)

    Ken Bloom wrote:
    > On Thu, 24 Apr 2008 07:25:21 -0500, Pranjal Jain wrote:
    >
    >> HI
    >> By AI I mean "language processing" here. I am looking for any material
    >> which can help me.

    >
    > I do this kind of thing, but most of my processing is done in an SQL
    > database, so I use Ruby to drive the database. For things like taggers
    > and parsers, which are typically available in Java, I've been inclined
    > to
    > work with them by writing Java (or Groovy) code. On the other hand,
    > stuff
    > that's available as a C library, I'm inclined to wrap as a Ruby
    > extension
    > (usually with the help of SWIG) then write Groovy code to interact with
    > it.
    >
    > But if you have specific questions about resources, feel free to ask.
    >
    > --Ken


    --
    Posted via http://www.ruby-forum.com/.
     
    Pranjal Jain, Apr 25, 2008
    #6
  7. Pranjal Jain

    Arlen Cuss Guest

    [Note: parts of this message were removed to make it a legal post.]

    Hi,

    On Fri, Apr 25, 2008 at 2:53 PM, Pranjal Jain <>
    wrote:

    > Hi
    >
    > Suppose I am having a sentence like this
    >
    > "Navigate to the application page. Enter the user field with
    > credentials"
    > When I give this sentence to the computer, it should be able to
    > understand the key words like "Enter", "User field", "Credentials".
    > It should be able to make a priority on "Enter & Navigation",
    >
    > then it should write the user name & password in desired field.




    I have a good feeling that what you're asking for is nearly impossible - and
    at the least, not Ruby specific. You'll need to research this in a community
    more geared towards language analysis/AI/etc... but while I was stumbling on
    the 'net, I found this:

    http://web.media.mit.edu/~dustin/rubyai.html

    Hope it helps you in some way.

    Cheers,
    Arlen
     
    Arlen Cuss, Apr 27, 2008
    #7
  8. Arlen Cuss wrote:
    > Hi,
    >
    > On Fri, Apr 25, 2008 at 2:53 PM, Pranjal Jain <>
    > wrote:
    >
    >> Hi
    >>
    >> Suppose I am having a sentence like this
    >>
    >> "Navigate to the application page. Enter the user field with
    >> credentials"
    >> When I give this sentence to the computer, it should be able to
    >> understand the key words like "Enter", "User field", "Credentials".
    >> It should be able to make a priority on "Enter & Navigation",
    >>
    >> then it should write the user name & password in desired field.

    >
    >
    >
    > I have a good feeling that what you're asking for is nearly impossible - and
    > at the least, not Ruby specific. You'll need to research this in a community
    > more geared towards language analysis/AI/etc... but while I was stumbling on
    > the 'net, I found this:
    >
    > http://web.media.mit.edu/~dustin/rubyai.html
    >
    > Hope it helps you in some way.
    >
    > Cheers,
    > Arlen
    >


    Well ... programming in "natural" languages has been a dream for
    decades. Heck, that was one of the things that was supposedly attractive
    about COBOL (and its predecessor, COMTRAN). You can probably still find
    code like

    SUBTRACT TAXES FROM GROSS_INCOME GIVING NET_INCOME

    in the COBOL code base.

    Mabye that's why it irks me so when I see Rails code like

    class Order < ActiveRecord::Base
    has_many :line_items
    end

    Now, if it were "An order has many line items," that would be natural.
    But it's the mix of Ruby code and English (class <Class-name starting
    with a *capital* letter>, <two English words separated by an underscore>
    <two English words separated by an underscore *and* preceded by a
    colon>), etc. It's un-natural. I'd rather have straight code.

    Rake is another example ... file tasks are named with strings and other
    tasks are named with symbols. The whole "when do I use a symbol and when
    do I use an ordinary identifier" conundrum is difficult for me.

    The point is that if you're writing code for other programmers to read,
    you can assume that they know both the programming language and "the"
    natural language. And an IDE for teams of these programmers should
    introduce another common language -- coding standards, project
    structure, version control, lexical and syntactic help, testing
    frameworks, debugging, etc.

    I think it's a mistake to try to design languages and programs in a way
    that *in theory* attempts to make the code readable to non-programmers.
    First of all, non-programmers rarely, if ever, read code. They care
    about what the software *does*, not what's under the hood. And second,
    it makes the job of the programmer more difficult.
     
    M. Edward (Ed) Borasky, Apr 27, 2008
    #8
  9. -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    M. Edward (Ed) Borasky wrote:

    |
    | Well ... programming in "natural" languages has been a dream for
    | decades. Heck, that was one of the things that was supposedly attractive
    | about COBOL (and its predecessor, COMTRAN). You can probably still find
    | code like
    |
    | SUBTRACT TAXES FROM GROSS_INCOME GIVING NET_INCOME
    |
    | in the COBOL code base.
    |
    | Mabye that's why it irks me so when I see Rails code like
    |
    | class Order < ActiveRecord::Base
    | has_many :line_items
    | end

    How do you see code like 'a = b unless c' in Ruby, then? Ruby's pretty
    much trying to become a sort-of-natural language, though not mimicking
    English (or Japanese), but by staying out of the programmer's way,
    making code, in fact, easy to read and understand.

    But with any language, you'll have to know the syntax and grammar of the
    language used. Just as with natural languages. ;)

    | Now, if it were "An order has many line items," that would be natural.
    | But it's the mix of Ruby code and English (class <Class-name starting
    | with a *capital* letter>, <two English words separated by an underscore>
    | <two English words separated by an underscore *and* preceded by a
    | colon>), etc. It's un-natural. I'd rather have straight code.

    So, you'd prefer

    if c == true # Or whatever we check here that results in evaluation
    ~ a = b
    end

    over the above example? I'm more curious, than any thing else.

    I think the quality of DSLs like Rails and Rake, and, in a broader
    sense, Ruby, is that they look like English, making it easy to
    understand, but isn't English 'enough', keeping you on your toes when
    writing code, as you still have to think about what you are actually doing.

    Natural language is ambiguous in its nature ("Gravity means that every
    object attracts every other object": Does that sentence mean that all
    objects attract all other objects, or that all objects attract every
    second object? It's COIK: Clear Only If Known.), whereas a programming
    language cannot be ambiguous, creating the thin line to walk when
    designing a language.

    And as far as I can see, all these 'natural language' approaches result
    in an 'English' that is like a second grader writing a novel (Not
    underestimating your average second grader): very, very bumpy. Take a
    look at AppleScript, for example.

    | Rake is another example ... file tasks are named with strings and other
    | tasks are named with symbols. The whole "when do I use a symbol and when
    | do I use an ordinary identifier" conundrum is difficult for me.

    If the identifier shall remain over the course of the program's runtime,
    use a Symbol, as those don't get garbage collected. Otherwise use a
    String. That's my rule of thumb, when not using Rails.

    | I think it's a mistake to try to design languages and programs in a way
    | that *in theory* attempts to make the code readable to non-programmers.
    | First of all, non-programmers rarely, if ever, read code. They care
    | about what the software *does*, not what's under the hood. And second,
    | it makes the job of the programmer more difficult.

    I don't think that it is so much about readability for 'non
    programmers', but about readability and accessibility for domain experts.

    At least, that is what I take a way from all these DSL talks I've
    watched in recent months, specifically Val Kilmer's talk 'Ruby and the
    Art of Domain Specific Languages'[0], and Joe O'Brien's talk 'Domain
    Specific Languages: Molding Ruby'[1].


    [0] http://www.infoq.com/presentations/kilmer-ruby-dsls
    [1] http://mwrc2008.confreaks.com/08obrien.html

    - --
    Phillip Gawlowski
    Twitter: twitter.com/cynicalryan

    ~ I imagine girls and bugs have a dim perception that nature played a
    cruel trick on them but they lack the intelligence to really comprehend
    the magnitude of it. -- Calvin
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.8 (MingW32)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

    iEYEARECAAYFAkgU2WkACgkQbtAgaoJTgL/f/QCgi5C5TYjuNk26TjbwUdOEQag7
    QQwAni65VqrlVFVFsf159zFksvsOC7Rx
    =T5p7
    -----END PGP SIGNATURE-----
     
    Phillip Gawlowski, Apr 27, 2008
    #9
  10. Pranjal Jain

    Codeblogger Guest

    Codeblogger, Apr 28, 2008
    #10
  11. Pranjal Jain

    stephenT Guest


    >
    > Ruby is not performant enough to use for an AI inference engine.
    >

    Neither is the 'processing' unit of the brain performant enough to be
    used as an inference engine.


    English, Japanese, German, .... are no more natural than any computer
    language.

    Don't let the surface structure of the problem lead you astray nor let
    the surface similarity of a tool (computer language) to a problem
    domain (language understanding) lead you to the idea that one can be
    as effective as the other. Interpretation, understanding, and
    generation of spoken and written language is, at the core, a spatial-
    temporal pattern recognition problem. Whereas computer languages
    (which are usually a formal subset of another language) require more
    of a patter matching approach. One could argue that this is just a
    difference in specificity of the associated meaning of each individual
    language token but I think it goes beyond that. By this I mean that
    language, in the traditional sense, has a dependency on the greater
    context in which it is used. Context can actually create unique new
    associated meanings to tokens. Computer languages do not have this
    feature. (the associated runtime value of a variable is not the same)
     
    stephenT, Apr 28, 2008
    #11
  12. Pranjal Jain

    Todd Benson Guest

    On Mon, Apr 28, 2008 at 8:55 AM, stephenT <> wrote:
    >
    > >
    > > Ruby is not performant enough to use for an AI inference engine.
    > >

    > Neither is the 'processing' unit of the brain performant enough to be
    > used as an inference engine.
    >
    >
    > English, Japanese, German, .... are no more natural than any computer
    > language.
    >
    > Don't let the surface structure of the problem lead you astray nor let
    > the surface similarity of a tool (computer language) to a problem
    > domain (language understanding) lead you to the idea that one can be
    > as effective as the other. Interpretation, understanding, and
    > generation of spoken and written language is, at the core, a spatial-
    > temporal pattern recognition problem. Whereas computer languages
    > (which are usually a formal subset of another language) require more
    > of a patter matching approach. One could argue that this is just a
    > difference in specificity of the associated meaning of each individual
    > language token but I think it goes beyond that. By this I mean that
    > language, in the traditional sense, has a dependency on the greater
    > context in which it is used. Context can actually create unique new
    > associated meanings to tokens. Computer languages do not have this
    > feature. (the associated runtime value of a variable is not the same)


    This is why there exists reliance upon language convention and unit
    tests. In other words, for people to play well together, they have to
    make their own set of language usage rules that are a subset of those
    of the language. Unfortunate consequence of programming in general,
    just in different spades with Ruby.

    Todd
     
    Todd Benson, Apr 28, 2008
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. White Wolf
    Replies:
    8
    Views:
    429
    Terry Reedy
    Sep 15, 2003
  2. tommak
    Replies:
    2
    Views:
    464
    Kenneth P. Turvey
    Jul 4, 2006
  3. tommak
    Replies:
    1
    Views:
    354
    Terry Hancock
    Jul 4, 2006
  4. tommak
    Replies:
    0
    Views:
    395
    tommak
    Jul 4, 2006
  5. Ryosuke Kadoi
    Replies:
    5
    Views:
    342
    Tom Copeland
    Dec 1, 2003
Loading...

Share This Page