利用SAS Toolkit写的一个过程步,可以在SAS代码中调用JIEBA中文分词功能,源代码在 https://github.com/SASAnalyser/PROC-JIEBA,可以执行文件: https://github.com/SASAnalyser/PROC-JIEBA/releases
需要Windows 或者Linux 下安装有64位 SAS 9.4 (Unicode 支持),例子:
data indata;
format inword $char200.;
input inword;
datalines;
小明硕士毕业于中国科学院计算所,后在日本京都大学深造
;
run;
proc jieba data=indata out=outdata maxword=32;
dictpath "C:\SASToolkit\cjieba\dict";
var inword;
instr "我是拖拉机学院手扶拖拉机专业的";
run;
对indata里var 指定的变量如果没var则对所有字符变量分词和 instr指定的句子分词。
结果保存在 out 数据集,如果不指定 out 数据集则结果打印在日志窗口。
不好意思,好久没来这里。是的,是用SAS提供的编程接口工具SAS/TOOLKIT来写的调用jieba功能的一个自定义过程步,具体的实现可看完整的源代码 https://github.com/SASAnalyser/PROC-JIEBA 和SAS/TOOLKIT 帮助文档 https://support.sas.com/documentation/onlinedoc/toolkit/p245.pdf
data _null_;
put "呵呵,恭喜你有发现!";
run;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!