Loading a large dictionary using python pickle

后端 未结 5 1523
[愿得一人]
[愿得一人] 2020-12-15 09:41

I have a full inverted index in form of nested python dictionary. Its structure is :

{word : { doc_name : [location_list] } }

For example l

5条回答
  •  没有蜡笔的小新
    2020-12-15 10:11

    Have you tried using an alternative storage format such as YAML or JSON? Python supports JSON natively from Python 2.6 using the json module I think, and there are third party modules for YAML.

    You may also try the shelve module.

提交回复
热议问题