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

Method from_json

language/xsp/data_preprocessing/sql_utils.py:125–139  ·  view source on GitHub ↗

Converts from a JSON representation to a SQL action.

(self, dictionary)

Source from the content-addressed store, hash-verified

123 return {'utterance_copy': self.utterance_copy.to_json()}
124
125 def from_json(self, dictionary):
126 """Converts from a JSON representation to a SQL action."""
127 # Should only have one key -- any of the above keys.
128 assert len(dictionary) == 1
129 if 'symbol' in dictionary:
130 self.symbol = dictionary['symbol']
131 return self
132
133 if 'entity_copy' in dictionary:
134 self.entity_copy = SchemaEntityCopy().from_json(dictionary['entity_copy'])
135 return self
136
137 if 'utterance_copy' in dictionary:
138 self.utterance_copy = Wordpiece().from_json(dictionary['utterance_copy'])
139 return self
140
141
142class SQLQuery(object):

Callers

nothing calls this directly

Calls 3

WordpieceClass · 0.90
SchemaEntityCopyClass · 0.85
from_jsonMethod · 0.45

Tested by

no test coverage detected