ba4c25a77488026fb6212790c4d460e2c76db326,graphbrain/cognition/agents/txt_parser.py,TxtParser,parse_text,#TxtParser#Any#Any#Any#,27
Before Change
pbar = None
for i, paragraph in enumerate(paragraphs):
parse_results = parser.parse(paragraph)
for parse in parse_results["parses"]:
main_edge = parse["resolved_corefs"]
// add main edge
if main_edge:
// attach text to edge
text = parse["text"]
attr = {"text": text}
// print("main edge: {}".format(main_edge.to_str()))
yield create_op(main_edge, sequence=sequence, position=pos,
attributes=attr)
pos += 1
// add extra edges
for edge in parse["extra_edges"]:
yield create_op(edge)
for edge in parse_results["inferred_edges"]:
// print("inferred edge: {}".format(edge.to_str()))
yield create_op(edge, count=True)
if self.progress_bar:
After Change
pbar = None
for i, paragraph in enumerate(paragraphs):
for op in self.system.parse_results2ops(parser.parse(paragraph),
sequence=sequence,
pos=pos):
yield op
if self.progress_bar:
pbar.update(i)
if self.progress_bar:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 15
Instances
Project Name: graphbrain/graphbrain
Commit Name: ba4c25a77488026fb6212790c4d460e2c76db326
Time: 2021-01-09
Author: telmo@telmomenezes.net
File Name: graphbrain/cognition/agents/txt_parser.py
Class Name: TxtParser
Method Name: parse_text
Project Name: graphbrain/graphbrain
Commit Name: ba4c25a77488026fb6212790c4d460e2c76db326
Time: 2021-01-09
Author: telmo@telmomenezes.net
File Name: graphbrain/cognition/agents/reddit_parser.py
Class Name: RedditParser
Method Name: _parse_title
Project Name: graphbrain/graphbrain
Commit Name: ba4c25a77488026fb6212790c4d460e2c76db326
Time: 2021-01-09
Author: telmo@telmomenezes.net
File Name: graphbrain/cognition/agents/txt_parser.py
Class Name: TxtParser
Method Name: parse_text
Project Name: graphbrain/graphbrain
Commit Name: ba4c25a77488026fb6212790c4d460e2c76db326
Time: 2021-01-09
Author: telmo@telmomenezes.net
File Name: graphbrain/cognition/agents/wikipedia.py
Class Name: Wikipedia
Method Name: run