1 / 28

Text Generation for Instances in the Component Library

Text Generation for Instances in the Component Library. Ken Barker, Jarred McGinnis Monday afternoon. Outline. Motivation Why UT is doing text generation Interface What goes in and what comes out Customization How to adapt for new classes Future Work What to do next. Motivation.

Angelica
Download Presentation

Text Generation for Instances in the Component Library

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Text Generation for Instances in the Component Library Ken Barker, Jarred McGinnis Monday afternoon

  2. Outline • Motivation • Why UT is doing text generation • Interface • What goes in and what comes out • Customization • How to adapt for new classes • Future Work • What to do next

  3. Motivation • the point of SHAKEN is to make formal KR palatable to normal people, mostly through graphical I/O (CMAPs) • there are many places where even a CMAP is too clunky or inappropriate • English text is still the most efficient way to describe some bit of knowledge • interpreting English is still too hard • generating English from KM is a little easier

  4. This? (*Manny has (instance-of (Person)) (trait ((aTrait-Value with (value (*lazy))))) (size ((a Size-Value with (value ((:pair *big Person))))))) (_Cage44 has (instance-of (Cage))(is-possessed-by ((a Hamster with(is-possessed-by (*Manny))))) (smell ((a Smell-Value with (value (*stinky))))) (capacity ((a Capacity-Value with (value ((:pair *capacious Cage)))))) (is-inside ((a Room))) (is-near ((a Door)))) or This? “Manny’s hamster’s capacious stinky cage is near the door and inside the room.” Still Not Convinced?

  5. Shouldn’t This be part of SHAKEN? • no. • the lexicon and grammar rules are specific to components • each component must be responsible for its own text generation • any class can define its own text generation words, phrases and rules

  6. Generic vs. Component-Specific • generic: • “Theentitymove-intosthetangible-entitywith respect to thetangible-entityalong thespatial-entity.” • component-specific: • “Theagentmovestheobjectinto thecontainerthrough theportal.” • “Theentitylet-fallsthetangible-entity.” • “Theagentletstheobjectfall.” • “Thetangible-entityis receivedto the tangible-entityfrom the tangible-entity.” • “The recipientreceivesthe objectfrom the donor.”

  7. Outline • Motivation • Why UT is doing text generation • Interface • What goes in and what comes out • Customization • How to adapt for new classes • Future Work • What to do next

  8. Interface • every instance of Entity and Event has a slot called text-gen • the text-gen of an Event is a sentence • a single clause with the Event as the main verb and select EventEntity slots as arguments • can be redefined by any class • the text-gen of an Entity is a noun phrase • the Entity is the head noun, some property values are premodifiers, some EntityEntity slots are postmodifiers, determiner may include is-possessed-by • can be redefined • the text-sentence of an Entity is its text-gen reworded as a sentence • can be redefined

  9. The text-gen of Entities • for named instances… just the name! KM> (the text-gen of *Manny)("manny") • for anonymous instances… • <determiner> <premods> <head> <postmods> KM> (the text-gen of _Cage44)("manny's hamster'scapacious stinkycagenear the door and inside the room")

  10. The text-sentence of Entities • for named instances and anonymous instances… • <determiner> <premods> <head> “is” <postmods> KM> (the text-sentence of _Cage44)("manny's hamster'scapacious stinkycage is near the door and inside the room.") • <determiner> <head> “is” <postmods> KM> (the text-sentence of _Room74)("Theroom is inside the house.") • <determiner> <head> “is” <premods> KM> (the text-sentence of *Manny)("Manny is big and lazy.") • <determiner> <head> “is a” <Classes> KM> (the text-sentence of _Hamster43)("manny's hamster is a hamster.")

  11. Heads • for named instances… just the name! • for anonymous instances… • <Class> (<u-called> or <called>) • for very general Entities (E, T-E, I-E, S-E, P) <Class> is the Role played by the Entity • otherwise, <Class> is one of the instance-of KM> (make-phrase (the text-head of (a Boy called "Sue")))("boy (called Sue)") KM> (make-phrase (the text-head of (a Entity with (plays ((a Container))))))("container")

  12. Postmods • is-part-of, material, content,+ spatial rels (is-above, etc.) • any class can define its own postmod slots • for each of these slots that has a value… • <the (the text-slot of It) of Self> “the” <the It of Self> KM> (the text-slot of is-part-of)(text-is-part-of) KM> (the text-is-part-of of (a Knob))("part of") KM> (the is-part-of of (a Knob))(_Door189) KM> (make-phrase (the text-postmods of (a Knob))) ("part of the door")

  13. Premods • the properties (color, length, sex, etc.) • for scalars… • <scalar constant> only when the reference class is the same as the instance-of of the Entity • for categoricals… • <categorical constant> KM> (make-phrase (the text-premods of (*Manny)))("big lazy")

  14. Determiners • for named instances • <> • for anonymous instances • if the Entity is-possessed-by P • <P’s <determiner> + <head>> “ ’s ” • otherwise “the” or “a” KM> (make-phrase (the text-def-determiner of (_Hamster43)))("manny's") KM> (make-phrase (the text-def-determiner of (_Cage44)))("manny's hamster's") KM> (make-phrase (the text-indef-determiner of (a Door)))("a")

  15. The text-gen of Events • for “active” Events… • <subject> <active-verbseq> <d-obj> <arguments> KM> (the text-gen of _Move-Into49)("The agentmovesthe objectinto the container through the portal.") • for “passive” Events… • <d-obj> <passive-verbseq> <arguments> KM> (the text-gen of (a Move-Into))("The objectgets movedinto the container through the portal.")

  16. The <verbseqs> of Events • <active-verbseq> and <passive-verbseq> defined for every Event instance, with both singular and plural forms KM> (the text-gen of (a Break))("The object gets broken.") KM> (the text-gen of (a Break with (agent ((a Entity)))))("The agent breaks the object.") KM> (the text-gen of (a Break with (agent ((a Living-Entity) (a Substance)))))("The living-entity and the substance break the object.") KM> (the text-gen of (a Break with (object ((a Object) (a Bond)))))("The object and the bond get broken.")

  17. The <subject> of Events • <det>+<head> of the agent or instrument (or some other role) • for very general Entities, use the case name instead KM> (the text-gen of (a Move with (agent (_Hamster43))))("Manny's hamster moves the object.") KM> (the text-gen of (a Move with (instrument ((a Tangible-Entity with (plays ((a Vehicle))))))))("The vehicle moves the object.") KM> (the text-gen of (a Receive with (recipient (*Manny))))("Manny receives the object.")

  18. The <d-obj> of Events • <det>+<head> of the object (or some other role) • for very general Entities, use the case name instead • if there is no object, use “something” KM> (the text-gen of (a Move with (object (_Hamster43))))("Manny's hamster moves.") KM> (the text-gen of (a Move with (instrument ((a Tangible-Entity with (plays ((a Vehicle))))))))("The vehicle moves the object.") KM> (the text-gen of (a Produce))("The result gets produced from the raw-material.")

  19. The <arguments> of Events • <text-slot>+<slot> for some list of slots • for very general Entities, use the case name instead KM> (the text-gen of (a Store with (base ((a Tangible-Entity)))))("The object gets stored in the base.") KM> (the text-gen of (a Withdraw with (base ((a Tangible-Entity)))))("The object gets withdrawn from the base.") KM> (the text-gen of (a Enter with (base ((a Tangible-Entity))))) ("The object enters the container through the portal.") KM> (the text-gen of _Move138)("The wheel moves manny's hamster from the cageto the door.")

  20. text-particle • one more thing… • some verbs have particles that are part of the verbseq, but may be separated from the main verb • look up a number  look it up • the text-particle slot can appear anywhere among the arguments KM> (the text-gen of (a Knock-Down))("Something getsknockeddown.") KM> (the text-gen of (a Knock-Down with (agent ((a Entity))) (object ((a Object)))))("The agent knocks the object down.")

  21. The text-gen of States • mostly covered by the text-gen of Events • the <active-verbseq> is by default “keeps” • the <passive-verbseq> is by default “is” • the state itself is handled by text-particle KM> (the text-gen of (a Be-Accessible))("The object isaccessible.") KM> (the text-gen of (a Be-Accessible with (agent ((a Entity)))))("The agent keeps the object accessible.")

  22. Outline • Motivation • Why UT is doing text generation • Interface • What goes in and what comes out • Customization • How to adapt for new classes • Future Work • What to do next

  23. Customizing Text Generation • the text generation system involves 33 special slots that specify the words used in text generation and the rules for combining them • all slots are inherit-with-overrides so any subclass can redefine any part of text generation • all slots are dont-cache-values so when instances change their text-gen changes

  24. Roll Your Own • usually the inherited text generation machinery is good enough for new classes KM> (Sneak-In has (superclasses (Enter)))(Sneak-In) KM> (the text-gen of (a Sneak-In with (base ((a Theater)))))("The object enters the theater through the portal.")

  25. Roll Your Own (cont.) • customizing text generation for a new Event class usually involves changes to only a few “lexicon” slots KM> (every Sneak-In has (text-active-verbseq-sg ("sneaks")) (text-active-verbseq-pl ("sneak")) (text-base ("into")))(Sneak-In) KM> (the text-gen of (a Sneak-In with (base ((a Theater)))))("The object sneaks into the theater through the portal.")

  26. Roll Your Own (cont.) • sometimes customization demands more KM> (Bequeath has (superclasses (Action))) KM> (every Bequeath has (donor ((a Entity))) (recipient ((a Entity)))) KM> (the text-gen of (a Bequeath))("Something has bequeath done to it.") KM> (every Bequeath has (text-active-verbseq-sg ("bequeaths")) (text-active-verbseq-pl ("bequeath")) (text-passive-verbseq-sg ("is bequeathed")) (text-passive-verbseq-pl ("are bequeathed")) (text-subj ((the donor of Self))) (text-argslots ((:seq recipient instrument))) (text-recipient ("to")) (text-instrument ("in"))) KM> (the text-gen of (a Bequeath with (object ((a Money))) (instrument ((a Will)))))("The donor bequeaths the money to the object in the will.")

  27. Outline • Motivation • Why UT is doing text generation • Interface • What goes in and what comes out • Customization • How to adapt for new classes • Future Work • What to do next

  28. Future Work • stop working on text gen, dammit!

More Related