microsoft / IRNet

An algorithm for cross-domain NL2SQL
MIT License
264 stars 81 forks source link

how to understand the vector 'col hot type'? #32

Closed tenghl closed 4 years ago

tenghl commented 4 years ago

how to understand the vector 'col hot type'? maybe it is an useful information, but I don't understand how it relates to the corresponding column? How did you come up with this representation, is it a simple and efficient way? Looking forward to your answer,thanks.

'What are the official names of cities that have hosted more than one competition?'

src_sent = [['what'], ['are'], ['column', 'official', 'name'], ['of'], ['table', 'city'], ['that'], ['have'], ['hosted'], ['more'], ['than'], ['one'], ['competition'], ['?']]

tab_cols = [['count', 'number', 'many'], ['city', 'id'], ['official', 'name'], ['status'], ['area', 'km', '2'], ['population'], ['census', 'ranking'], ['farm', 'id'], ['year'], ['total', 'horse'], ['working', 'horse'], ['total', 'cattle'], ['ox'], ['bull'], ['cow'], ['pig'], ['sheep', 'and', 'goat'], ['competition', 'id'], ['theme'], ['host', 'city', 'id'], ['host'], ['rank']]

col_hot_type = [[0. 0. 0. 0.], [1. 0. 0. 0.], [2. 5. 0. 0.], [0. 0. 0. 0.], [0. 0. 0. 0.], [0. 0. 0. 0.], [0. 0. 0. 0.], [0. 0. 0. 0.], [0. 0. 0. 0.], [0. 0. 0. 0.], [0. 0. 0. 0.], [0. 0. 0. 0.], [0. 0. 0. 0.], [0. 0. 0. 0.], [0. 0. 0. 0.], [0. 0. 0. 0.], [0. 0. 0. 0.], [1. 0. 0. 0.], [0. 0. 0. 0.], [1. 0. 0. 0.], [0. 0. 0. 0.], [0. 0. 0. 0.]]