Git Product home page Git Product logo

bosonnlp.py's Introduction

BosonNLP Python SDK

BosonNLP HTTP API 封装库(SDK)。

安装

bosonnlp 代码托管在 GitHub,并且已经发布到 PyPI,可以直接通过 pip 安装:

$ pip install bosonnlp

bosonnlp 以 MIT 协议发布。

使用教程

>>> from bosonnlp import BosonNLP
>>> nlp = BosonNLP('YOUR_API_TOKEN')
>>> nlp.sentiment('这家味道还不错')
[[0.8758192096636473, 0.12418079033635264]]

SDK API 文档地址:http://bosonnlp-py.readthedocs.org/

可以在 BosonNLP 文档站点阅读详细的 BosonNLP HTTP API 文档。

bosonnlp.py's People

Contributors

messense avatar mrluanma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bosonnlp.py's Issues

Should Class BosonNLP increase a http proxy

I have use a HTTP proxy, and when I use Class BosonNLP to process a text, it return an error below:
Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x0228DA30>: Failed to establish a new connection: [Errno 10060] ',)

Could you add a HTTP proxy param to the Class BosonNLP

basetime does not work

convert_time(content, basetime=None)[source]
BosonNLP 时间描述转换接口 封装

Parameters:
content (string) – 中文时间描述字符串
basetime (int or datetime.datetime) – 时间描述的基准时间,传入一个时间戳或datetime

>>> import datetime
>>> _json_dumps(nlp.convert_time("今天晚上8点到明天下午3点", datetime.datetime(**2015, 9, 1**)))
'{"timespan": ["**2015-09-02 20:00:00**", "2015-09-03 15:00:00"], "type": "timespan_0"}'

无法注册账号

官网注册一直失败,一会说验证码不对,一会说多时间内发送太多次(实际才2次),死活收不到验证码,弃疗。。。

一些问题

bosonnlp-rs(BosonNLP SDK for Rust) 玩遇到的一些问题:

1、 时间转换 API curl 示例调用结果报错

{"error": "no time pattern could be extracted."}

用 Python SDK 调用也是一样的情况。

2、上面这种情形下 HTTP status code 为 200,也没有遵循错误信息用 message 字段的惯例(好像还有部分 API 出错时会返回 HTML 页面的情况)

3、cluster/comments clear 的 API 返回结果不是 JSON,这对于静态强类型语言来说不是很友好

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.