Skip to main content

A machine learning–based method for transforming text into instrumental variables (IV).

Project description

TexIV


A machine learning–based package for transforming text into instrumental variables (IV).

PyPI version License: MIT Issue


icon

🌰 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., venv or conda)

🚀 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

texiv-0.1.3.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

texiv-0.1.3-py3-none-any.whl (26.6 kB view details)

Uploaded Python 3

File details

Details for the file texiv-0.1.3.tar.gz.

File metadata

  • Download URL: texiv-0.1.3.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.19

File hashes

Hashes for texiv-0.1.3.tar.gz
Algorithm Hash digest
SHA256 9851847015345e6aa304526611b4eb6bb07b944855b372cdcf8194d3b51f464d
MD5 a400c27fb1078a1b42a2c5c5aa65e4b2
BLAKE2b-256 415e743beb9fe97d1eba85b55ce6c46bad3460a066f1f70aa52c4a2ef2314f3b

See more details on using hashes here.

File details

Details for the file texiv-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: texiv-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 26.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.19

File hashes

Hashes for texiv-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d5df0ce3faab7dce7e6c24b33a2cc88fdd4dda652f163e59e66cdbd44fc1df14
MD5 1a5c6214adc25ab3db1a3690bd9ef7a3
BLAKE2b-256 57218152e6642529e01568a56e65e57277eb73df637c7e2f85c0ac9ba8acf31b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page