Research on Automatic Classification Model of Massive Academic Resources in Library
Received date: 2018-03-13
Online published: 2025-04-28
[Purpose/significance] In order to solve the problem that users often have difficulty in obtaining information in massive digital resources of library, this paper construct a personalized knowledge service system, which is the inevitable choice of library to help users to get rid of the information overload predicament and improve the quality of knowledge service. [Method/process] Firstly, this paper built a mapping model of Chinese Library Classification(CLC) and subject classification. Then, based on Hadoop distributed processing platform, it proposed to build automatic classification model of massive academic resources in libraries by improving TF-IDF+ Bayesian algorithm, the model can help to construct the personalized knowledge service systems in library. [Result/conclusion] In the experimental part,we collected more than 6 million documents from CNKI as the original training corpus (corpus covers 75 disciplines) to test the effectiveness of the classification model, the experimental result shows that the classification efficiency and effectiveness of the model are achieved.
Key words: automatic classification; Hadoop; TF-IDF; Bayes
yangya , yiyuanhong . Research on Automatic Classification Model of Massive Academic Resources in Library[J]. Knowledge Management Forum, 2018 , 3(3) : 172 -180 . DOI: 10.13266/j.issn.2095-5472.2018.017
表1 中图法与学科分类法部分映射表 |
| 中图号 | 学科名称 | 中图号 | 学科名称 |
| A1~A8 | 马克思主义理论 | C94 | 系统科学 |
| B0~B83,B9 | 哲学 | C95 | 民族学 |
| B84 | 心理学 | D0-D8 | 政治学 |
| C0-C7,C91-C92 | 社会学 | D9-DF | 法学 |
| C8 | 经济学 | E0-E9 | 军事学 |
| C93,C96-C97 | 管理科学与工程 | ... | ... |


表示某一词汇
在该篇文本中出现的次数,分母为该篇文本中所有词汇出现次数的总和。公式(2)中
表示语料库的文本总数,
表示包含词汇
的文本数目,如果该词汇不在语料库中,就会导致被分母为零,所以一般情况使用
。
在某个学科
频繁出现,而在其他学科极少出现时,通常会被赋予较低的权重,说明该词汇类别区分能力不强。但是实际上,当学科
中包含词汇
的文本数量大,而其他学科中包含词汇
的文本数量小,则说明词汇
能很好地代表学科
的文本特征,具有很好的类别区分能力。因此,针对这个缺陷,张玉芳[14]等将公式(2)变形为
为修正系数,表示某个学科
中包含词汇
的文本数目,
表示除学科
外包含词汇
的文本数目。可以看出
随着
的增大而增大,随着
的增大而减小,这刚好能弥补IDF定义的缺陷。
,特征词出现在关键词位置应具备更好的类别区分能力,大量实验显示
时效果比较好,则公式(3)变形为
值时都去基于语料库统计,响应时间较长且浪费计算资源。因此,本文基于MapReduce事先对整个语料库中的每个词计算出
值,并将结果存放在Mysql数据库中,当计算某个词汇的
值时,直接去Mysql数据库中取即可。实现过程如下:
。输出key为某一词汇,value为该词汇对应的idf值。将结果放入Mysql数据库中,并建好索引。
,按照一定比例选取该文本的特征词集。
,每个特征词有k种类别,即
,则分类函数记作
,即转化为求解概率函数
,即
,分母的值都一样,所以可以忽略分母部分;
是先验概率,根据训练集就可以简单地计算出来;然后根据贝叶斯理论假设特征词属性
互相独立,则



是类别为
的文本数量,
是总的样本数量,
是类别为
的文本中,包含特征词
的文本数量,
表示训练集中所有关键词的数量,
是平滑值,在实际应用中一般取值1。
和
进行估计,前者是对训练集的类别统计,后者则需要基于语料库统计每个词与75个学科类别的关系。因此,使用MapReduce编程框架实现基于海量语料库的贝叶斯模型参数估计,并将各个参数值放入Mysql数据库,以便模型进行学科标引时使用。具体步骤如下:
、查全率
以及基于两者的综合指标
,查准率
是分类器正确判断为该类的样本数与判断属于该类的样本总数的比率,查全率
是分类器正确判断为该类的样本数与属于该类的样本总数的比率[15]。计算公式如下:

为属于某类别且被判定为该类别的文本数量,
为不属于某类别但被判定为该类别的文本数量,
为属于某类别但未被判定为该类别的文本数量。根据
和
计算出
,即
表2 idf值对比情况 |
| 特征词 | TF-IDF算法 | 改进TF-IDF算法 | 特征词 | TF-IDF算法 | 改进TF-IDF算法 |
| 佞佛 | 5.804 | 5.804 | 观察 | 1.207 | 1.906 |
| 新牌 | 5.615 | 5.615 | 利用 | 1.150 | 1.817 |
| 前庭大腺 | 4.976 | 5.277 | 相关 | 1.116 | 1.327 |
| 复兴路 | 4.858 | 5.050 | 作用 | 1.097 | 1.385 |
| 镇肝熄风汤 | 4.854 | 5.133 | 临床 | 1.092 | 2.372 |
| 菠萝蜜 | 4.849 | 5.060 | 中国 | 1.069 | 1.294 |
| 腊肠 | 4.620 | 4.958 | 进行了 | 1.043 | 1.224 |
| 剖面图 | 4.364 | 4.630 | 患者 | 0.993 | 2.178 |
| 补中益气 | 4.219 | 4.616 | 影响 | 0.879 | 1.191 |
| 诺尔 | 4.208 | 4.519 | 结论 | 0.851 | 1.136 |
| 血液制品 | 4.206 | 4.600 | 目的 | 0.809 | 1.054 |
| 上海大学 | 4.086 | 4.480 | 本文 | 0.787 | 0.984 |
| 味觉 | 3.978 | 4.304 | 发展 | 0.773 | 0.918 |
| 重点企业 | 3.834 | 4.292 | 研究 | 0.758 | 0.909 |
| ... | ... | ... | 分析 | 0.569 | 0.879 |
表3 实验结果 |
| 学科类别 | LDA+SVM | 改进TF-IDF+贝叶斯 | ||||
| P | R | F1 | P | R | F1 | |
| 天文学 | 0.798 | 0.756 | 0.776 | 0.855 | 0.847 | 0.851 |
| 控制科学与工程 | 0.752 | 0.748 | 0.750 | 0.828 | 0.857 | 0.842 |
| 经济学 | 0.749 | 0.729 | 0.739 | 0.821 | 0.846 | 0.833 |
| 计算机科学与技术 | 0.798 | 0.762 | 0.780 | 0.839 | 0.858 | 0.848 |
| 数学 | 0.720 | 0.736 | 0.728 | 0.834 | 0.845 | 0.839 |
| 军事学 | 0.756 | 0.764 | 0.760 | 0.825 | 0.846 | 0.835 |
| 水产 | 0.781 | 0.758 | 0.769 | 0.836 | 0.845 | 0.840 |
| 食品科学与工程 | 0.769 | 0.786 | 0.777 | 0.849 | 0.861 | 0.855 |
| ... | ... | ... | ... | ... | ... | ... |
杨亚: 数据处理,撰写并修正论文;
易远弘: 学术资源整理,提出论文的修改意见。
| [1] |
VIKAS K, VIJAYAN K, LATHA P. A comprehensive study of text classification algorithms[C]// Proceedings of 2017 International Conference on Advances in Computing, Communications and Informatics (ICACCI).Udupi:IEEE press,2017:1109-1113.
|
| [2] |
高元. 面向个性化推荐的海量学术资源分类研究[D].宁波:宁波大学,2017.
|
| [3] |
贺鸣,孙建军,成颖.基于朴素贝叶斯的文本分类研究综述[J].情报科学,2016,34(7):147-154.
|
| [4] |
KUPERVASSER O. The mysterious optimality of naive bayes: estimation of the probability in the system of “classifiers”[J].Pattern recognition and image analysis,2014,24(1):1-10.
|
| [5] |
LEWIS D. Naive (Bayes) at forty: The independence assumption in information retrieval[C]//Proceedings of 10th European Conference on Machine Learning Chemnitz. Berlin: Springer,1998:4-15
|
| [6] |
LI Y J, LUO C N, CHUNG S M. Weighted naive bayes for text classification using positive term-class dependency[J].International journal on artificial intelligence tools, 2012,21(1):1250008-1250015.
|
| [7] |
邸鹏,段利国.一种新型朴素贝叶斯文本分类算法[J].数据采集与处理,2014,29(1):71-75.
|
| [8] |
杜选.基于加权补集的朴素贝叶斯文本分类算法研究[J].计算机应用与软件,2014,31(9):253-255.
|
| [9] |
张杰,陈怀新.基于归一化词频贝叶斯模型的文本分类方法[J].计算机工程与设计,2016,37(3):799-802
|
| [10] |
艾雰.2010—2016年《中国图书馆分类法》(第5版)研究现状分析[J].图书馆建设,2017(5):39-44,72.
|
| [11] |
LI Q, CHEN L. Study on multi-class text classification based on improved SVM[C] //Proceedings of the Eighth International Conference on Intelligent Systems and Knowledge Engineering, Shenzhen:Springer Berlin Heidelberg,2014:519-526.
|
| [12] |
ZHANG Y T, WANG GL. An improved TF-IDF approach for text classification[J].Journal of zhejiang university-science a,2005,6(1):49-55.
|
| [13] |
KIM S B, RIM H C. Effective Methods for improving naive bayes text classifiers[C] //Proceedings of 7th Pacific Rim international conference on artificial intelligence. Berlin:Springer, 2002: 414-423.
|
| [14] |
张玉芳,彭时名,吕佳.基于文本分类TFIDF方法的改进与应用[J].计算机工程,2006(19):76-78.
|
| [15] |
苏金树,张博锋,徐昕.基于机器学习的文本分类技术研究进展[J].软件学报,2006(9):1848-1859.
|
/
| 〈 |
|
〉 |