[Documentation] [TitleIndex] [WordIndex

WARNING: This documentation refers to an outdated version of rosjava and is probably incorrect. Use at your own risk.

Interpreting Output Messages

Parse tree

A python utility is provided to unsquash the parse trees and dependencies output by stanford_parser_ros. This will create a tree structure:

from stanford_parser_msgs import unsquash_tree

[...]

def callback(msg): # msg type: stanford_parser_msgs/Parse
  [...]
  parse_tree = unsquash_tree(msg)
  [...]

Each node in the tree -- an instance of the class Tree -- has the following elements:

node.tag        # string
node.score      # double -- confidence rating of the Stanford Parser
node.word       # string
node.word_index # integer -- node.word = msg.words[node.word_index]
node.children   # listof(Tree)

The part-of-speech tags used in the Stanford Parser come from Penn Treebank II and can be found here.

Dependencies

Dependencies (a list located under msg.dependencies) have the following 3 elements:

For instance, the sentence "Give Bill the ball." has, among others, the dependency "dobj(give-2, ball-5)". For this dependency, relation is "dobj", governor_index is 2, and dependent_index is 5.


2024-07-20 14:46