Skip to content

Repository files navigation

USAS_semantic_classifier

A Python tool that reads a USAS‑tagged text file, filters out function words and auxiliary tags, and generates a frequency table of semantic categories with example words. UCREL Semantic Analysis System (USAS) is a framework for undertaking the automatic semantic analysis of text. The framework has been designed and used across a number of research projects and this page collects together various pointers to those projects and publications produced since 1990. https://ucrel.lancs.ac.uk/usas/

Date

  • Initial creation: 2025-12-20
  • Uploaded to Github: 2026-07-29

Author

  • HowardHart

Features

  • Parses tokens in word_tag format (e.g., frozen_O4.6-)
  • Supports multi‑tags like Z1/P4 (treated as a single tag)
  • Excludes:
    • Punctuation: PUNC
    • Function words: tags starting with Z4, Z5, Z6, Z7, Z8, Z9
    • Auxiliary/helper tags: A7+, A3+, A9+, A9-, T1.1.3, N5.1+ (modals, copulas, auxiliaries, quantifiers)
  • Explicitly keeps: N4, N6+, X7+, A13.3 (order/frequency/want/degree words)
  • Outputs CSV with:
    • semantic_tag – the USAS semantic category
    • frequency – occurrence count
    • examples – list of unique words for that tag

Repository Structure

  • usas_semantic_classifier.py – main Python script
  • usas_semantic_classifier.ipynb - Jupyter Notebook version for interactive execution
  • USASSemanticTagset.pdf - reference documentation of the USAS semantic tagset
  • sample.txt – example USAS‑tagged input file (you provide your own)
  • sample_usas_semantic_frequencies – example output result (frequency table with examples)
  • requirements.txt – Python dependencies
  • README.md – project documentation (this file)

Requirements

  • Python 3.x
  • pandas

Install all dependencies with:

pip install -r requirements.txt

About

A Python tool that reads a USAS‑tagged text file, filters out function words and auxiliary tags, and generates a frequency table of semantic categories with example words.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages