I study Question-Answering system in SPA, and I have used Nengo.spa module not Nengo_spa so far.
I have some questions about nengo_spa modules.
Q1. How to define SP(Semantic Pointer) for sentences.
Especially, I’m interested in Question-Answering for sentence. In Nengo.spa module, I can define SP for sentence with vocab.add method as follows:
import nengo.spa as spa vocab = spa.Vocabulary(dimensions=64) vocab.add('Sentence1',vocab.parse('The_Dog*Agt_Chase + Chase*Verb + The_Boy*Theme_Chase').v)
Like this, in Nengo.spa module, I don’t have to declare individual phrase (like The_Dog, Agt_Chase, Chase, and so on) in advance. However, in Nengo_spa module, the following code causes error:
import nengo_spa as spa vocab = spa.Vocabulary(dimensions=64) vocab.add('Sentence1',vocab.parse('The_Dog*Agt_Chase + Chase*Verb + The_Boy*Theme_Chase').v)
and the error is:
SpaParseError: Error parsing expression 'The_Dog*Agt_Chase + Chase*Verb + The_Boy*Theme_Chase' with 64-dimensional vocab at 0x107826eb8: name 'The_Dog' is not defined
This error tells that SP for The_Dog is not defined. So, I must do
phrase = ['The_Dog','Agt_Chase','Chase','Verb','The_Boy','Theme_Chase'] vocab.populate(';'.join(phrase))
before using vocab.add method. So is there good way for defining SP for sentence?
Q2. Is there the way for clean-up of the SP which is the result of unbinding?
I try to get an appropriate phrase SP by unbinding a complex sentence SP with a cue SP.
For example, a complex sentence is :
A*B + C*D + E*(F*G + H*I + J*(K*L + M*N + O*P))
and unbind it with
E*J*O to get
P. Then, this is more difficult than unbinding with
C to get
D because of much noises.
Can I get appropriate SP
P with clean-up, like “unbinding with E” → “clean-up” → "unbinding with J"→ “clean-up” → unbinding with O?
If so, I don’t know how to implement.
Q3. Finally, which is better nengo.spa module and nengo_spa module?