Teadmiste formaliseerimine: erinevus redaktsioonide vahel

Allikas: Lambda
Mine navigeerimisribale Mine otsikasti
Resümee puudub
95. rida: 95. rida:




== Lecture block 1: basics and representing simple facts. ==
== Block 1: knowledge in the SQL and document databases and hybrids. ==




=== Lectures 1 and 2: Overview of the course. Background and basics: SQL, logic, NLP ===
=== Lecture: Overview of the course. Knowledge in SQL, Background and basics: SQL, logic, NLP ===


Lecture materials:
Lecture materials:
* [[Media:Kr_lect_1b.ppt| intro, sql, logic, NLP]]
* [[Media:Kr_lect_1b.ppt| intro, sql, logic, NLP]]
* [[Nosql links and notes]]


 
=== Lecture: RDF and RDFS (and OWL) ===
=== Lecture 2: RDF and RDFS (and OWL) ===


Lecture materials:
Lecture materials:
* [[Media:Kr_lect_2b.ppt| schemaless databases, RDF and RDFS]]
* [[Media:Kr_lect_2b.ppt| schemaless databases, RDF and RDFS]]
* [[Nosql links and notes]]


== Lecture block 2: capturing meaning in natural language ==
== Block 2: simple facts and rules in symbolic AI and logic
 
== Block 3: General-knowledge databases
 
=== Lecture: First look into main large knowledge bases ===
 
We will have a look at the goals, main content and differences between:
 
* [https://wordnet.princeton.edu/ wordnet]
* [https://wiki.dbpedia.org/ dbpedia]
* [https://www.mpi-inf.mpg.de/departments/databases-and-information-systems/research/yago-naga/yago/ yago]
* [https://en.wikipedia.org/wiki/BabelNet babelnet]
* [http://conceptnet5.media.mit.edu/ conceptnet]
* nell in [https://en.wikipedia.org/wiki/Never-Ending_Language_Learning wiki] and [https://cacm.acm.org/magazines/2018/5/227193-never-ending-learning/fulltext a good paper]. The [http://rtw.ml.cmu.edu/ nell website] is currently down.
* [https://en.wikipedia.org/wiki/Cyc cyc]
 
=== Lecture 6: Big annotation systems and intro to rule reasoners ===
 
First, big annotation systems:
* [https://developers.google.com/search/docs/guides/intro-structured-data Google structured data] on the webpage.
* [https://developers.facebook.com/docs/sharing/webmasters/ Facebook Open Graph markup] on the webpage.
 
In connection, see also:
* [http://schema.org schema.org]: property markup vocabulary suggested by Google, Microsoft and others.
* [https://json-ld.org/ json-ld]: currently most popular rdf syntax (in json), also recommended by Google.
 
== Block 4: natural language and question answering ==


=== Lecture 3: Intro to homework and NLP ===
=== Lecture: Intro to homework and NLP ===


Lecture materials:
Lecture materials:
119. rida: 144. rida:
* start reading the Jurafsky and Martin book (see links above)
* start reading the Jurafsky and Martin book (see links above)


=== Lecture 4: vector representation of words ===
=== Lecture: vector representation of words ===


This lecture will be given by Priit Järv.
This lecture will be given by Priit Järv.
143. rida: 168. rida:
*[https://yurichev.com/blog/markov/ Autocomplete using Markov chains]
*[https://yurichev.com/blog/markov/ Autocomplete using Markov chains]


== Lecture block 3 and start of 4: large common-sense knowledge bases and reasoning ==


=== Lecture 5: First look into main large knowledge bases ===
== Block 5: reasoners and symbolic question answering ==
 
Intro to rule reasoners:
* [[Media:Kr_lect_5a.pptx| Lecture material as ppt]] or as [[Media:Kr_lect_5a.pdf| pdf]]


We will have a look at the goals, main content and differences between:
Additionally you may want to look at:
* [http://lambda.ee/w/images/0/06/Geoffreasoningnotes.pdf automated reasoning tutorial by Geoff]
 
Please have a look and run the same experiments yourself with the gkc prover:


* [https://wordnet.princeton.edu/ wordnet]
* [[Reasoner examples with gkc]]
* [https://wiki.dbpedia.org/ dbpedia]
* [https://www.mpi-inf.mpg.de/departments/databases-and-information-systems/research/yago-naga/yago/ yago]
* [https://en.wikipedia.org/wiki/BabelNet babelnet]
* [http://conceptnet5.media.mit.edu/ conceptnet]
* nell in [https://en.wikipedia.org/wiki/Never-Ending_Language_Learning wiki] and [https://cacm.acm.org/magazines/2018/5/227193-never-ending-learning/fulltext a good paper]. The [http://rtw.ml.cmu.edu/ nell website] is currently down.
* [https://en.wikipedia.org/wiki/Cyc cyc]


=== Lecture 6: Big annotation systems and intro to rule reasoners ===
Blocks world.


First, big annotation systems:
* [http://www.ee.pdx.edu/~mperkows/May4/005.Ch11-planning.ppt Old intro: planning and blocks world]
* [https://developers.google.com/search/docs/guides/intro-structured-data Google structured data] on the webpage.
* [https://developers.facebook.com/docs/sharing/webmasters/ Facebook Open Graph markup] on the webpage.


In connection, see also:
Some axiom sets:
* [http://schema.org schema.org]: property markup vocabulary suggested by Google, Microsoft and others.
* [[PLA001-0.ax]]
* [https://json-ld.org/ json-ld]: currently most popular rdf syntax (in json), also recommended by Google.
* [[PLA001-1.ax]]


Second, intro to rule reasoners:
And some planning problems to solve from these axiom sets:
* [[Media:Kr_lect_5a.pptx| Lecture material as ppt]] or as [[Media:Kr_lect_5a.pdf| pdf]]


Additionally you may want to look at:
* [[PLA004-1.p]]
* [http://lambda.ee/w/images/0/06/Geoffreasoningnotes.pdf automated reasoning tutorial by Geoff]
* [[PLA005-1.p]]
* [[PLA019-1.p]]


=== Lecture 7: rule reasoners ===
Also:


Please have a look and run the same experiments yourself with the gkc prover:
[[blocks world axiom/query examples from lecture|Alternative axiomatization]]


[[Reasoner examples with gkc]]
See [[how to run gkc on the Wordnet TPTP version]]


We use the [https://github.com/tammet/gkc gkc] prover for examples (instructions are in the Reasoner examples ... page above) but you could also try out an old classic prover [https://www.mcs.anl.gov/research/projects/AR/otter/ Otter] which actually works OK on windows even though it is really old.
We use the [https://github.com/tammet/gkc gkc] prover for examples (instructions are in the Reasoner examples ... page above) but you could also try out an old classic prover [https://www.mcs.anl.gov/research/projects/AR/otter/ Otter] which actually works OK on windows even though it is really old.


<!--
Some background links:
Use gkc prover version 0.1 alpha for experimentation:
* [[Media:gkc_01.zip]] gkc_01.exe for windows
* [https://github.com/tammet/gkc/releases gkc release for Linux]: download gkc_01 from assets.
* Read instructions for using gkc and examples [https://github.com/tammet/gkc/releases from the release]
-->
 
<!--
* First order logic: classical stuff


** [http://www.cs.unm.edu/~mccune/papers/robbins/ Otter solving an open problem in math]
** [http://www.cs.unm.edu/~mccune/papers/robbins/ Otter solving an open problem in math]
198. rida: 212. rida:
-->
-->


=== Lecture 8: starting to parse natural language for interaction with rule reasoners ===
=== Lecture: starting to parse natural language for interaction with rule reasoners ===


We will start building a tiny question-answering tool, translating natural language to rule reasoner input.
We will start building a tiny question-answering tool, translating natural language to rule reasoner input.
229. rida: 243. rida:
* [https://github.com/allenai/allennlp Allennlp] from the [https://allenai.org/ Allen Institute for AI]. See also their [https://github.com/allenai/acl2018-semantic-parsing-tutorial semantic parsing tutorial].
* [https://github.com/allenai/allennlp Allennlp] from the [https://allenai.org/ Allen Institute for AI]. See also their [https://github.com/allenai/acl2018-semantic-parsing-tutorial semantic parsing tutorial].


== Lecture block 5: context and uncertainty ==
== Lecture block 6: confidence and relevance ==
 
 
=== Lecture 9: intro to representing context and uncertainty ===
 
Blocks world.
 
* [http://www.ee.pdx.edu/~mperkows/May4/005.Ch11-planning.ppt Old intro: planning and blocks world]
 
Some axiom sets:
* [[PLA001-0.ax]]
* [[PLA001-1.ax]]
 
And some planning problems to solve from these axiom sets:
 
* [[PLA004-1.p]]
* [[PLA005-1.p]]
* [[PLA019-1.p]]


Also:


[[blocks world axiom/query examples from lecture|Alternative axiomatization]]  
See also [http://en.wikipedia.org/wiki/Default_logic default logic].


Next, starting uncertainty.
=== Lecture: various classical ideas for discrete reasoning with uncertainty ===
 
We will first look at [http://en.wikipedia.org/wiki/Default_logic default logic].
 
=== Lecture 10: various classical ideas for discrete reasoning with uncertainty ===


We will look at some discrete ways:
We will look at some discrete ways:
269. rida: 261. rida:
* [[Notes about numerical confidence, popularity, etc measures]]
* [[Notes about numerical confidence, popularity, etc measures]]


=== Lecture 11: various classical ideas for numeric reasoning with uncertainty ===
=== Lecture: various classical ideas for numeric reasoning with uncertainty ===


Classical numeric ways to reason about uncertainty:
Classical numeric ways to reason about uncertainty:
280. rida: 272. rida:
* [https://dtai.cs.kuleuven.be/problog/ Problog] start with a [https://dtai.cs.kuleuven.be/problog/tutorial.html tutorial]
* [https://dtai.cs.kuleuven.be/problog/ Problog] start with a [https://dtai.cs.kuleuven.be/problog/tutorial.html tutorial]


=== Lecture 12: seminar-kind of work on the second lab ===
Background to start with:
* Take and unpack [https://github.com/tammet/gkc/releases/download/v0.1-gamma/gkc.zip gkc.zip] from [https://github.com/tammet/gkc/releases/tag/v0.1-gamma gkc release gamma]
* Start with the example file p1.txt
<pre>
father(john,pete).
% either the first or a second or both facts are true:
father(pete,mark).
% equivalent to (father(X,Y) & father(Y,Z)) => grandfather(X,Z).
-father(X,Y) | -father(Y,Z) | grandfather(X,Z).
-grandfather(john,X) | ans(X).
</pre>
* Run <pre>gkc p1.txt</pre>


* Start with the trivial NLP-to-reasoner parser in python [[nlp.py]] .
== Lecture block 7: context, time, location, events, causality. ==


* Our initial goal is to process the text "John is a father of Andrew. Andrew is a man. Who is the father of Andrew?"
* [[Reasoner example created by nlp.py]]
* [[Reasoner example with some rules for relatives]]
And the examples with various ways to encode normal/abnormal cases (not really needed for lab):
* [[Reasoner example for being likely married]]: works out ok
* [[Reasoner example for birds]]: does not work out well
* [[Reasoner another example for birds]]: does not work out well
Syntax and command line:
* gkc command line: [https://github.com/tammet/gkc gkc readme in github]: see also Examples folder for a few trivial examples.
* For simple clausal syntax see [https://www.mcs.anl.gov/research/projects/AR/otter/otter33.pdf  otter manual] clause syntax.
* For complex syntax options see [http://tptp.cs.miami.edu/TPTP/TR/TPTPTR.shtml TPTP manual]: seems to be sometimes down.
=== Lecture 13: seminar-kind of work on the third lab ===
Ways to get external data in addition to our own rules and data:
* Raw data (hard to use): wikipedia, wikidata
* Processed raw data (a bit easier): dbpedia (processed wikipedia/wikidata)
* Well-formed and connected options (use one of these):
** [https://wordnet.princeton.edu/ wordnet]: exists in several versions, including an external [http://tptp.cs.miami.edu TPTP] version usable by the gkc reasoner, direct link to [http://tptp.cs.miami.edu/cgi-bin/SeeTPTP?Category=Axioms&File=NLP001+0.ax TPTP axiom NLP001+0.ax]
** [https://www.mpi-inf.mpg.de/departments/databases-and-information-systems/research/yago-naga/yago/ yago], connecting wikipedia with wordnet and geonames. Look at the [https://www.mpi-inf.mpg.de/departments/databases-and-information-systems/research/yago-naga/yago/downloads/ downloads section] SIMPLETAX and download [http://resources.mpi-inf.mpg.de/yago-naga/yago3.1/yagoSimpleTypes.tsv.7z yagoSimpleTypes] and [http://resources.mpi-inf.mpg.de/yago-naga/yago3.1/yagoSimpleTaxonomy.tsv.7z yagoSimpleTaxonomy].  You will need to write a program to filter and convert the yago datasets to the prover-understandable form. See [[some ideas for converting yago]].
See [[how to run gkc on the Wordnet TPTP version]]




[[Category:Kursus]]
[[Category:Kursus]]

Redaktsioon: 29. jaanuar 2020, kell 16:54

teadmised
teadmised

Name: Knowlege representation
Code: ITI8700
Link: http://lambda.ee/Teadmiste_formaliseerimine
Lecturer: Tanel Tammet
Practice work: Priit Järv
Contact: tanel.tammet@ttu.ee, 6203457, TTÜ ICT-426
Archives of previous years: 2019.

Time, place, result

Lectures: Friday 10:15-11:45 room ICT-315
Practical work: Friday 12:00-13:30 room ICT-315
Practical work will give 40% and exam 60% of points underlying the final grade. The exam will consist of several small excercises.

The first practical work time on 31. January at 12:00 will be used for introducin the practice work.

Some of the last lecture times at the end of the course may be used as additional seminars/labs.

Focus

The main focus of the course is on knowledge representation and reasoning (KR), a part of symbolic AI, on a spectrum from simple (representing and using knowledge in databases) to complex (meaning of sentences in natural language and commonsense knowledge).

The overall goal of the labwork to understand issues facing a task of building a natural language question answering system a la Watson and to see and experiment with existing parts of the solution.

The course contains the following blocks:

  • Representing knowledge in the SQL and document databases and hybrids.
  • Representing and using simple facts and rules in symbolic AI and logic.
  • General-knowledge databases: wikidata, wordnet, yago, conceptnet, nell, cyc.
  • Knowledge conveyed by natural sentences: both statistical methods like word2vec and logic-based methods.
  • Reasoners and question answering systems.
  • Confidence and relevance.
  • Context, time, location, events, causality.

Check out this description of the whole KR area.

Books to use

Observe that a noticeable part of the course contents are not covered by these books: use the course materials and links to papers, standards and tutorials provided.

Practical work

There are three labs. They are all steps in a single project: build a simple natural-language question-answering system.

The labs have to be presented to the course teachers and all students present at labwork time.

The labs can be prepared alone or by teams of two people.

First, read the explanation of the overall task for the recent 2019 course. The contents will me modified and updated for 2020. The following labs are steps on the path to the end goal.


First lab

Please read about the task for the first lab

Second lab

The task in the second lab is actually answering simple questions using logic and a small set of rules you write and a reasoner.

Please start by experimenting with a real prover: look and run Reasoner examples with gkc

We use the gkc prover for examples (instructions are in the Reasoner examples ... page above) but you could also try out an old classic prover Otter which actually works OK on windows even though it is really old.

Make sure to get the latest release of gkc from gkc releases (currently delta) and either download a binary or compile using instructions on the gkc github page. The basic instructions are also on the gkc github page. Also, see the few examples in the Examples folder.

Third lab

Add an NLP component to the second lab to answer questions posed in natural language, not logic.

You can use a trivial NLP-to-reasoner parser in python nlp.py as a starting point.

Have a look at the Lecture 12 materials.

Interesting large question-answering datasets and challenge problems: Stanford SQUAD, Allen institute arc2 challenge, Google natural questions, Fujitsu NLP challenge, amazon qa dataset


Block 1: knowledge in the SQL and document databases and hybrids.

Lecture: Overview of the course. Knowledge in SQL, Background and basics: SQL, logic, NLP

Lecture materials:

Lecture: RDF and RDFS (and OWL)

Lecture materials:

== Block 2: simple facts and rules in symbolic AI and logic

== Block 3: General-knowledge databases

Lecture: First look into main large knowledge bases

We will have a look at the goals, main content and differences between:

Lecture 6: Big annotation systems and intro to rule reasoners

First, big annotation systems:

In connection, see also:

  • schema.org: property markup vocabulary suggested by Google, Microsoft and others.
  • json-ld: currently most popular rdf syntax (in json), also recommended by Google.

Block 4: natural language and question answering

Lecture: Intro to homework and NLP

Lecture materials:

Lecture: vector representation of words

This lecture will be given by Priit Järv.

Lecture materials:

Useful additional materials from (roughly) easier to more complex:

Probabilistic models:

Also interesting to read:


Block 5: reasoners and symbolic question answering

Intro to rule reasoners:

Additionally you may want to look at:

Please have a look and run the same experiments yourself with the gkc prover:

Blocks world.

Some axiom sets:

And some planning problems to solve from these axiom sets:

Also:

Alternative axiomatization

See how to run gkc on the Wordnet TPTP version

We use the gkc prover for examples (instructions are in the Reasoner examples ... page above) but you could also try out an old classic prover Otter which actually works OK on windows even though it is really old.

Some background links:

-->

Lecture: starting to parse natural language for interaction with rule reasoners

We will start building a tiny question-answering tool, translating natural language to rule reasoner input.

Our first, very simple goal: translate the text "John is a father of Pete. Pete is a father of Mark. Who is the father of Pete?" to a rule reasoner input

father(john,pete).
father(pete,mark).
-father(X,pete) | ans(X).

then run the reasoner, fetch the ans(john) and give an answer "John is".

You can use a trivial NLP-to-reasoner parser in python nlp.py as a starting point.

We will then proceed to gradually make questions and sentences more complex and add rules to be able to answer them.

In the final part of the course we will start looking at uncertain reasoning: right now we will only try to do simple strict reasoning.

We will have a look at potential tools for semantic parsing, from simpler to more complex:

Other interesting things to look at:

Lecture block 6: confidence and relevance

See also default logic.

Lecture: various classical ideas for discrete reasoning with uncertainty

We will look at some discrete ways:

And start with numeric:

Lecture: various classical ideas for numeric reasoning with uncertainty

Classical numeric ways to reason about uncertainty:

Some newer approaches:


Lecture block 7: context, time, location, events, causality.