This repository has been archived by the owner on Sep 17, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from Roboy/devel
midterm WS17/18
- Loading branch information
Showing
734 changed files
with
19,690 additions
and
3,353 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,6 @@ local.properties | |
*.idea | ||
|
||
|
||
.target | ||
.target | ||
|
||
resources/word2vec_toy_data_and_model |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "roboy_parser"] | ||
path = roboy_parser | ||
url = git://github.com/Roboy/roboy_parser.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
ROS_HOSTNAME: 10.183.122.142 | ||
ROS_HOSTNAME: 127.0.0.1 | ||
PARSER_PORT: 5000 | ||
DEMO_GUI: false | ||
PERSONALITY_FILE: "resources/personalityFiles/ExamplePersonality.json" |
Empty file.
Empty file.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
******* | ||
Context | ||
******* | ||
|
||
The goal of Context is to collect information about Roboy's environment and state. This information can be used by the DM classes and also to react upon situations that match certain conditions, such as turning the head of Roboy when the Interlocutor moves. | ||
|
||
Architecture | ||
============ | ||
|
||
.. figure:: ../images/context.png | ||
:alt: Context architecture | ||
|
||
The Context supports storing data as a ``Value`` or ``ValueHistory``. A ``Value`` only stores the latest data object that was pushed to it. A ``ValueHistory`` stores every value it receives and assigns each a unique key, thus the values can be ordered by their adding time. | ||
|
||
|
||
How to add Values? | ||
================== | ||
|
||
Here we describe how a new Value can be created and added to the Context. Sample implementations can be found inside ``roboy.context.contextObjects`` packge. | ||
|
||
1. Consider what type of data will be stored in the Value. For this example, we chose ``String``. | ||
2. In the ``contextObjects`` directory, create a new class which inherits from the Value class. The final signature should look similar to: ``public class SampleValue extends Value<String>`` (replacing String with your type). | ||
3. Add the new Value in the main class ``Context.java``: | ||
1. In the standard constructor, initialize the Value object and add it to the builder of the value map: ``put(SampleValue.class, sampleValue)`` | ||
2. Make the value available over the enum ``Values`` within the Context class by adding a new element with your class name and stored data type. For example: ``SAMPLE_VALUE(SampleValue.class, String.class);`` | ||
|
||
How to add ValueHistories? | ||
========================== | ||
|
||
ValueHistories extend the functionality of Values by storing all data objects sent to them. Over the ``getNLastValues(int n)`` method, a map with several most recent data objects can be retrieved, including their ordering. | ||
|
||
Adding a ``ValueHistory`` is very much alike to adding a ``Value``, just make sure to: | ||
|
||
1. extend ``ValueHistory<>`` instead of ``Value<>``, | ||
|
||
2. in ``Context.java``, add the new object to the Builder of ``valueHistories`` instead of ``values``, and to the enum ``ValueHistories`` instead of ``Values``. | ||
|
||
How to add Updaters? | ||
==================== | ||
|
||
New values can only be added to the Context over an ``Updater`` instance. Internal updaters can be used by DM classes to actively add new values. External updaters run in separate threads and seek out new values, for example over a ROS connections to the Vision module. | ||
|
||
Adding an External Updater | ||
"""""""""""""""""""""""""" | ||
Currently, the only implementation of an external updater is the ``IntervalUpdater`` abstract class. Usage: | ||
|
||
1. Create a class extending ``IntervalUpdater`` and implement its ``update()`` method. It should retrieve the values and finally add them over the ``target.updateValue(value)`` method call. | ||
2. Add the updater to ``externalUpdaters`` in the ``Context.java`` constructor, setting its ``target`` parameter with the ``Value`` or ``ValueHistory`` object created in the same constructor. | ||
|
||
Adding a new Internal Updater | ||
""""""""""""""""""""""""""""" | ||
1. Create a class extending InternalUpdater<*targetClass*, *valueType*>. The class and data type of the target ``Value`` or ``ValueHistory`` are the generic parameters for the updater. | ||
2. A constructor is required for the class, simply match the InternalUpdater constructor and call ``super(target)`` within. An example is in the ``DialogTopicsUpdater`` class. | ||
3. In the ``Context`` class constructor, initialize the updater and add it to the ``internalUpdaters`` map. | ||
4. Add an entry to the ``Updaters`` enum, similarly as discussed above for ``Values``. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
Semantic Parser | ||
=============== | ||
|
||
Semantic parser is used to translate text representation into formal language representation. The aim is to be able to process user utterances and react upon them. | ||
|
||
roboy_parser is based on `SEMPRE <http://nlp.stanford.edu/software/sempre/`. It is currently being modified to fulfill Roboy Dialog system needs. | ||
|
||
|
||
Installation | ||
------------ | ||
|
||
In order to use semantic parser, you need to: | ||
|
||
- clone ``roboy_parser`` repository:: | ||
|
||
git clone http://github.com/Roboy/roboy_parser | ||
|
||
- navigate to created repository:: | ||
|
||
cd roboy_parser | ||
|
||
- build it:: | ||
|
||
ant freebase | ||
|
||
- run it:: | ||
|
||
./quick_start [options] | ||
|
||
Architecture | ||
------------ | ||
|
||
Semantic parser is based on the language model and NLP algorithms that then apply rules to the utterance to translate it. Language model consists of: | ||
- set of grammar rules, | ||
- lexicon, | ||
- training dataset. | ||
|
||
General architecture can be seen on the diagram below. | ||
|
||
.. figure:: ../images/parser.png | ||
:alt: Semantic parser general architecture | ||
|
||
Implementation | ||
-------------- | ||
|
||
roboy_parser is a separate Java project and is communicating using ``WebSocket``. Dialog system has a client implemented in ``SemanticParserAnalyzer.java`` class. It is therefore part of Natural Language Understanding unit. | ||
|
||
Functionalities | ||
""""""""""""""" | ||
|
||
Roboy parser currently has currently following functionalities: | ||
|
||
.. csv-table:: Semantic Parser algorithms used | ||
:header: "Functionality", "Software used", "Summary" | ||
:widths: 20, 20, 60 | ||
|
||
"POS Tags", "OpenNLP", "Tagging tokens as part of speech" | ||
"NER Tags", "OpenNLP", "Tool used to tag named entities like PERSON, NUMBER, ORGANIZATION" | ||
"Triple extraction", "OpenIE", "Tool used to extract triples from sentences in form ``(Subject,Predicate,Object)``" | ||
|
||
Usage | ||
----- | ||
|
||
In order to run the parser, you need to run **roboy_parser** first - see instructions on `project Github <http://github.com/Roboy/roboy_parser` and then run Dialog System. | ||
|
||
Configurations | ||
"""""""""""""" | ||
|
||
To test parser, you can run following configurations using ``quick_start.sh`` script. For more information refer to `project documentation <http://github.com/Roboy/roboy_parser` | ||
|
||
.. csv-table:: Possible parser configurations | ||
:header: "Command", "Options" | ||
:widths: 20, 40 | ||
|
||
"./quick_start", "Default configuration. Using custom Roboy grammar and lexicons" | ||
"./quick_start freebase", "Example setup to test Freebase functionality" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.