Skip to content

xwmhmily/Swoole_nlp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Use Swoole and Jieba to cut Chinese words

PHP-Jieba 官方文档

https://github.com/fukuball/jieba-php

MiniHttp (Base on Swoole) 文档

https://github.com/xwmhmily/miniHttp

安装

  • 安装 PHP 7+, Swoole 4+
  • git clone 至任一目录

启动

  • cd 至 shell 目录, 执行 sh socket.sh restart 开启 API 服务
  • 启动成功使用 sh socket.sh status 将看到以下进程在默默的等候命令了
Swoole_nlp_master
Swoole_nlp_manager
Swoole_nlp_worker

访问

Array
(
    [segmentation] => Array
        (
            [0] => 我
            [1] => 一会
            [2] => 开车
            [3] => 过去
            [4] => 看看
        )

    [trunk] => Array
        (
            [开车] => 1.9574849809925
            [一会] => 1.75661978913
            [看看] => 1.352611160535
            [过去] => 1.1887989630875
        )

    [start] => 1596677807.9851
    [end] => 1596677807.9853
    [cost] => 0.00020003318786621
)

(⊙v⊙)嗯,仅用了 0.0002 秒就完成了,还不错

心跳检测

  • 利用Crond 定时运行 shell/socket.sh heartbeat 即可, 妈妈再也不用担心我不会分词了

About

Use Swoole and Jieba to cut the Chinese words

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published