concrete.inspect module

Functions used by concrete_inspect.py to print data in a Communication.

The function implementations provide useful examples of how to interact with many different Concrete datastructures.

concrete.inspect.penn_treebank_for_parse(parse)

Get a Penn-Treebank style string for a Concrete Parse object

Parameters:parse (Parse) –
Returns:A string containing a Penn Treebank style parse tree representation
Return type:str
concrete.inspect.print_communication_taggings_for_communication(comm, tool=None)

Print information for CommunicationTagging objects

Parameters:
concrete.inspect.print_conll_style_tags_for_communication(comm, char_offsets=False, dependency=False, lemmas=False, ner=False, pos=False, dependency_tool=None, lemmas_tool=None, ner_tool=None, pos_tool=None)

Print ‘ConLL-style’ tags for the tokens in a Communication

Parameters:
  • comm (Communication) –
  • char_offsets (bool) – Flag for printing token text specified by a Token‘s (optional) TextSpan
  • dependency (bool) – Flag for printing dependency parse HEAD tags
  • lemmas (bool) – Flag for printing lemma tags
  • ner (bool) – Flag for printing Named Entity Recognition tags
  • pos (bool) – Flag for printing Part-of-Speech tags
concrete.inspect.print_conll_style_tags_for_tokenization(tokenization, token_tag_lists)

Print ‘ConLL-style’ tags for the tokens in a tokenization

Parameters:
  • tokenization (Tokenization) –
  • token_tag_lists – A list of lists of token tag strings
concrete.inspect.print_entities(comm, tool=None)

Print information for Entity objects and their associated EntityMention objects

Parameters:
  • comm (Communication) –
  • tool (str) – If not None, only print information for EntitySet objects with a matching metadata.tool field
concrete.inspect.print_id_for_communication(comm, tool=None)

Print ID field of Communication

Parameters:
concrete.inspect.print_metadata(comm, tool=None)

Print metadata for tools used to annotate Communication

Parameters:
concrete.inspect.print_penn_treebank_for_communication(comm, tool=None)

Print Penn-Treebank parse trees for all Tokenization objects

Parameters:
  • comm (Communication) –
  • tool (str) – If not None, only print information for Tokenization objects with a matching metadata.tool field
concrete.inspect.print_sections(comm, tool=None)

Print information for all Section object, according to their spans.

Parameters:
  • comm (Communication) –
  • tool (str) – If not None, only print information for Section objects with a matching metadata.tool field
concrete.inspect.print_situation_mentions(comm, tool=None)

Print information for all SituationMention (some of which may not have a Situation)

Parameters:
concrete.inspect.print_situations(comm, tool=None)

Print information for all Situation objects and their associated SituationMention objects

Parameters:
  • comm (Communication) –
  • tool (str) – If not None, only print information for Situation objects with a matching metadata.tool field
concrete.inspect.print_text_for_communication(comm, tool=None)

Print text field of :class:.Communication`

Parameters:
  • comm (Communication) –
  • tool (str) – If not None, only print text field of Communication objects with a matching metadata.tool field
concrete.inspect.print_tokens_for_communication(comm, tool=None)

Print token text for a Communication

Parameters:
  • comm (Communication) –
  • tool (str) – If not None, only print token text for Communication objects with a matching metadata.tool field
concrete.inspect.print_tokens_with_entityMentions(comm, tool=None)

Print information for Token objects that are part of an EntityMention

Parameters: