dennis-de-swart/php-moby-nlp
Composer 安装命令:
composer require dennis-de-swart/php-moby-nlp
包简介
Gets the complete thought from a verb and a noun using Moby Thesaurus
README 文档
README
Gets the "complete thought" from a verb and a noun using Moby Thesaurus
What does it do?
- It uses the Moby Thesaurus to get the "complete thought" from a verb and a noun.
- This is meant for Natural Language Processing (NLP) tasks.
How does it work?
- The code looks for "complete thoughts", see the link to Wikipedia here:
https://simple.wikipedia.org/wiki/Simple_sentence
- First: open the index.php, a form will appear.
- Second: enter a verb, like "walk", "talk" or "run". It is best to user the base form or lemma. So do not use "running", but use "run". This program can be used to get the lemma for you:
https://github.com/DennisDeSwart/php-stanford-corenlp-adapter
https://www.phpclasses.org/package/10056-PHP-Natural-language-processing-using-Stanford-server.html
- Third, enter a noun like "dog", "cat", "house" or "car".
- Finally, press Submit, wait for the result. The result may take up to 2 seconds.
What can I do with the result?
- First, you can use it in spam killers: if there are complete thoughts in a text, the text is probably not fake.
- Second: you can use this for creating reports and understanding text.
- Third: this could be used as suggestions in search engines.
Requirements
- PHP 5.3 or higher: it also works on PHP 7
Installation using Composer
You can install the adapter by putting the following line into your composer.json and running a composer update
{
"require": {
"dennis-de-swart/php-moby-nlp": "*"
}
}
Recommended practices
- Looking up words in the thesaurus can take up to 2 seconds. You should only lookup words if you need to.
- To select the most important words like verbs and nouns, you can use a NLP parser like Stanford's CoreNLP
- To use Stanford CoreNLP check these links:
https://github.com/DennisDeSwart/php-stanford-corenlp-adapter
http://stanfordnlp.github.io/CoreNLP/corenlp-server.html
Can I use a different set of words (=thesaurus)?
Yes. This script uses the Moby Thesaurus that is based on the English language from 1996. It doesn't have many modern words. You can change the Thesaurus by using an API. However, this is not programmed yet. To make it happen, there needs to be an API connection. Also the existing Synonym function needs to be re-written to use this API. I want to write a script to use the Urban Dictionary API. This would make it talk "urban". Here is an example on how to connect:
https://github.com/zdict/zdict/wiki/Urban-dictionary-API-documentation
Example output
See "example_write_document.PNG"
Any questions?
Please let me know.
Credits
Brent Rossen, orginal author of the MobyThesaurus.php class
https://github.com/phyous/moby-thesaurus
dennis-de-swart/php-moby-nlp 适用场景与选型建议
dennis-de-swart/php-moby-nlp 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4.6k 次下载、GitHub Stars 达 7, 最近一次更新时间为 2017 年 01 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「nlp」 「thesaurus」 「natural language」 「Moby」 「complete thought」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 dennis-de-swart/php-moby-nlp 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 dennis-de-swart/php-moby-nlp 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 dennis-de-swart/php-moby-nlp 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Interface for Babel Street Text Analytics
A simple PHP WordsAPI wrapper. A dictionary and thesaurus for the English language.
Seamlessly integrate Grok AI into Laravel applications with an elegant, developer-friendly package. Leverage powerful AI models for chat, automation, and NLP while maintaining Laravel's expressive simplicity.
OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API
AI Content Translation for Laravel powered by SharpAPI.com
AI SEO Meta Tag Generator for Laravel powered by SharpAPI.com
统计信息
- 总下载量: 4.6k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-01-08