A machine learning–based package for transforming text into instrumental variables (IV).
🌰 Example
Visit Stata Example File and Python Example File.
There is a step-by-step example.
✨ Feature
- Support multiple Chinese word segmentation and embedding methods
- Customizable stopwords
- Support keyword relevance filtering and two-stage filtering
- Output includes frequency, total count, and ratio statistics
📦 Requirements
- Python 3.11+
- Recommended to use virtual environment (e.g.,
venvorconda)
🚀 Quickly Start
Install
pip install texiv
Usage
from typing import List
from texiv import TexIV
texiv = TexIV()
content: str = "This is a test text..."
keywords: List[str] = ["keyword1", "keyword2", "keyword3"]
texiv.texiv_it(content, keywords)
Output example:
{'freq': 7, 'count': 34, 'rate': 0.20588235294117646}
🖥️ Command Line Tool
The project also provides a command-line interface that can be used directly after installation:
texiv --help
🛠️ Configuration
All models and parameters can be adjusted through configuration files in ~/.texiv/config.toml.
📄 License
This project is licensed under the MIT License. See LICENSE for details.
Metadata
Release files for TexIV 0.1.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| texiv-0.1.10.tar.gz | 3.0 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| texiv-0.1.10-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 3.1 MB
Release files / texiv-0.1.10.tar.gz
| Download URL | texiv-0.1.10.tar.gz |
|---|---|
| Size | 3.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c07e86285ee4e0f36bfa6f1d3813883f6d10d224d57de3a3f311aa0634c7ddf8
|
|
BLAKE2b-256 checksum How to use checksums |
e9cc08c2142a9f00bec53cd958837302c4d95e28e78ded53e068cecc89e3f0a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.21
|
Release files / texiv-0.1.10-py3-none-any.whl
| Download URL | texiv-0.1.10-py3-none-any.whl |
|---|---|
| Size | 37.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
099dc44eb7bb51a72f6bd45f825060e552f2edcb5606bbc1a45e6ea6584fd0ab
|
|
BLAKE2b-256 checksum How to use checksums |
fa0040aa3a83e5ff95773f1e52a85d001c76856c9c38df8874ded0cc8d7e79f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.21
|