do all open predicates need to be targets?

50 views
Skip to first unread message

pli...@gmail.com

unread,
Jun 13, 2019, 6:47:41 AM6/13/19
to PSL Users

I'm currently doing some experiments with a small PSL model for named entity recognition. The current idea is to start with the results from an existing named entity recogniser (e.g. from Spacy) but add a constraint stating that the labels should be consistent across a document (to make sure "London" is not labelled "LOC" somewhere in the document and "ORG" somewhere else).

Here's my model:

# For each entity E, the label probabilities should sum to 1
EntityLabel(E, +Label) = 1.

# Transfer the label outputs from Spacy to the EntityLabel predicate
2: EntityLabel_Spacy(E, Label) -> EntityLabel(E, Label) ^2

# We define a predicate DocLevelLabel expressing the distribution of labels for a given text chunk, such as "London"
DocLevelLabel(Text, Label) = 1/|E| EntityLabel(+E, Label). {E: EntityText(E, Text)}

# We add a soft constraint to increase the probability of consistent labels
1: DocLevelLabel(Text, Label) & EntityText(E, Text) -> EntityLabel(E, Label) ^2


Here's my data file:

predicates:
EntityLabel/2: open
DocLevelLabel/2: open
EntityLabel_Spacy/2: closed
EntityText/2: closed

observations:
EntityLabel_Spacy : EntityLabel_Spacy_obs.txt
EntityText : EntityText_obs.txt

targets:
EntityLabel : EntityLabel_targets.txt

With this data file, the label consistency constraint does not seem to work unfortunately. But if I also add DocLevelLabel as a target in the data file, the problem strangely disappears.

So here's my question: do all open predicates need to be explicitly specified as targets, even though we are not interested in inferring their values (as is the case for DocLevelLabel, which is just a latent variable)?


Eriq Augustine

unread,
Jun 13, 2019, 10:48:15 AM6/13/19
to pli...@gmail.com, PSL Users
Hey,

The short answer is yes, you should explicitly specify all your inference targets.
This thread has a more complete answer:

-eriq

--
You received this message because you are subscribed to the Google Groups "PSL Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psl-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/psl-users/1be83602-9c73-472a-8894-548e40be8e3f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages