1 引言
在目前的双语教学设计中,词汇学习模块集成了如下三种方法:
(1) 按重要性自动排列段落中的关键短语,其算法使用了最新发展的Bert模型;
(2) 自动查询语义相关的短语,其算法基于word2vec和fasttext;
(3) 自动查询语义相关的词汇,其算法基于Spacy的en_core_web_lg模型;
在此基础上,新增加了对每个单词的英文解释。本笔记简述了这个功能的工作原理及其实测结果。
2 词汇自动解释
新增的词汇自动解释功能使用了NLTK的WordNet库[A Lexical Database for English],首先利用Spacy对句子进行分词,去掉stopwords以及一些非关键的词,只保留名词,动词和形容词;然后对句中的每一个关键单词作出解释,同时给出简单的例句。
from nltk.corpus import wordnet
WordNet是一个大型的英语词汇数据库, 由普林斯顿大学(Princeton University)研究开发,每个同义词表达一个独特的概念。同义词组通过概念-语义和词汇关系相互连接。由此产生出有意义的相关词和概念的网络。WordNet的结构使其成为计算语言学和自然语言处理的有用工具。
WordNet表面上类似于词库,因为它根据词的含义将其分组。然而,其中有一些重要的区别。首先,WordNet不仅将单词的形式--字母串--而且将单词的具体意义相互联系起来。其次,WordNet标明了词语之间的语义关系,而词库中的词语分组除了意义相似外,并不遵循任何明确的模式。
普林斯顿大学校园
3 验证
下面例子显示了一个词汇的完整解释:
(1) slope
语义相关的词汇:
bounce height
movement velocity
slope angle
upslope
hillslope
downslope
steep
steeper
ridge
解释:
[1] Slope-->incline, side, gradient, pitch
[2] Slope-->an elevated geological formation
[3] ['he climbed the steep slope', 'the house was built on the side of a mountain']
[4] Slope-->the property possessed by a line or surface that departs from the horizontal
[5] ['a five-degree gradient']
[6] Slope-->be at an angle
[7] ['The terrain sloped down']
(2) geological
语义相关的词汇:
quantitative rockfall
hydrology
rockfall runout
geomorphological
terrain
geological geotechnical
hydrogeological
seismological
hydrological
geologic
meteorological
morphological
lithological
geology
geophysical
geochemical
stratigraphic
sedimentary
解释:
[1] geological--> geological, geologic
[2] geological-->of or relating to or based on geology
[3] ['geological formations', 'geologic forces']
(3) shear
语义相关的词汇:
tension
tensile
pre-existing discontinuities
shear cracks
fracturing through
bending
pre-existent fractures
peak
stress
shearing
compressive
解释:
[1] shear--> shear, fleece
[2] shear-->(physics) a deformation of an object in which parallel planes remain parallel but are shifted in a direction parallel to themselves
[3] ['the shear changed the quadrilateral into a parallelogram']
[4] shear-->a large edge tool that cuts sheet metal by passing a blade through it
[5] shear-->cut with shears
['shear hedges']
[6] shear-->shear the wool from
[7] ['shear sheep']
[8] shear-->cut or cut through with shears
[9] ['shear the wool off the lamb']
[10] shear-->become deformed by forces tending to produce a shearing strain
4 结束语
在目前已经发展的三种词汇学习基础之上,增加了词汇的自动解释功能,能够帮助学生快速理解词汇的确切含义,而这一切都是自动完成的。