MCPcopy Create free account
hub / github.com/google-research/language / _table_reader

Function _table_reader

language/table_text_eval/table_text_eval.py:96–111  ·  view source on GitHub ↗

Yields tables from the table file. Tables are parsed into a list of tuples with tokenized entries. Args: table_file: String filename.

(table_file)

Source from the content-addressed store, hash-verified

94
95
96def _table_reader(table_file):
97 """Yields tables from the table file.
98
99 Tables are parsed into a list of tuples with tokenized entries.
100
101 Args:
102 table_file: String filename.
103 """
104 with io.open(table_file) as f:
105 for line in f:
106 entries = line.lower().split("\t")
107 # pylint: disable=g-complex-comprehension
108 table = [
109 [member.split() for member in entry.split("|||")] for entry in entries
110 ]
111 yield table
112
113
114def cooccur_probability_fn(counts):

Callers 1

mainFunction · 0.70

Calls 1

splitMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…