MCPcopy Create free account
hub / github.com/tensorflow/models / process_paragraph

Function process_paragraph

official/nlp/data/squad_lib.py:337–350  ·  view source on GitHub ↗
(seg_p)

Source from the content-addressed store, hash-verified

335 paragraph_mask.append(0)
336
337 def process_paragraph(seg_p):
338 for i in range(doc_span.length):
339 split_token_index = doc_span.start + i
340 token_to_orig_map[len(tokens)] = tok_to_orig_index[split_token_index]
341
342 is_max_context = _check_is_max_context(doc_spans, doc_span_index,
343 split_token_index)
344 token_is_max_context[len(tokens)] = is_max_context
345 tokens.append(all_doc_tokens[split_token_index])
346 segment_ids.append(seg_p)
347 paragraph_mask.append(1)
348 tokens.append("[SEP]")
349 segment_ids.append(seg_p)
350 paragraph_mask.append(0)
351
352 def process_class(seg_class):
353 class_index = len(segment_ids)

Callers 1

Calls 1

_check_is_max_contextFunction · 0.70

Tested by

no test coverage detected