How to handle input data that has an ID?

180 views
Skip to first unread message

Vishnu Priya

unread,
Feb 27, 2017, 5:29:15 AM2/27/17
to opencog
Hello all,

I have a knowledge base, in which each sentence is implicitly associated with an ID which is of the type long int. 
As far as i know, we can parse only the straight sentences through NLP pipeline. But i want to process the sentences along with their Ids.  is it possible to do so?

Oranges are sweet - Input
787899993322 - ID

Oranges are sweet has 787899993322 / Oranges are sweet belongs to 787899993322
How about passing above such sentences through NLP ?
Is there any other way around?

Whatever i do (Forward/backward Chaining,  stimulating etc...),  i should be to able to know which atoms are of which ID. 

How can i adapt opencog ? Should i write some code on top of it? or is it totally un-doable?


Thanks,
Vishnu

Roman Treutlein

unread,
Feb 27, 2017, 6:36:18 AM2/27/17
to opencog
When the work on protoAtoms and Valuations is done you could use those to cleanly implement what you want.
Currently, I would write the id in a ConceptNode or NumberNode and associate it with the sentence using an AssociativeLink.
You would likely have to write some custom code to do that.

Vishnu Priya

unread,
Feb 27, 2017, 10:29:45 AM2/27/17
to opencog

Thanks for the reply, Roman. 

So, should it be like this

(EvaluationLink
HebbianLink
   (PredicateNode "sweet@3fe00455-333f-4cd8-a488-1d23f81c4546")
   (ListLink
      (ConceptNode "oranges@33c76dd3-d3c1-4e38-b2ba-b77abfbebadb")
      (NumberNode  7878
   )
  
In general, i parse and get r2l output of the sentence. Then i can apply a custom code to get the HebbianLink and the NumberNode ?



Vishnu Priya

unread,
Feb 28, 2017, 3:18:46 PM2/28/17
to opencog


i tried FC using the knowledge which has NumberNodes that are associated with the ConceptNodes through HebbianLink. I applied deduction rule and got an empty SetLink.

Knowledge:

(ConceptNode "Socrates" (stv .001 0.9))
(ConceptNode "Einstein" (stv .001 0.9))
(ConceptNode "Peirce" (stv .001 0.9))
(ConceptNode "man" (stv .01 0.9))
(ConceptNode "human" (stv .02 0.9))


(InheritanceLink (stv 0.9 0.9)
    (ConceptNode "Socrates")
    (ConceptNode "man"))

(HebbianLink (stv 0.9 0.9)
    (ConceptNode "Socrates")
    (ConceptNode "man")
    (NumberNode "8787"))

(InheritanceLink (stv 0.9 0.9)
    (ConceptNode "Einstein")
    (ConceptNode "man"))

(HebbianLink (stv 0.9 0.9)
    (ConceptNode "Einstein")
    (ConceptNode "man")
    (NumberNode "8787"))

(InheritanceLink (stv 0.9 0.9)
    (ConceptNode "Peirce")
    (ConceptNode "man"))

(HebbianLink (stv 0.9 0.9)
    (ConceptNode "Peirce")
    (ConceptNode "man")
    (NumberNode "8787"))

(InheritanceLink (stv 0.9 0.9)
    (ConceptNode "man")
    (ConceptNode "human"))

(HebbianLink (stv 0.9 0.9)
    (ConceptNode "man")
    (ConceptNode "human")
    (NumberNode "8787"))

(InheritanceLink (stv 0.9 0.9)
    (ConceptNode "Einstein")
    (ConceptNode "violin-players"))

(HebbianLink (stv 0.9 0.9)
    (ConceptNode "Einstein")
    (ConceptNode "violin-players")
    (NumberNode "8787"))


(define source
    (InheritanceLink
        (ConceptNode "Einstein")
        (ConceptNode "man")
        (NumberNode "8787")
    )
)


Where is it wrong in including ID?


Thanks,
Vishnu

Roman Treutlein

unread,
Mar 1, 2017, 4:23:47 PM3/1/17
to opencog
Well first of all, using a HebbianLink doesn't make sense you want a AssociativeLink.

And then it should kinda look like this:

(AssociativeLink (stv 0.9 0.9)
    (InheritanceLink (stv 0.9 0.9)
        (ConceptNode "Einstein")
        (ConceptNode "violin-players")
    )
    (NumberNode "8787")
)

Nil Geisweiller

unread,
Mar 3, 2017, 1:04:21 AM3/3/17
to ope...@googlegroups.com


On 02/28/2017 10:18 PM, Vishnu Priya wrote:
> (define source
> (InheritanceLink
> (ConceptNode "Einstein")
> (ConceptNode "man")
> (NumberNode "8787")
> )
> )

This inheritance link is ill-formed, it should only take 2 arguments. We
plane to automatically type check that sort of thing, for now you can
refer to http://wiki.opencog.org/w/Category:Atom_Types

Or maybe you meant HebbianLink. There are no PLN rule to reason on
hebbian links yet. This would help OpenCog to reason about attention
allocation, possibly reasoning itself, but I suppose that is not what
you had in mind.

Nil

>
>
> Where is it wrong in including ID?
>
>
> Thanks,
> Vishnu
>
>
>
> n Monday, 27 February 2017 16:29:45 UTC+1, Vishnu Priya wrote:
>
>
> Thanks for the reply, Roman.
>
> So, should it be like this
>
> (EvaluationLink
> HebbianLink
> (PredicateNode "sweet@3fe00455-333f-4cd8-a488-1d23f81c4546")
> (ListLink
> (ConceptNode "oranges@33c76dd3-d3c1-4e38-b2ba-b77abfbebadb")
> (NumberNode 7878
> )
>
> In general, i parse and get r2l output of the sentence. Then i can
> apply a custom code to get the HebbianLink and the NumberNode ?
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "opencog" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to opencog+u...@googlegroups.com
> <mailto:opencog+u...@googlegroups.com>.
> To post to this group, send email to ope...@googlegroups.com
> <mailto:ope...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/opencog.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/opencog/4ac85586-afcf-409a-9e35-4769e7313531%40googlegroups.com
> <https://groups.google.com/d/msgid/opencog/4ac85586-afcf-409a-9e35-4769e7313531%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

Vishnu Priya

unread,
Mar 3, 2017, 4:14:34 AM3/3/17
to opencog
Associative Link seems to solve my probleam. Let me try like this and get back to you.

Vishnu Priya

unread,
Mar 3, 2017, 4:28:28 AM3/3/17
to opencog


  Yeah. True!! Inheritance Link takes only two arguments.
My inputs belongs to certain ID. So somehow i want to associate my input with ID.  It seems that, i could use AssociativeLink as Roman said. Then probably i could do PLN reasoning. But Are there PLN rules that work for such input?


Thanks
Vishnu

Nil Geisweiller

unread,
Mar 3, 2017, 9:51:53 AM3/3/17
to ope...@googlegroups.com
PLN doesn't have any rule to reason about AssociativeLinks. To have some
we'd need to define its semantics.

Maybe what you want is http://wiki.opencog.org/w/DefineLink

I haven't experimented much with these, but they are apparently well
supported by the pattern matcher, and since the rule engine is built on
top of the pattern matcher I assume it should work well with it.

Nil

>
>
> Thanks
> Vishnu
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "opencog" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to opencog+u...@googlegroups.com
> <mailto:opencog+u...@googlegroups.com>.
> To post to this group, send email to ope...@googlegroups.com
> <mailto:ope...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/opencog.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/opencog/dcf69018-27e7-4022-80bf-103fb0866a9f%40googlegroups.com
> <https://groups.google.com/d/msgid/opencog/dcf69018-27e7-4022-80bf-103fb0866a9f%40googlegroups.com?utm_medium=email&utm_source=footer>.

Vishnu Priya

unread,
Mar 14, 2017, 10:35:26 AM3/14/17
to opencog
Hi,

I tried DefineLink. But the problem is i can define my ID only once. Since it is used to give an unique name. 

(DefineLink
(DefinedSchemaNode "ID1")
(InheritanceLink (stv 0.9 0.9)
    (ConceptNode "Einstein")
    (ConceptNode "man")))

(DefineLink
(DefinedSchemaNode "ID1")
(ListLink
    (ConceptNode "Peirce")
    (ConceptNode "man")))

I cannot do the above assigning  same IDs in two different places. It throws an Exception saying  ID1 is already defined. 

Is there exists something,  so that i can handle such situation?

Thanks,
Vishnu







Linas Vepstas

unread,
Mar 14, 2017, 10:48:12 PM3/14/17
to opencog
On Fri, Mar 3, 2017 at 10:51 PM, 'Nil Geisweiller' via opencog <ope...@googlegroups.com> wrote:


PLN doesn't have any rule to reason about AssociativeLinks. To have some we'd need to define its semantics.

I think they're called association links.

It might be interesting to have a demo that shows how to add new rules to PLN ... in my imagination, I assume that perhaps biology data or something like that might need new rules that are not a part of the default PLN.  I have no clear idea of how or why, but it seems like it could happen.

It might also be intesting to know how to disable certain PLN rules ...

--linas

Linas Vepstas

unread,
Mar 14, 2017, 10:54:53 PM3/14/17
to opencog
There are many ways of doing this.  The simplest one is probably this:

(EvaluationLink
     (PredicateNode "Vishnu's special ID43")

     (InheritanceLink (stv 0.9 0.9)
          (ConceptNode "Einstein")
          (ConceptNode "man"))))

which is conceptually the same thing as

(VishnuSpecialLink
    (PredicateNode "ID43")

    (InheritanceLink (stv 0.9 0.9)
       (ConceptNode "Einstein")
       (ConceptNode "man"))))

--linas

--
You received this message because you are subscribed to the Google Groups "opencog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opencog+unsubscribe@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages