Skip to content

Add Attaparse engine to dependency parser - #1303

Merged
bact merged 3 commits into
devfrom
copilot/add-attaparse-dependency-parser
Mar 3, 2026
Merged

Add Attaparse engine to dependency parser#1303
bact merged 3 commits into
devfrom
copilot/add-attaparse-dependency-parser

Conversation

Copilot AI commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

Adds Attaparse — a Stanza+PhayaThaiBERT-based Thai dependency parser — as a new engine option in pythainlp.parse.dependency_parsing.

Changes

  • pythainlp/parse/attaparse_engine.py (new): Parse class wrapping attaparse.load_model() / attaparse.depparse(), converting Stanza output to CoNLL-U str or list[list[str]]
  • pythainlp/parse/core.py: Added attaparse branch in engine dispatch; updated docstring
  • pyproject.toml: Added attaparse>=1.0.0 to standalone attaparse, dependency_parsing, and full optional dep groups; added attaparse.* and stanza.* to mypy overrides
  • tests/extra/testx_parse.py: Added str and list output test cases
  • CHANGELOG.md: Logged new engine

Usage

from pythainlp.parse import dependency_parsing

# CoNLL-U string output
result = dependency_parsing("ผมเป็นคนดี", engine="attaparse")

# List of token rows
result = dependency_parsing("ผมเป็นคนดี", engine="attaparse", tag="list")

Your checklist for this pull request

  • Passed code styles and structures
  • Passed code linting checks and unit test

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • cas-bridge.xethub.hf.co
    • Triggering command: `/usr/bin/python python -c
      from pythainlp.parse import dependency_parsing

Test str output

result = dependency_parsing('������������������������������', engine='attaparse')
print('=== String output ===')
print(result)
print()

Test list output

result_list = dependency_parsing(` (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Add Attaparse to Dependency Parser</issue_title>
<issue_description>Add Attaparse to Dependency Parser

Attaparse : Thai Dependency Parser

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: wannaphong <8536487+wannaphong@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Attaparse to dependency parser Add Attaparse engine to dependency parser Mar 2, 2026
@wannaphong
wannaphong marked this pull request as ready for review March 2, 2026 08:10
@coveralls

coveralls commented Mar 2, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 65.286% (-0.2%) from 65.437%
when pulling 3d0ae9a on copilot/add-attaparse-dependency-parser
into b008610 on dev.

@sonarqubecloud

sonarqubecloud Bot commented Mar 2, 2026

Copy link
Copy Markdown

@bact
bact merged commit fa4db9a into dev Mar 3, 2026
23 of 24 checks passed
@bact
bact deleted the copilot/add-attaparse-dependency-parser branch March 3, 2026 08:59
@bact bact added this to the 5.3 milestone Mar 8, 2026
@bact bact added the enhancement enhance functionalities label Mar 10, 2026
@bact bact added this to PyThaiNLP Mar 10, 2026
@bact bact moved this from Done to In progress in PyThaiNLP Mar 10, 2026
@bact bact moved this from In progress to Done in PyThaiNLP Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement enhance functionalities

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add Attaparse to Dependency Parser

4 participants