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
objectsParameters: - comm (Communication) –
- tool (str) – If not None, only print information for
CommunicationTagging
objects with a matching metadata.tool field
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
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 associatedEntityMention
objectsParameters: - 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: - comm (Communication) –
- tool (str) – If not None, only print ID of
Communication
objects with a matching metadata.tool field
-
concrete.inspect.
print_metadata
(comm, tool=None)¶ Print metadata for tools used to annotate Communication
Parameters: - comm (Communication) –
- tool (str) – If not None, only print
AnnotationMetadata
information for objects with a matching metadata.tool field
-
concrete.inspect.
print_penn_treebank_for_communication
(comm, tool=None)¶ Print Penn-Treebank parse trees for all
Tokenization
objectsParameters: - 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 aSituation
)Parameters: - comm (Communication) –
- tool (str) – If not None, only print information for
SituationMention
objects with a matching metadata.tool field
-
concrete.inspect.
print_situations
(comm, tool=None)¶ Print information for all
Situation
objects and their associatedSituationMention
objectsParameters: - 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 anEntityMention
Parameters: - comm (Communication) –
- tool (str) – If not None, only print information for tokens
that are associated with an
EntityMention
that is part of anEntityMentionSet
with a matching metadata.tool field