-
Notifications
You must be signed in to change notification settings - Fork 4
Scripts
Although the framework_code repository is not linked to any particular application, users can still run the integrated system, with the only "action" being the Problem Solver printing out n-tuples. Be sure to download the code for the latest stable release from here.
NOTE: If you're interested primarily in viewing Semantic Specifications produced by the ECG Analyzer, the ECG Workbench has a nice graphical visualization; instructions on using this can be found here.
The system has been tested on OSX and Linux environments.
The following packages are required:
- Python (versions 2.7 and up should work)
-
Pyre, a python port of Zyre: use
pip install https://github.com/zeromq/pyre/archive/master.zip
- Jython, python for the java platform
- Six, a python package for python 2/3 compatibility.
- Java
You will also need the following repository from GitHub:
-
ecg-grammars
-
Note: the
analyzer.sh
script assumes this is installed in the same directory asframework_code
-
Note: the
Note: Once you download the latest stable release of ecg_framework_code, you'll also want to set your PYTHONPATH
in your bash_profile
to point to:
{INSTALL_PATH}/ecg_framework_code/src/main
The ECG Analyzer can be run with Python via Jython. The analyzer.sh
script runs the Analyzer using, by default, the research
grammar.
Bash:
sh analyzer.sh
OR
./analyzer.sh
If all goes well, you should see the following lines on Terminal:
Jython {information about your Jython installation)
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)]
Analyzer ready...
If you're only interested in visualizing n-tuples, and not performing a "smoke test" of the system's end-to-end communication, you can run a debugging tool called the N-tuple Visualizer
. Once the ECG Analyzer is running, open up a new Terminal tab in the same directory, then run:
./ntuples.sh
This runs the CoreSpecializer
and a proxy of the Analyzer
, which communicates with the Jython Analyzer via a local server. You can visualize n-tuples for sentence fragments or whole sentences:
> the box
{givenness: uniquelyIdentifiable
number: singular
type: box}
Try out different sentences, like John saw the box or John pushed the box into the room. If the Analyzer is unable to parse the utterance, you'll get an error resembling the following:
<Fault: No parse found for: 'John created the box into the room'>
For more information on which sentences should parse, see the ECG grammar documentation.
The Speech-Agent requires installing Kaldi or downloading the compiled binaries, as well as other dependencies, which can be found here. The Speech-Agent can be run with the speech.sh
file:
./speech.sh
This sets up the Speech-Agent, which receives audio input and produces text output. Text output is sent to the UI-Agent, which converts it all to lower-case, and then handles it the same way it would normal text-input (from the Text-Agent).
To produce parses of the Kaldi output, the utterance-speech
package is needed, as opposed to utterance-text
. This removes the requirements for punctuation, and instead allows input like:
is the box red
This can be handled in the preferences file. See here for more information about the preferences file. You can clone an existing preferences file, like compRobots.prefs
, and call it compRobots_speech.prefs
. You'll want to modify the packages under PACKAGE_NAME
. Instead of importing utterance-text
, add a line for utterance-speech
.
Then, in analyzer.sh
(see above), you'll want to make sure that the path to the grammar points to the new preferences file, such as:
jython -m analyzer ../ecg_grammars/compRobots.prefs
Note: We've already done this for the research.prefs
file (see the research_speech.prefs
file in ecg_grammars), so you can use this as a guide.
Because "core" is intended to be domain-independent, the "core" version of the end-to-end system will only test that the communication module works, and that n-tuples are transmitted from the UI-Agent to the Problem Solver.
Instead, if you're interested in seeing action produced by n-tuples, we recommend that you download the ecg_robot_code repository and follow the instructions on the wiki for the text-based demo. This allows the user to type in commands, such as:
> Robot1, push the blue box north!
And see text output describing the movements of a robot in a simulated world. This requires cloning the ecg_robot_code repository, ideally in the same directory as ecg_framework_code, and running the scripts from that repository.
If you are just interested in testing the end-to-end system, use the following command:
./setup.sh
This will input language to the UI-Agent, which outputs an n-tuple produced by the Specializer (as seen above). If the intent or "mood" of the n-tuple is identified (command
, assertion
, query
, etc.), it is sent to the Problem Solver using the communication modules. The CoreProblemSolver
then prints out the key features of the n-tuple. Note, that in the script setup.sh
, the first argument to user_agent.py
script is a path the preferences file. Change this to match the location of the grammar you are running.