Skip to main content

asc-analyzer

Project description

ASC-analyzer

The ASC Analyzer extracts Argument Structure Constructions (ASCs) from raw English texts and computes indices related to ASC usage.

Installation

To ensure stability and compatibility, we recommend installing dependencies in the following order:

  1. Install spaCy:

    pip install spacy
    
  2. Install spaCy-transformers:

    pip install spacy-transformers
    
  3. Download the transformer-based spaCy model:

    python -m spacy download en_core_web_trf
    
  4. Install the ASC analyzer package:

    pip install asc-analyzer
    

Quickstart

Prepare a directory with .txt files (e.g., data/text/). Each file should contain plain English text.

Then run:

asc-analyzer \
  --input-dir data/text \
  --source cow \
  --print-asc \
  --save-asc-output

This command will:

  • Assign ASC tags to each sentence
  • Print the ASC-tagged results directly to the terminal (--print-asc)
  • Save token-level ASC tagging results as *_ASCinfo.txt files (--save-asc-output)
  • Compute ASC usage statistics (e.g., diversity, proportion, frequency, and verb–ASC association strength) and save them in a CSV summary file
  • The --source option determines which reference corpus is used for computing frequency and association measures:
    • cow: uses the COW corpus (web-based, written English)
    • subt: uses the SUBTLEX corpus (subtitle-based, spoken English)
    • Choose the source based on the register that best matches your input data.

Options

Option Description
--input-dir, -i Input folder with .txt files (default: data/test)
--output-csv, -o Path to save output CSV (default: data/Written_<source>.csv)
--source, -s Reference dataset: cow (written, default) or subt (spoken)
--indices, -x Comma-separated list of indices to include in CSV
--save-asc-output Save ASC-tagged outputs for each file (*_ASCinfo.txt)
--print-asc Print ASC-tagged output to terminal

Output for --print-asc

When using the --print-asc option, the output for each sentence shows aligned token information and its ASC label (None if no ASC applies):

# sent_id = 1
1	The	the	
2	idea	idea	
3	is	be	ATTR
4	trust	trust	

You can save this output to txt files by including --save-asc-output.

Citation

License

This project is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

See the full license here.

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

asc_analyzer-0.0.6.tar.gz (12.7 MB view details)

Uploaded Source

Built Distribution

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

asc_analyzer-0.0.6-py3-none-any.whl (13.4 MB view details)

Uploaded Python 3

File details

Details for the file asc_analyzer-0.0.6.tar.gz.

File metadata

  • Download URL: asc_analyzer-0.0.6.tar.gz
  • Upload date:
  • Size: 12.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for asc_analyzer-0.0.6.tar.gz
Algorithm Hash digest
SHA256 c306794eb35a5513e144b21059ae7f17e40407eabb413748fd3aff630c35a415
MD5 6d9b3d89fbc2a87f259e50e424421568
BLAKE2b-256 a67014c185f2d3c0178332aec2e5dec87ec617cb820c36f6485e4c332bd5b65f

See more details on using hashes here.

File details

Details for the file asc_analyzer-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: asc_analyzer-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 13.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for asc_analyzer-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 52890fc31770d462a1fac46729c392b5b932d96b9f6facb48f5c928265be13c7
MD5 5a004d27c64291c91c57538fdcc97e7c
BLAKE2b-256 2f985208b84846d0f1c5d7c07a2631e8c180d39d0b7948d418ddbff44a71b509

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