Logics for Data and Knowledge Representation Exercises: Languages Fausto Giunchiglia, Rui Zhang and Vincenzo Maltese.

Slides:



Advertisements
Similar presentations
Language and Grammar Unit
Advertisements

Extraction and Visualisation of Emotion from News Articles Eva Hanser, Paul Mc Kevitt School of Computing & Intelligent Systems Faculty of Computing &
CPSC 422, Lecture 16Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 16 Feb, 11, 2015.
C O N T E X T - F R E E LANGUAGES ( use a grammar to describe a language) 1.
Morphology.
BİL711 Natural Language Processing
Grammars.
Conceptual Modelling Entity Relationship Model Overview Entities, Attributes and Relationship modelling Generating a Relational Database for an EAR model.
Language Specfication and Implementation - PART II: Semantics of Procedural Programming Languages Lee McCluskey Department of Computing and Mathematical.
CS 330 Programming Languages 09 / 13 / 2007 Instructor: Michael Eckmann.
1 CSE305 Programming Languages Syntax What is it? How is it specified? Who uses it? Why is it needed?
1 Note As usual, these notes are based on the Sebesta text. The tree diagrams in these slides are from the lecture slides provided in the instructor resources.
Chapter 3: Formal Translation Models
BIOI 7791 Projects in bioinformatics Spring 2005 March 22 © Kevin B. Cohen.
Dictionary.
CS224N Interactive Session Competitive Grammar Writing Chris Manning Sida, Rush, Ankur, Frank, Kai Sheng.
PPL Syntax & Formal Semantics Lecture Notes: Chapter 2.
LDK R Logics for Data and Knowledge Representation Exercise 1: Model and Language.
Part-of-Speech Tagging
1 Syntax and Semantics The Purpose of Syntax Problem of Describing Syntax Formal Methods of Describing Syntax Derivations and Parse Trees Sebesta Chapter.
Chpater 3. Outline The definition of Syntax The Definition of Semantic Most Common Methods of Describing Syntax.
HTML (HyperText Markup Language)
Programming in HTML.  Programming Language  Used to design/create web pages  Hyper Text Markup Language  Markup Language  Series of Markup tags 
CSI 3120, Grammars, page 1 Language description methods Major topics in this part of the course: –Syntax and semantics –Grammars –Axiomatic semantics (next.
TODAY’S GOALS Introduce general strategies for editing and revision Discuss the English verb system, including verb tense, complex verb phrases, and subject-verb.
CS 355 – PROGRAMMING LANGUAGES Dr. X. Topics Introduction The General Problem of Describing Syntax Formal Methods of Describing Syntax.
Logics for Data and Knowledge Representation Exercises: Modeling Fausto Giunchiglia, Rui Zhang and Vincenzo Maltese.
Language Learning Targets based on CLIMB standards.
CS 331, Principles of Programming Languages Chapter 2.
Grammars CPSC 5135.
ISBN Chapter 3 Describing Syntax and Semantics.
TextBook Concepts of Programming Languages, Robert W. Sebesta, (10th edition), Addison-Wesley Publishing Company CSCI18 - Concepts of Programming languages.
1 Syntax In Text: Chapter 3. 2 Chapter 3: Syntax and Semantics Outline Syntax: Recognizer vs. generator BNF EBNF.
Logics for Data and Knowledge Representation Languages for Data Representation First version by Alessandro Agostini and Fausto Giunchiglia Second version.
Copyright © Curt Hill Languages and Grammars This is not English Class. But there is a resemblance.
Parts of Speech Major source: Wikipedia. Adjectives An adjective is a word that modifies a noun or a pronoun, usually by describing it or making its meaning.
ISBN Chapter 3 Describing Syntax and Semantics.
CS 331, Principles of Programming Languages Chapter 2.
NLP. Introduction to NLP Background –From the early ‘90s –Developed at the University of Pennsylvania –(Marcus, Santorini, and Marcinkiewicz 1993) Size.
Syntax and Grammars.
Stanford POS tagger 17 th February System requirement Java 1.5+ –
Logics for Data and Knowledge Representation Exercises: ClassL Fausto Giunchiglia, Rui Zhang and Vincenzo Maltese.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Subject-Verb Agreement & Parallel Structure
Syntax and Semantics Form and Meaning of Programming Languages Copyright © by Curt Hill.
Welcome to Stanah School
LDK R Logics for Data and Knowledge Representation Propositional Logic Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
Parts of Speech I NTERJECTIONS V ERBS A DJECTIVES N OUNS C ONJUNCTIONS A DVERBS P ROUNOUN P REPOSITIONS We will study these in a different order.
OO DomainModeling With UML Class Diagrams and CRC Cards Chapter 6 Princess Nourah bint Abdulrahman University College of Computer and Information Sciences.
Parts of Speech By: Miaya Nischelle Sample. NOUN A noun is a person place or thing.
7.2 Programming Languages - An Introduction to Informatics WMN Lab. Hye-Jin Lee.
PPL Syntax & Formal Semantics Lecture Notes: Chapter 2.
When our vacation ended Piper and Levy climbed up in the tree, and they would not answer their mother. 1. Which answer contains the prepositional phrase.
Organization of Programming Languages Meeting 3 January 15, 2016.
Chapter 3 – Describing Syntax CSCE 343. Syntax vs. Semantics Syntax: The form or structure of the expressions, statements, and program units. Semantics:
Syntax(1). 2 Syntax  The syntax of a programming language is a precise description of all its grammatically correct programs.  Levels of syntax Lexical.
SYNTAX.
Parts of Speech Review.
Morphology Morphology Morphology Dr. Amal AlSaikhan Morphology.
Introduction to Machine Learning and Text Mining
Logics for Data and Knowledge Representation
What is SPaG? pelling unctuation nd rammar. What is SPaG? pelling unctuation nd rammar.
Today’s Goals Introduce general strategies for editing and revision
Charlie and the Chocolate Factory
ITE 130 Web Searching.
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
PREPOSITIONAL PHRASES
Biomedical Language Processing: What's Beyond PubMed?
Logics for Data and Knowledge Representation
Presentation transcript:

Logics for Data and Knowledge Representation Exercises: Languages Fausto Giunchiglia, Rui Zhang and Vincenzo Maltese

Outline  BNF grammars  Basic exercises  BNF for ER diagrams  BNF for natural languages (POS tagging) 2

Backus–Naur Form (BNF)  BNF is a syntax used to express context-free grammars: that is, a formal way to describe formal languages.  Optional items are enclosed in square brackets: [ ]  Items repeating 0 or more times are enclosed in curly brackets and/or suffixed with an asterisk: { }*  Items repeating 1 or more times are followed by a +  Terminals may appear in bold and Non-Terminals in plain text rather than using italics and angle brackets <>  Alternative choices in a production are separated by the | symbol  Where items need to be grouped they are enclosed in simple parentheses (). 3 BNF GRAMMARS :: BASIC EXERCISES :: BNF AND ER DIAGRAMS :: POS TAGGING

Example of BNF: A mathematical expression 1. ::= [ ] 2. ::= [ ] [. ] 3. ::= { }* 4. ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 5. ::= + | - 6. ::= + | - | * | / 4 BNF GRAMMARS :: BASIC EXERCISES :: BNF AND ER DIAGRAMS :: POS TAGGING

Exercises of BNF: mathematical expressions  Are the following well-formed formulas of expression? * / ( ) 1. YES 2. YES 3. YES 4. YES 5. NO 5 BNF GRAMMARS :: BASIC EXERCISES :: BNF AND ER DIAGRAMS :: POS TAGGING

Exercises of BNF: PL language  Consider the BNF for the PL language above: ::= A | B |... | P | Q |... | ⊥ | ⊤ ::= | ¬ | ∧ | ∨ Differentiate wff from others below: 1. A ⊔ B ⊒ A 2. A ⊓ B ⊑ B 3. A ∧ ¬ B 4. A ∧ B ⊨ A ∨ B 5. ¬ A ∨ B ∧ ⊤ 1. NO 2. NO 3. YES 4. NO 5.YES 6 BNF GRAMMARS :: BASIC EXERCISES :: BNF AND ER DIAGRAMS :: POS TAGGING

 In software engineering, an Entity-Relationship (ER) Model is an abstract and conceptual representation of data.  The basic components of ER:  Entity  Relation  Cardinality of Relation  Cardinality of Attribute  Attribute  Primary Key Recall: ER Diagram 7 MonkeyBox Climb n Banana Height ID BNF GRAMMARS :: BASIC EXERCISES :: BNF AND ER DIAGRAMS :: POS TAGGING

The BNF for ER Diagrams ::= ::= [ “..” ] ::= 0 | 1 | n | m ::= { }* | { }* :: = { }* 8 Entity Relation Attribute BNF GRAMMARS :: BASIC EXERCISES :: BNF AND ER DIAGRAMS :: POS TAGGING

BNF of Yahoo! Directory  The Yahoo! Directory is an online guide to the World Wide Web. It is a catalog of sites created by a staff of editors who visit and evaluate web sites, and then organize them into subject-based categories and sub-categories.  Yahoo! editors distinguish between a number of factors when organizing web sites, including commercial vs. non-commercial, regional vs. global, and so forth. All of the site listings in the Directory are contained in an appropriate place within the 14 main categories seen on the front page of the Yahoo! Directory. 9 BNF GRAMMARS :: BASIC EXERCISES :: BNF AND ER DIAGRAMS :: POS TAGGING

So take a look! 10 BNF GRAMMARS :: BASIC EXERCISES :: BNF AND ER DIAGRAMS :: POS TAGGING

Preliminaries: Open/Close Word Class  In linguistics, an open class (or open word class) is a word class that accepts the addition of new items, through such processes as compounding, derivation, coining, borrowing, etc. Typical open word classes are nouns, verbs and adjectives.  A closed class (or closed word class) is a word class to which no new items can normally be added, and that usually contains a relatively small number of items. Typical closed classes found in many languages are adpositions (prepositions and postpositions), determiners, conjunctions, and pronouns. 11 BNF GRAMMARS :: BASIC EXERCISES :: BNF AND ER DIAGRAMS :: POS TAGGING

Parts of Speech: open word class OPEN WORD CLASSEXAMPLE JJ//Adjective blue / green / soft NN//Noun, singular or mass apple / sugar NNS//Noun, plural apples NNP//Proper noun, singular Fausto RB//Adverb slowly VB//Verb, base form go VBD//Verb, past tense went VBZ//Verb, 3rd person singular present goes 12 BNF GRAMMARS :: BASIC EXERCISES :: BNF AND ER DIAGRAMS :: POS TAGGING

Parts of Speech: closed word class CLOSED WORD CLASSEXAMPLE CC//Coordinating conjunction and / or CD//Cardinal number DT//Determiner the / an / a IN//Preposition or subordinating conjunction in / for / but POS//Possessive ending TO//toto 13 BNF GRAMMARS :: BASIC EXERCISES :: BNF AND ER DIAGRAMS :: POS TAGGING

BNF for Yahoo Directory (1) ForwardPhrase::= [VB] [IN] DisPhrase {Conn } DisPhrase (2) DisPhrase::= Phrase [“(”ProperDis | NounDis“)”] [“(”Period“)”][“:” Phrase] (3) Phrase::=[DT] Adjectives [Nouns] | [Proper] Nouns (4) Adjectives::= Adjective|CD {[CC] Adjective} (5) Nouns::= Noun {Noun} (6) Conn::= ConjunctionConn | PrepositionConn (7) Noun::= NN [POS] | NNS [POS] (8) Adjective::= JJ (9) ConjunctionConn::= CC | “,” (10) PrepositionConn::= IN | TO (11) Proper::= NNP {NNP|POS} (12) NounDis::= Period|Nouns|Adjectives [Nouns] (13) ProperDis::= ProperSeq [CC ProperSeq] (14) Period::= [NN] CD [“-”] [CD] [NN] (15) ProperSeq::= Proper [“,” Proper] 14 BNF GRAMMARS :: BASIC EXERCISES :: BNF AND ER DIAGRAMS :: POS TAGGING

Example: Provinces and Districts 15 ForwardPhrase DisPhrase Phrase Nouns Noun NNS Conn ConjunctionConn CC ForwardPhrase DisPhrase Provinces and Districts Phrase Nouns Noun NNS BNF GRAMMARS :: BASIC EXERCISES :: BNF AND ER DIAGRAMS :: POS TAGGING

Examples  Science > Computer Science > Artificial Intelligence > Natural Language Processing > Web Directories  Computer Science NN  Artificial Intelligence JJ NN  Natural Language Processing JJ NN VBG  Web Directories NN NNS 16 BNF GRAMMARS :: BASIC EXERCISES :: BNF AND ER DIAGRAMS :: POS TAGGING