Dependency Parsing¶
Dependency Parsing related modeling class
-
class
pororo.tasks.dependency_parsing.
PororoDpFactory
(task: str, lang: str, model: Optional[str])[source]¶ Bases:
pororo.tasks.utils.base.PororoFactoryBase
Conduct dependency parsing
Korean (posbert.base.ko.dp)
dataset: https://corpus.korean.go.kr/ 구문 분석 말뭉치
metric: UAS (90.57), LAS (95.96)
- Parameters
sent – (str) sentence to be parsed dependency
- Returns
token index, token label, token head and its relation
- Return type
Examples
>>> dp = Pororo(task="dep_parse", lang="ko") >>> dp("분위기도 좋고 음식도 맛있었어요. 한 시간 기다렸어요.") [(1, '분위기도', 2, 'NP_SBJ'), (2, '좋고', 4, 'VP'), (3, '음식도', 4, 'NP_SBJ'), (4, '맛있었어요.', 7, 'VP'), (5, '한', 6, 'DP'), (6, '시간', 7, 'NP_OBJ'), (7, '기다렸어요.', -1, 'VP')] >>> dp("한시간 기다렸어요.") [(1, '한시간', 2, 'NP_OBJ'), (2, '기다렸어요.', -1, 'VP')]