def get_glove_info(glove_file_name):
 with smart_open(glove_file_name) as f:
  num_lines = sum((1 for line in f))
 with smart_open(glove_file_name) as f:
  num_dims = (len(f.readline().split()) - 1)
 return (num_lines, num_dims)

def get_glove_info ( glove_file_name ) : with smart_open ( glove_file_name ) as f : num_lines = sum ( ( 1 for line in f ) ) with smart_open ( glove_file_name ) as f : num_dims = ( len ( f . readline ( ) . split ( ) ) - 1 ) return ( num_lines , num_dims )
return the number of vectors and dimensions in a file in glove format .