MCPcopy Create free account
hub / github.com/TalwalkarLab/leaf / line_to_indices

Function line_to_indices

models/utils/language_utils.py:76–97  ·  view source on GitHub ↗

converts given phrase into list of word indices if the phrase has more than max_words words, returns a list containing indices of the first max_words words if the phrase has less than max_words words, repeatedly appends integer representing unknown index to returned list until

(line, word2id, max_words=25)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

process_xMethod · 0.90

Calls 1

split_lineFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…