File size: 1,613 Bytes
e4b9a7b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | .. currentmodule:: pythainlp.parse
pythainlp.parse
===============
The :class:`pythainlp.parse` module provides dependency parsing for the Thai language. Dependency parsing is a fundamental task in natural language processing that involves identifying the grammatical relationships between words in a sentence, which helps to analyze sentence structure and meaning.
Modules
-------
dependency_parsing
~~~~~~~~~~~~~~~~~
.. autofunction:: dependency_parsing
The `dependency_parsing` function is the core component of the `pythainlp.parse` module. It offers dependency parsing capabilities for the Thai language. Given a Thai sentence as input, this function parses the sentence to identify the grammatical relationships between words, creating a dependency tree that represents the sentence's structure.
Usage
~~~~~
To use the `dependency_parsing` function for Thai dependency parsing, follow these steps:
1. Import the `pythainlp.parse` module.
2. Use the `dependency_parsing` function with a Thai sentence as input.
3. The function will return the dependency parsing results, which include information about the grammatical relationships between words.
Example
~~~~~~~
Here's a basic example of how to use the `dependency_parsing` function:
::
from pythainlp.parse import dependency_parsing
# Input Thai sentence
sentence = "พี่น้องชาวบ้านกำลังเลี้ยงสตางค์ในสวน"
# Perform dependency parsing
parsing_result = dependency_parsing(sentence)
# Print the parsing result
print(parsing_result)
|