def _build_graph(self, tags):
graph = SimpleGraph()<EOL>for tag_index in xrange(len(tags)):<EOL><INDENT>for entity_index in xrange(len(tags[tag_index].get('<STR_LIT>'))):<EOL><INDENT>a_entity_name = graph_key_from_tag(tags[tag_index], entity_index)<EOL>tokens = self.tokenizer.tokenize(tags[tag_index].get('<STR_LIT>', [])[entity_index].get('<STR_LIT>'))<EOL>for tag in tags[tag_index + <NUM_LIT:1>:]:<EOL><INDENT>start_token = tag.get('<STR_LIT>')<EOL>if start_token >= tags[tag_index].get('<STR_LIT>') + len(tokens):<EOL><INDENT>for b_entity_index in xrange(len(tag.get('<STR_LIT>'))):<EOL><INDENT>b_entity_name = graph_key_from_tag(tag, b_entity_index)<EOL>graph.add_edge(a_entity_name, b_entity_name)<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>return graph<EOL>
Builds a graph from the entities included in the tags.
        Note this is used internally.

        Args:
            tags (list): A list of the tags to include in graph

        Returns:
            graph : this is the resulting graph of the tagged entities.