广告
返回顶部
首页 > 资讯 > 后端开发 > Python >python的Pattern模块
  • 907
分享到

python的Pattern模块

模块pythonPattern 2023-01-31 02:01:17 907人浏览 独家记忆

Python 官方文档:入门教程 => 点击学习

摘要

Pattern is a WEB mining module for the python programming language. It bundles tools for data retrieval (Google + T

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 NumPy (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

 


--结束END--

本文标题: python的Pattern模块

本文链接: https://www.lsjlt.com/news/185561.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • python的Pattern模块
    Pattern is a web mining module for the Python programming language. It bundles tools for data retrieval (Google + T...
    99+
    2023-01-31
    模块 python Pattern
  • python模块:smtplib模块
    1.使用本地的sendmail协议进行邮件发送格式(1):smtpObj=smtplib.SMTP([host [,port [,local_hostname]]])host:SMTP服务器主机的IP地址或者是域名port:服务的端口号(默...
    99+
    2023-01-31
    模块 python smtplib
  • Python模块:time模块
    time模块:python中处理时间的基础模块,有时间戳,元组,自定义,三种时间表现形式。python中时间戳的值是以1970年1月1日0点开始计算的,单位是秒。时间戳:就是两个时间差的数值。时区:传说中在开发服务器/客户端程序时,时区不一...
    99+
    2023-01-31
    模块 Python time
  • Python中的sys模块、random模块和math模块
    一、sys运行时环境模块 sys模块负责程序与python解释器的交互,提供了一系列的函数和变量,用于操控python的运行时环境。 用法: sys.argv:命令行参数List,第...
    99+
    2022-11-11
  • Python 中开发pattern的string模板(template) 实例详解
    定制pattern的string模板(template) 详解 string.Template的pattern是一个正则表达式, 可以通过覆盖pattern属性, 定义新的正则表达式. 如: 使用新的定界...
    99+
    2022-06-04
    详解 实例 模板
  • python中的sys模块和os模块
    目录1.sys模块2.os模块(和操作系统相关数据)1.sys模块 sys模块的常见函数列表: sys.argv: 实现从程序外部向程序传递参数。sys.exit([arg]): 程...
    99+
    2022-11-13
  • Python中的time模块和calendar模块
    目录1、时间戳2、时间元组3、获取当前时间4、格式化时间5、格式化日期6、获取CPU时间7、日历模块在Python中对时间和日期的处理方式有很多,其中转换日期是最常见的一个功能。Py...
    99+
    2022-11-12
  • python模块学习(queue模块的Q
    学习版本3.5.2 PriorityQueue类和LifoQueue类继承Queue类然后重写了_init、_qsize、_put、_get这四个类的私有方法 Queue:先进先出队列的同步实现,通过双向列表实现的 # Initi...
    99+
    2023-01-31
    模块 python queue
  • python中的deque模块(collections的deque模块)
    目录 1. deque是python的collections中的一个类 2.deque的简单使用以及它的方法 2.1 创建deque的方法  2.2 创建deque时,并指定大小maxlen,即能装几个元素, 以及d...
    99+
    2023-09-25
    python 开发语言 collections deque 队列
  • 使用Python模块:struct模块
    Python没有提供直接的将用户定义的数据类型和文件IO关联起来的功能,但是它提供了struct库(是一个内置库)——我们可以以二进制模式来写这些数据(有趣的是,它真的是设计来讲文本数据写为缓存的) 1)bytes、str...
    99+
    2023-01-31
    模块 Python struct
  • python模块学习----nmap模块
    安装nmap模块:pip install python_nmanmap模块说明:python-nmap是一个帮助使用nmap端口扫描器的python库。它允许轻松操纵nmap扫描结果,并且将是一个完美的选择,为需要自动完成扫描任务的系统管理...
    99+
    2023-01-31
    模块 python nmap
  • python加密模块-hashlib模块
    hashlib模块 用于加密相关的操作,3.X里代替了md5模块和sha模块,主要提供SHA1,SHA224,SHA256,SHA384,SHA512,MD5算法 (sha比md5 更复杂、md5 不能反解) 具体应用:用于网站防篡改。具...
    99+
    2023-01-31
    模块 python hashlib
  • Python模块
    初步认识 安装完python后,python自带一部分模块,自带的模块又称作内置模块。其中一部分模块在路径Lib下。(这里的文件夹可以看做包,可以把多个模块放进一个包里) 从模块的来源来讲,可以分三种:内置模块、自定义模块(自己定义的)...
    99+
    2023-01-30
    模块 Python
  • python - 模块
    参考:https://www.cnblogs.com/nulige/p/6166205.html一、模块介绍Python Module(模块),就是一个保存了Python代码的文件。模块能定义函数,类和变量。模块里也能包含可执行的代码。文件...
    99+
    2023-01-31
    模块 python
  • python 模块
    python的模块分为2种:1.标准库(不需要安装,直接导入就可以使用的)2.第三方库(必须要手动安装的)先来介绍2个标准库:sys和os#!/usr/bin/env python# coding: utf-8...
    99+
    2023-01-30
    模块 python
  • python-模块
    一:模块的基本认识: 内置模块 内置模块是python自带的功能,在使用内置模块相应功能时,需要先导入再使用    第三方模块 下载-->安装-->使用 1.找到python所在的根目录-->再找到Scrip...
    99+
    2023-01-31
    模块 python
  • Python的Logging模块
    1.日志的相关概念🍃 日志是指记录系统或应用程序运行状态、事件和错误信息的文件或数据。在计算机系统中,日志通常用于故障排除、性能分析、安全审计等方面。日志可以记录各种信息,如系统启动...
    99+
    2023-09-17
    服务器 linux python
  • python的subprocess模块
    1 os与commands模块​2 subprocess模块​3 subprocess.Popen类 我们几乎可以在任何操作系统上通过命令行指令与操作系统进行交互,比如Linux平台下的shell。​​那么我们如何通过Python来完成这些...
    99+
    2023-01-31
    模块 python subprocess
  • python的pyserial模块
    pyserial是python提供用于进行串口通信的库 源文档:https://pythonhosted.org/pyserial/ 1、安装pyserial pip install pyserial 2、查看电脑现连串口设备 import...
    99+
    2023-01-31
    模块 python pyserial
  • python的lxml模块
    环境:python2.7安装lxml模块pip install lxml例子:from lxml import etree text = ''' <div>     <ul>          <li clas...
    99+
    2023-01-31
    模块 python lxml
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作