AskMerlin, your AI expert system guru oracle advisor

Ron Stephens rdsteph at earthlink.net
Sun Oct 28 18:19:52 EST 2001


Ok i want to ask a simple question that I can not figure out yet. (Even
though I used and then modified the the line of code below:

x = (self._getGoogleHits(self.question + ' ' + reply))
                y = (self._getGoogleHits(reply))

I am not sure what the significance of the (self.question + ' ' +reply) is.
Specifically, what is the significance of the two quotation marks in the
middle? Doe sit just ad a space between the two strings (question and
reply), or does it do something else? I tried the program without hte two
quotes and it didn't seem to change the operation noticeably.

OK, I feel dumb but I would still like to know the answer. Anyone?

Ron Stephens
http://www.awaretek.com


Ron Stephens wrote:

> Ok, so this is what happens when Guido promotes CP4E. You get newbie,
> duffer, weekend hackers doing whatever turns them on.
>
> I make no claims that this code is anything more than a hack. Please
> excuse it, but if anyone is interested, you can link to my programs
> below. Thanks to the inventors of NLQ and multiChoiceGuesser! I hope you
> can forgive me for hacking your code ;-))
>
> #!/usr/bin/python
> # AskMerlin is a weekend hack I did by putting together a short program
> called NLQ,
> # or natural language query, which can be found online at
> http://gurno.com/adam/nlq/#download
> # NLQ is a Class to take an inputted query and output 1. Keywords and 2.
> also to categorize
> # the type of question being asked. I am primarily interested in using
> the Keywords
> # extracted form a query by NLQ. I shamelessly modified NLQ to add many
> more
> # IGNORE_WORDS and otherwise spruce it up.
> # Next, I utilized the multiChoise Guesser script that some nice person
> posted
> # on the newsgroup a couple weeks ago. This uses urllib to go out to the
> web
> # and judge teh appropriateness of a given answer by how many hits it
> gets on Google
> # when coupled with the original question in a Google search.
> # My main contribution, such as it was, was simply to enable the program
> to create
> # choices in order to choose a most appropriate answer. This is done by
> using
> # NLQ to pick out Keywords form teh HTML page returned by Google in its
> search
> # on the question. This version, AskMerlin, currently takes a long time
> # to come to an answer because it must do many web searches/ I have also
> a simpler version
> # called aNoDivisorAskMerlin that comes to a much quicker decision, btu
> is not as good in the
> # appropriateness of its answer's. In either case, you must wait
> patiently while
> # merlin considers his options...dependign on speed of your internet
> connection.
> # On my cable modem at home, AsKMerlin takes about three minutes.
> # I am hoping that someone or other might give me ideas on how to
> improve the
> # intelligence behind Merlin's deliberations. This version is just a
> hack to see if it works
> # in principle. I have other ideas to increase "intelligence" but I need
> more.
> # Currently, Merlin is very low IQ, but he has potential for the future.
>
> # Anyway, Merlin can already answer just about any question.
> # Someday, perhaps he will even answer correctly or at least with wisdom
>
> # ;-)))))))))))))
>
> http://www.awaretek.com/AskMerlin.py
>
> http://www.awaretek.com/aNoDivisorAskMerlin.py







More information about the Python-list mailing list