博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
python的Pattern模块
阅读量:2394 次
发布时间:2019-05-10

本文共 1552 字,大约阅读时间需要 5 分钟。

pattern

Pattern is a web mining module for the Python programming language.

It bundles tools for data retrieval (Google + Twitter + Wikipedia API, web spider, HTML DOM parser), text analysis (rule-based shallow parser, WordNet interface, syntactical + semantical n-gram search algorithm, tf-idf + cosine similarity + LSA metrics), clustering and classification (k-means, KNN, SVM), and data visualization (graph networks).

The module is bundled with 30+ example scripts and 350+ unit tests.

Installation

Pattern is written for Python 2.5+ (no support for Python 3 yet). The module has no external dependencies except when using LSA in the vector module, which requires  (installed by default on Mac OS X).

To install it so that the module is available in all your scripts, open a terminal and do:

> cd pattern-2.4> python setup.py install 

If you have pip, you can automatically download and install from the PyPi repository:

> pip install pattern

If none of the above works, you can make Python aware of the module in three ways:

  • Put the pattern subfolder in the same folder as your script.
  • Put the pattern subfolder in the standard location for modules so it is available to all scripts:
    c:\python25\Lib\site-packages\ (Windows),
    /Library/Python/2.5/site-packages/ (Mac OS X),

    /usr/lib/python2.5/site-packages/ (Unix).
  • Add the location of the module to sys.path in your script, before importing it:
>>> MODULE =
'/users/tom/desktop/pattern'
>>>
import
sys;
if
MODULE
not
in
sys.path: sys.path.append(MODULE)
>>>
from
pattern.en
import
parse, Sentence

 

转载地址:http://mozob.baihongyu.com/

你可能感兴趣的文章
cat -n
查看>>
使用 ftrace 调试 Linux 内核,第 2 部分
查看>>
使用 ftrace 调试 Linux 内核,第 3 部分
查看>>
内存储器管理概述、内存分配与释放、地址映射机制(mm_struct, vm_area_struct)、malloc/free 的实现
查看>>
glibc-printf
查看>>
Linux 下 stdin stdout stderr 的由来
查看>>
linux-uart
查看>>
bluetooth数据收发
查看>>
bluetooth之power on流程
查看>>
探讨蓝牙协议栈的原理和结构
查看>>
探讨蓝牙协议栈的原理和结构
查看>>
bootloader之little kernel
查看>>
ARM linux解析之压缩内核zImage的启动过程 一
查看>>
ARM linux解析之压缩内核zImage的启动过程 二
查看>>
arm汇编指令整理
查看>>
bl cache_on跳转的返回
查看>>
B、BL、BX、BLX 和 BXJ
查看>>
ARM linux解析之压缩内核zImage的启动过程 三
查看>>
Linux内核源码分析--zImage出生实录(Linux-3.0 ARMv7)
查看>>
linux命令 ld使用
查看>>