Advanced User Agents

Nelia Lasierra [Book: Introduction to read-write linked Data Chapter: Advanced User Agents]

©www.sti Copyright-innsbruck.at 2012 STI INNSBRUCK www.sti-innsbruck.at What?

Advanced User Agents

“Piece of that operate autonomously on the web on behalf of their users”

“Piece of software to which a user can delegate a task to”

“An agent is anything that can be viewed as perceiving its environment through sensors and acting upon that environment through effectors” [2]

[1] Advanced user Agents [2] Intelligent Agents. : A Modern Approach by Stuart Russell and Peter Norvig, c 1995 Prentice-Hall, Inc.

www.sti-innsbruck.at 2 Why? How?

What for?

- Information gathering/ - Recommendation systems - Order shopping - Future activities under certain conditions

If we want this to happen…

1) Agents need to interact with the web need some intelligence. By means of rules, we can specify agents that carry out HTTP operations

2) Agents need to communicate with the user (process input/output information).

3) Agents understand the intend of the user.

www.sti-innsbruck.at 3 Rational agent

Ideally…

A rational agent is the one that does the right thing Directs its activity towards achieving goals.

“For each possible percept sequence, an ideal rational agent should do whatever action is expected to maximize its performance measure, on the basis of the evidence provided by the percept sequence and whatever built-in knowledge the agent has.”

Intelligent Agents. Artificial Intelligence: A Modern Approach by Stuart Russell and Peter Norvig, c 1995 Prentice-Hall, Inc

www.sti-innsbruck.at 4 Technologies

Components of a typical mobile user agent.

1) Synthesis/recognition : 2) Natural Processing 3) Contextual Awareness 4) Declarative Abstraction (reasoning/planning)

www.sti-innsbruck.at 5 Technologies

1) /recognition : Artificial production of the human speech. • A module transcribes the user’s speech into a stream. The character flow is then processed by a language engine dealing with syntax, , and finally by the back-end application program [1]. • A speech converts resulting answers (strings of characters) into speech to the user [1]. “A text to speech system, takes some text as an input and produces the equivalent human speech normally by concatenating pieces of recorded speech that are stored in a ” [2].

1] An Overview of Speech Synthesis and Recognition. http://fileadmin.cs.lth.se/cs/Personal/Pierre_Nugues/ilppp/chapters/speech.pdf [2] http://en.wikipedia.org/wiki/Speech_synthesis

www.sti-innsbruck.at 6 Technologies

2) Natural Language Processing

- Natural Language Understanding - “NLP enables computers to derive meaning from human or natural language input” - “Natural language processing (NLP) is the ability of a computer program to understand human speech as it is spoken.”

Included tasks:

segmentation, part-of-speech tagging and • Deep analytics. • Named entity extraction. • Co-reference resolution.

www.sti-innsbruck.at 7 Technologies

3) Contextual Awareness

- Concerns with the acquisition of context - Linked with changes in the environment - Context: perceived situation, environmental that may determine which actions should be triggered. - Advanced User agents make use of this sensors and actuators. - Sensors: , location, temperature, audio, video - Actuators: ring sounds, loudspeakers, screen

4) Declarative Abstraction (reasoning/planning)

www.sti-innsbruck.at 8 Example…

“Who is married to the daughter of Ingrid Bergman?”.

1) Natural processing language block enables to get an accurate reading of the question and request (Speech act theory)

Speech act theory tries to answer communication patterns.  Intention of the speaker

www.sti-innsbruck.at 9 Speech Act theory

Speech act is the minimal functional unit in human communication [1]

• assertives = speech acts that commit a speaker to the truth of the expressed proposition, • directives = speech acts that are to cause the hearer to take a particular action, e.g. requests, commands and advice • commissives = speech acts that commit a speaker to some future action, e.g. promises and oaths • expressives = speech acts that express the speaker's attitudes and emotions towards the proposition, e.g. congratulations, excuses and thanks • declarations = speech acts that change the reality in accord with the proposition of the declaration, e.g. pronouncing someone guilty

[1] http://instructional1.calstatela.edu/lkamhis/tesl565_sp04/troy/spchact.htm [2] http://en.wikipedia.org/wiki/Speech_act

www.sti-innsbruck.at 10 Example…

“Who is married to the daughter of Ingrid Bergman?”.

1) Natural processing language block enables to get an accurate reading of the question and request (Speech act theory) 2) We asume there is a component that translates the user intent to a SPARQL query 3) This query could be answer using DBpedia.

www.sti-innsbruck.at 11 DBpedia

• DBpedia is a crowd-sourced community effort to extract structured information from Wikipedia and make this information available on the Web [1] • DBpedia allows you to ask sophisticated queries against Wikipedia, and to link the different data sets on the Web to Wikipedia data [1] • DBpedia is a project aiming to extract structured content from the information created as part of the Wikipedia project. [2] • DBpedia allows users to query relationships and properties associated with Wikipedia resources, including links to other related datasets [2]

[1] http://dbpedia.org/About

[2] http://wiki.dbpedia.org/About

www.sti-innsbruck.at 12 Example…

“Who is married to the daughter of Ingrid Bergman?”.

1) Natural processing language component enables to get an accurate reading of the question and request. 2) This query could be answer using DBpedia.

www.sti-innsbruck.at 13 Example…

“Who is married to the daughter of Ingrid Bergman?”.

1) Natural processing language block enables to get an accurate reading of the question and request. 2) This query could be answer using DBpedia.

3) Assuming the agent verbalise RDF triples and graph patterns automatically.

www.sti-innsbruck.at 14 Agent’s Behavior

Question…

How the communication is done between the agent and the user in N3 notation syntax? The user input in N3 is parsed and fed to a rule engine evaluating a set of rules that specify runtime behaviour.

Other Characteristics:

 Termination (the agent should be running continously)  Negation as failure (check for absence of information)

 Needed to know what the agent knows and is true from the view of the user agent.  Store certain information to avoid asking all the time.

www.sti-innsbruck.at 15 Agent’s Behavior

Agent = architecture + program

An agent program maps from the percept to an action choices, while updating its internal state. This program will run over an architecture.

Ideal mappings: actions for every percept

• Built-in Knowledge  The agent operates successfully when those assumptions hold, and thus lacks flexibility.

• Experience + built-in knowledge  autonomy

A system is autonomous to the extend that is behavior is based on his own experience. “An autonomous agent is a system situated within and a part of an environment that senses that environment and acts on it, over time, in pursuit of its own agenda and so as to effect what it senses in the future. “

www.sti-innsbruck.at 16 Structure of Intelligent agents

How to implement the mapping from percepts to action?

• simple reflex agents • model-based reflex agents • goal-directed agents • utility-based agents • learning agents

http://en.wikipedia.org/wiki/Intelligent_agent

www.sti-innsbruck.at 17 Structure of Intelligent agents

• Reflex Agents

- Simply react on the sensed state of the world. Act only on the basis of the current percept igoring the rest of the history.

- Their behaviour can be specified using rules.

- The agent function is based - Matches the perceived situation with an on the condition-action rule: if available rule and executes the associated condition then action. action.

- Model-based reflex agents: Actions based on the current situation state.

www.sti-innsbruck.at 18 Structure of Intelligent agents

• Goal-Direct Agents

- The current situation is not enough to decide what to do.

- The agent also needs to know the goal. The goal describes the situations that are desirable (right decisión)

- The agent choose among multiple posibilites selecting the one which reaches the goal state.

http://www.stucharlton.com/blog/archives/2010/03/building-a-restful-hypermedia.html www.sti-innsbruck.at 19 Structure of Intelligent agents

• Goal-Direct Agents

- These agents need information of the goal

Hierarchical FSMs Behaviour trees technologies

http://www.stucharlton.com/blog/archives/2010/03/building-a-restful-hypermedia.html

www.sti-innsbruck.at 20 Structure of Intelligent agents

• Goal-Direct Agents

- An agent responds to changes in the environment based on its current state and a set of known transitions.

- Hierarchical Finite State Machine (FSM)

FSM based-systems are great for reactive systems where the correct interpretation & response to input and events is the intent of the application.

The response to an event generally depends on both the type of the event and on the internal state of the system and can include a change of state leading to a state transition.

Provide reusable transitions between states. http://www.stucharlton.com/blog/archives/2010/03/building-a-restful-hypermedia.html

www.sti-innsbruck.at 21 Structure of Intelligent agents

• Utility based agents

- Goals are not enough to implement a good behavior - Higher utility for the agent == higher quality of being useful.

http://www.stucharlton.com/blog/archives/2010/03/building-a-restful-hypermedia.html

www.sti-innsbruck.at 22 The end

Thank you!

www.sti-innsbruck.at 23