End-to-end Analyses of English ASCs with a Supervised Learning-based ASC Tagger
To ensure stability, I recommend installing dependencies in the following order:
-
Install
spaCy:pip install spacy
-
Install
spaCy-transformers:pip install spacy-transformers
-
Download the transformer-based spaCy model:
python -m spacy download en_core_web_trf
-
Install the ASC analyzer package:
pip install asc-analyzer
- Note: The package name on PyPI is asc-analyzer, but the internal Python module is asc_analyzer.
- Prepare a directory with
.txtfiles. Each file should contain plain English text.
Then run the analyzer using:
- Option 1. Save summary statistics as a csv
python3 -m asc_analyzer.cli \
--input-dir "/path/to/texts" \
--output-csv "/path/to/output.csv" \
--source "cow" # or "subt"- Option 2. Save ASC-tagged text files
python3 -m asc_analyzer.cli \
--input-dir "/path/to/texts" \
--save-asc-output \ # Saves ASC-tagged files in the same directory as the input
--source "cow"- 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.txtfiles (--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
--sourceoption determines which reference corpus is used for computing frequency and association measures:cow: uses the EnCOW corpus (web-based, written English)subt: uses the SUBTLEX corpus (subtitle-based, [transcribed] spoken English)- Choose the source based on the register that best matches your input data.
To view all available options and flags, run:
python3 -m asc_analyzer.cli --help| Option | Description |
|---|---|
--input-dir |
Directory containing .txt files to process (default: asc_analyzer/data/test) |
--output-csv |
Path to save the resulting CSV (default: Written_COW.csv or Spoken_SubT.csv) |
--source |
Reference dataset: cow (written, default) or subt (spoken) |
--indices |
Comma-separated list of index names to include in the CSV (default: all standard indices) |
--save-asc-output |
Save ASC-tagged outputs as *_ASCinfo.txt in the input directory |
--print-asc |
Print ASC-tagged results to the terminal |
When using the --print-asc option, the ASC Analyzer prints token-level tagging results directly to the terminal in a tabular format.
python3 -m asc_analyzer.cli \
--input-dir "/path/to/texts" \
--print-ascExample output:
# 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 (as shown in Option 2 of the Quickstart section).
-
If you use the ASC analyzer, please cite the following paper:
- Sung, H., & Kyle, K. (2025). ASC Analyzer: A Python package for measuring argument structure construction usage in English texts. In Proceedings of the 2nd Workshop on Construction Grammars and NLP (CxGs+NLP). [Poster]
-
If you use the ASC tagger (e.g.,
--print-asc,--save-asc-output), please cite the following paper:- Sung, H., & Kyle, K. (2024). Leveraging Pre-trained Language Models for Linguistic Analysis: A Case of Argument Structure Constructions. Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing (EMNLP).
This project is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
