MCPcopy Create free account
hub / github.com/Alibaba-NLP/ViDoRAG / nodefile2node

Function nodefile2node

utils/format_converter.py:17–26  ·  view source on GitHub ↗
(input_file)

Source from the content-addressed store, hash-verified

15 return resp_dict
16
17def nodefile2node(input_file):
18 nodes = []
19 for doc in json.load(open(input_file, 'r')):
20 if doc['class_name'] == 'TextNode' and doc['text'] != '':
21 nodes.append(TextNode.from_dict(doc))
22 elif doc['class_name'] == 'ImageNode':
23 nodes.append(ImageNode.from_dict(doc))
24 else:
25 continue
26 return nodes
27
28def onlchunkfile2node(input_file):
29 content_json = json.load(open(input_file, 'r'))

Callers 2

load_nodesMethod · 0.90
parse_fileMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected