Python 如何使用wordnet拆分列名并查找字典含义?
我有下面的数据,我正试图得到字典的定义,但它只有在它是一个单词时才起作用。我怎样才能使它与多个单词一起工作 代码: 输出:Python 如何使用wordnet拆分列名并查找字典含义?,python,nltk,Python,Nltk,我有下面的数据,我正试图得到字典的定义,但它只有在它是一个单词时才起作用。我怎样才能使它与多个单词一起工作 代码: 输出: pd.DataFrame(tmp).T 0 1 2 3 a plane figure bounded by the specified day of the month Sector: a plane figure bounded
pd.DataFrame(tmp).T
0 1 2 3
a plane figure bounded by the specified day of the month
Sector: a plane figure bounded by two radii and the included arc of a circle
Community: a group of people living in a particular local area, Name: a language unit by which a person or thing is known
Date: the specified day of the month
Community: a group of people living in a particular local area, Center: an area that is approximately central within some larger region, Point: a geometric element that has position but no extension
第1列和第3列为空,因为“社区名称”和“社区中心点”包含多个单词
期望输出:
0 1 2 3
Sector: [a plane figure...] Community: [definition], Name: [definition] Date: [the specified day of the month] Community: [definition], Center: [definition], Point: [definition]
输出:
pd.DataFrame(tmp).T
0 1 2 3
a plane figure bounded by the specified day of the month
Sector: a plane figure bounded by two radii and the included arc of a circle
Community: a group of people living in a particular local area, Name: a language unit by which a person or thing is known
Date: the specified day of the month
Community: a group of people living in a particular local area, Center: an area that is approximately central within some larger region, Point: a geometric element that has position but no extension