mirror of
https://gitee.com/fastnlp/fastNLP.git
synced 2024-12-05 05:38:31 +08:00
给 dataset 增加了get_field_names
This commit is contained in:
parent
bb01904fc8
commit
3465d2a08f
@ -501,6 +501,14 @@ class DataSet(object):
|
||||
"""
|
||||
return self.field_arrays
|
||||
|
||||
|
||||
def get_field_names(self)->list:
|
||||
"""返回一个list,包含所有 field 的名字
|
||||
|
||||
:return: list:
|
||||
"""
|
||||
return sorted(self.field_arrays.keys())
|
||||
|
||||
def get_length(self):
|
||||
"""获取DataSet的元素数量
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user