Ruby & Artificial Intelligence

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.

On Thu, Apr 24, 2008 at 12:33 PM, Pranjal J.
[email protected] 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,…?)

I stumbled across http://web.media.mit.edu/~dustin/rubyai.html the
other day on RubyFlow, it might be of interest.

On Thu, 24 Apr 2008 07:25:21 -0500, Pranjal J. 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

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

Jano S. wrote:

On Thu, Apr 24, 2008 at 12:33 PM, Pranjal J.
[email protected] 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,…?)

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 [email protected]

Thanks in advance :slight_smile:

Ken B. wrote:

On Thu, 24 Apr 2008 07:25:21 -0500, Pranjal J. 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

Hi,

On Fri, Apr 25, 2008 at 2:53 PM, Pranjal J.
[email protected]
wrote:

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 C. wrote:

credentials"
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 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.

-----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. :wink:

| 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 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] Ruby and the Art of Domain Specific Languages
[1] http://mwrc2008.confreaks.com/08obrien.html


Phillip G.
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-----

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)

Hi, W.P. McNeill wrote a Ruby wrapper[1] for the Stanford Parser[2].

Cheers
Nicolai

[1] http://stanfordparser.rubyforge.org/
[2] The Stanford Natural Language Processing Group

On Mon, Apr 28, 2008 at 8:55 AM, stephenT [email protected] wrote:

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