PaddlePaddle / Paddle

PArallel Distributed Deep LEarning: Machine Learning Framework from Industrial Practice (『飞桨』核心框架,深度学习&机器学习高性能单机、分布式训练和跨平台部署)
http://www.paddlepaddle.org/
Apache License 2.0
22.24k stars 5.59k forks source link

What is settings' data structure #1540

Closed dreamingcp closed 7 years ago

dreamingcp commented 7 years ago

1.In dataprovider.py, there usually is settings.input_types, but in semantic_role_labeling, there is only a settings.slots . What is the difference between input_types and slots? 2.Can someone give me the whole data structure of 'settings' and the description of the data structure?

Thanks a lot!

reyoung commented 7 years ago

Sorry for lacking documentation of this data structure.

1.In dataprovider.py, there usually is settings.input_types, but in semantic_role_labeling, there is only a settings.slots . What is the difference between input_types and slots?

settings.slots and settings.input_types are same object. We used to name each feature of a neural network as slot. Before we open source Paddle, we think slot is confusing. We changed slot to input_types. For backward compatibility, we didn't remove slot object in settings.

2.Can someone give me the whole data structure of 'settings' and the description of the data structure?

Related Documentation.

settings object is a global context, which shared between init_hook and process function. User can store some context, such as word dictionary, tosettings object in init_hook, and use them in process.

The settings object is actually DataProvider object itself. There are many fields in it, but they are mostly used by Paddle Core code.