Transcript Document

ConceptNet
Outline
• What is commonsense?
• Representative research on commonsense
• Open Mind Common Sense (OMCS)
• ConceptNet
• LiftNet
• StoryNet
• Practice
• Summary
What is commonsense?
• Beliefs or propositions that seem, to most people, to be prudent and of sound
judgment, without dependence upon esoteric knowledge
• Exhibiting native good judgment
– Arrive home at a reasonable hour
– Commonsense scholarship on the foibles of a genius
– Unlearned and commonsensical countryfolk were capable of solving problems that
beset the more sophisticated
• Commonsense reasoning is the branch of Artificial intelligence concerned
with replicating human thinking
– Developing adequately broad and deep commonsense knowledge bases.
– Developing reasoning methods that exhibit the features of human thinking,
including:
• The ability to reason with knowledge that is true by default
• The ability to reason rapidly across a broad range of domains
• The ability to tolerate uncertainty in your knowledge
– Developing new kinds of cognitive architectures that support multiple reasoning
methods and representations
Projects to Collect Commonsense
• Cyc
– Started in 1984 by Dr. Doug Lenat
– Developed by CyCorp, with 3.2 millions of assertions linking over 280.000 concepts
and using thousands of micro-theories.
– Cyc-NL is still a “potential application”, knowledge representation in frames is quite
complicated and thus difficult to use.
• Open Mind Common Sense Project
– Started in 2000 at MIT by Push Singh
– WWW collaboration with over 20,123 registered users, who contributed 812,769
items
– Used to generate ConceptNet, very large semantic network.
• Other such projects
– HowNet (Chinese Academy of Science)
– FrameNet (Berkley)
Open Mind Common Sense (OMCS)
• 750k NL assertions from 15k contributors (Initial stage)
• ConceptNet
– A semantic net built from these
– 20 link types
ConceptNet
• Common sense knowledge base with NLP capability
– Much needs to be examined
– Uncontrolled vocabulary, can be biased in terms of content; but seems quite
reliable knowledge
• Extracted automatically from common sense knowledge expressed in semistructured NL sentences from OMCSNet (open mind common sense) –
applying about 50 extraction rules
– ”The Effect of [falling off a bike] is [you get hurt].”
– ”A lime is a very sour fruit” at OMCS is extracted into two assertions
• IsA (lime, fruit)
• PropertyOf (lime, very sour)
• Commonsense knowledge covering aspects of everyday life
–
–
–
–
–
Spatial
Physical
Social
Temporal
psychological
Twenty Semantic Relation Types in ConceptNet (Liu and Singh, 2004)
THINGS
(52,000 assertions)
EVENTS
(38,000 assertions)
AGENTS
(104,000 assertions)
SPATIAL
(36,000 assertions)
TEMPORAL
time & sequence
IsA: (IsA "apple" "fruit")
Part of: (PartOf "CPU" "computer")
PropertyOf: (PropertyOf "coffee" "wet")
MadeOf: (MadeOf "bread" "flour")
DefinedAs: (DefinedAs "meat" "flesh of animal")
PrerequisiteeventOf: (PrerequisiteEventOf "read letter" "open envelope")
SubeventOf: (SubeventOf "play sport" "score goal")
FirstSubeventOF: (FirstSubeventOf "start fire" "light match")
LastSubeventOf: (LastSubeventOf "attend classical concert" "applaud")
CapableOf: (CapableOf "dentist" "pull tooth")
LocationOf: (LocationOf "army" "in war")
CAUSAL
(17,000 assertions)
AFFECTIONAL
(mood, feeling, emotions)
(34,000 assertions)
FUNCTIONAL
(115,000 assertions)
EffectOf: (EffectOf "view video" "entertainment")
DesirousEffectOf: (DesirousEffectOf "sweat" "take shower")
DesireOf (DesireOf "person" "not be depressed")
MotivationOf (MotivationOf "play game" "compete")
ASSOCIATION
K-LINES
(1.25 million assertions)
SuperThematicKLine: (SuperThematicKLine "western civilization" "civilization")
ThematicKLine: (ThematicKLine "wedding dress" "veil")
ConceptuallyRelatedTo: (ConceptuallyRelatedTo "bad breath" "mint")
IsUsedFor: (UsedFor "fireplace" "burn wood")
CapableOfReceivingAction: (CapableOfReceivingAction "drink" "serve")
ConceptNet Example
ConceptNet Function
• Inference
– Spreading activation: Node-activation radiating outward from an origin code
• GetContext (node)
• GetAnalogousConcept (node)
– Graph traversal:
• FindPathBetweenNodes (node1, node2)
• Support
–
–
–
–
–
Topic sensing
Query expansion
Semantic similarity of words
Lexical generalization
Thematic generalization
Snapshot of ConceptNet
ConceptNet Performance
ConceptNet Application
• Commonsense ARIA
– Observes a user writing an e-mail and proactively suggests photos relevant to the
user’s story
– Bridges semantic gaps between annotations and the user’s story
• GOOSE
– A goal-oriented search engine for novice users
– Generate the search query
• MAKEBELIEVE
– Story-generator that allows a person to interactively invent a story with the system
– Generate causal projection chains to create storylines
• GloBuddy: A dynamic foreign language phrasebook
• AAA: Rrecommends products from Amazon.com by using ConceptNet to
reason about a person’s goals and desires,creating a profile of their predicted
tastes.
Reasoning in LifeNet
• LifeNet : A large-scale temporal graphical model expressed in terms of
egocentric propositions of the form
–
–
–
–
–
I am at a restaurant
I eat a sandwich
It is 3 pm
It is raining outside
I feel frightened
• Temporal reasoning
–
–
–
–
–
–
Prediction : Guess what might be true in the next moment
Elaboration : Guess what else might be true now
Explanation : Guess at what happened prior to the current event
Projection : Guess what series of events might follow
Filtering : Filter unlikely current states or events
Fixed-lag smoothing : Filter unlikely past states or events
StoryNet
• StoryNet builds on LifeNet and
ConceptNet
• ConceptNet lays out the
possibilities for ordering elements
–
–
–
–
I want to drive a car
I ned gasoline
Gasoline can be found in a plane
A plane can be found in the sky
Collaboartion of Three Nets
Demos
• Video of Henry Lieberman's lecture on Applying Common Sense Reasoning
in Interactive Applications:
http://helix.media.mit.edu/ramgen/insite/exa/2003/lieber-2003-02-26.rm
• http://web.media.mit.edu/~lieber/Lieberary/Mondrian/Knowacq.mov
– A User Interface for Knowledge Acquisition from Video
• http://agents.media.mit.edu/projects/voice/
– CS reasoning for better voice recognition
– ConceptNet - to disambiguate phonetically similar words and improve overall
recognition accuracy
• http://web.media.mit.edu/~lieber/Lieberary/Lieberary.html
Installation
• 파이썬 설치 (python-2.4.3.msi)
• 컨셉넷 설치 (ConceptNet2.1.zip)
– Montylingua: 문장 분석 모듈
– ConceptNet
• 기본 실행 소스 (*.py)
–
–
–
–
ConceptNetGUI.py
ConceptNetXMLRPCServer.py
ConceptNetDB.py
ConceptNetNLTools.py
• 기본 DB 소스 (*.txt)
–
–
–
–
predicates_concise_kline.txt
predicates_concise_nonkline.txt
predicates_nonconcise_kline.txt
predicates_nonconcise_nonkline.txt
Practice
ConceptNetGUI.py
Practice
ConceptNetXMLRPCServer.py
import sys
import ConceptNetDB
import DocXMLRPCServer
pred_filename = "predicates.txt"
if len(sys.argv)>0 and sys.argv[-1][-1*len('.py'):].lower()!='.py':
pred_filename = sys.argv[-1]
print "Syntax: python ConceptNetXMLRPCServer.py [predicates_file]"
print "Loading Predicates from %s..."%pred_filename
c =ConceptNetDB.ConceptNetDB(None,pred_filename)
print "Starting XML-RPC Server"
port = 8000
xmlrpc = DocXMLRPCServer.DocXMLRPCServer(('',port))
print "Now serving on localhost port %s!"%str(port)
xmlrpc.register_introspection_functions()
xmlrpc.register_instance(c)
xmlrpc.register_instance(c.nltools)
xmlrpc.serve_forever()
• ConceptNetDB.py (http://주소:port), ex: http://165.132.140.237:8000
• ConceptNetNLTools.py (http://주소/port), ex: http://165.132.140.237:8001
Practice
Wrapper Modules
• Python: 기본 동작 시스템
– XML-RPC: 모듈간 통신 모듈
• C#
– 소스
• CookComputing.XmlRpc.dll
• ConceptNetEx2.exe
– 기본 제공 함수
• guess_mood, guess_topic, guess_concept, summarize_document, tag,
get_analogous_concepts, get_context, get_all_projections, project_affective,
project_consequences, project_details, project_spatial
• C++: Pipe 연결 (XML RPC는 Visual C++ 지원 안함)
– 소스: concept_cpp_interface.h
– 사용방법
•
•
•
•
•
#include "concept_cpp_interface.h“
ConceptNetCPPInterface ci;
ci.setCommend(type, query);
ci.executeCN();
ci.mt, ci.tt, ci.ct, ci.at, ci.cxt, ci.pt, ci.aft, ci.cqt, ci.dt, ci.st
• 기타방법: Python과 C++ 직접 연동해서 사용하기 (문의: 송인지)
Practice
Example: 장소 질의 확장
Practice
Summary
• Little new work on the practical commonsense reasoning
• Building practical commonsense reasoning systems using unconventional
techniques
– Representing knowledge in natural language
Distributing knowledge acquisition to non-experts via the World Wide Web
– Developing reasoning techniques that work successfully with large and imperfect
knowledge bases.
• Lots of possibility with commonsense reasoning