Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

valleytext

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

valleytext

Extract keywords from sentences.

  • 0.1
  • PyPI
  • Socket score

Maintainers
1

========= ValleyText

This tool can be used to extract keywords from sentences without chunks or word boundaries (for example, Chinese). It is based on trie tree optimized by AhoCorasick Automation.

Installation

::

$ pip install valleytext

Usage

Extract keywords >>> from valleytext import create_trie >>> words_dict = {'设备': ['GPS', '设备']} >>> extractor = create_trie(words_dict, False) >>> extracts = extractor.extract_keywords_from_text('我有一台gps设备') >>> extracts >>> # [(4, 7, 'gps', '设备'), (7, 9, '设备', '设备')]

License

The project is licensed under the MIT license.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc