Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalized pattern does not work in GHOST #3483

Open
stellarspot opened this issue Apr 26, 2019 · 5 comments
Open

Generalized pattern does not work in GHOST #3483

stellarspot opened this issue Apr 26, 2019 · 5 comments
Labels

Comments

@stellarspot
Copy link
Contributor

Run the sample:

(use-modules
 (opencog)
 (opencog nlp)
 (opencog nlp relex2logic)
 (opencog ghost)
 (opencog ghost procedures)
 (opencog exec))

(ghost-parse "
r: (where do _* work) '_0 work in SomeCompany.
")

; Test Ghost
(test-ghost "Where do I work?")
(test-ghost "Where does Alice works?")

The output is (i work in SomeCompany.)
The rule "(where do _* work)" does not match sentence "Where does Alice works?"

leungmanhin added a commit that referenced this issue Apr 29, 2019
@leungmanhin
Copy link
Contributor

Should be fixed by #3485

@stellarspot
Copy link
Contributor Author

stellarspot commented May 6, 2019

I see it works with the fix #3485 if test-ghost is used:

(use-modules
 (opencog)
 (opencog nlp)
 (opencog nlp relex2logic)
 (opencog openpsi)
 (opencog ghost)
 (opencog ghost procedures)

 (opencog exec)
)

(ghost-parse "
r: (where do _* work) '_0 work in SomeCompany.
  ^keep()
")

; Disable the ECAN related config for now
(ghost-set-sti-weight 0)
(ghost-af-only #f)

(ghost-run)

(test-ghost "Where does Alice work?")

(ghost-halt)

The result is (Alice work in SomeCompany.)

But the same example does not work if ghost instead of test-ghost is used:

(use-modules
 (opencog)
 (opencog nlp)
 (opencog nlp relex2logic)
 (opencog openpsi)
 (opencog ghost)
 (opencog ghost procedures)

 (opencog exec)
)

(ghost-parse "
r: (where do _* work) '_0 work in SomeCompany.
  ^keep()
")

; Disable the ECAN related config for now
(ghost-set-sti-weight 0)
(ghost-af-only #f)

(ghost-run)

;(test-ghost "Where does Alice work?")
(ghost "Where does Alice work?")

(ghost-halt)

Nothing is printed.

@leungmanhin
Copy link
Contributor

@stellarspot It works, but I believe you are putting all of the above in a file and just load it in the Guile shell, that means you are executing ghost-halt almost immediately after sending the input, so it didn't have the chance to process the input before halting the loop.

@stellarspot
Copy link
Contributor Author

I see. Thank you. If I add the (sleep 1) before the ghost-halt it works.

@stellarspot
Copy link
Contributor Author

There is one more example where pattern r: (* work in _*) '_0 is a great company! does not generalize to Alice works in HardMegaCorp.. So it works with I work in and not with Alice works in:

(use-modules
 (opencog)
 (opencog nlp)
 (opencog nlp relex2logic)
 (opencog openpsi)
 (opencog ghost)
 (opencog ghost procedures)

 (opencog exec)
)

(ghost-parse "
r: (* work in _*) '_0 is a great company!
  ^keep()
")

; Disable the ECAN related config for now
(ghost-set-sti-weight 0)
(ghost-af-only #f)

(ghost-run)

(ghost "I work in SoftMegaCorp.")
(sleep 1)
(ghost "Alice works in HardMegaCorp.")
(sleep 1)
(ghost-halt)

@linas linas added the ghost label Jun 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants