Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

시간복잡도 문제 #116

Open
eubinecto opened this issue Sep 22, 2024 · 1 comment
Open

시간복잡도 문제 #116

eubinecto opened this issue Sep 22, 2024 · 1 comment
Assignees

Comments

@eubinecto
Copy link
Owner

eubinecto commented Sep 22, 2024

politely/politely/styler.py

Lines 149 to 159 in eb1df8e

candidates = itertools.product(
*[
pair2honorifics.get(
pair,
{
pair,
},
)
for pair in self.out.split(SEP) # SEP
]
)

여기서 Cartesian product를 계산하면 문장이 길어짐에 따라 시간이 기하급수적으로 늘어난다.
이 효율성을 해결해야한다.
비테르비 알고리즘을 쓴다던지.... 해야하지 않을까.

@eubinecto
Copy link
Owner Author

eubinecto commented Sep 23, 2024

비테르비 알고리즘
image

마르코프 체인에서 가장 최적의 경로를 효율적으로 찾는데 쓰인다.
딱 내가 처한 상황이다.

그런데 이 알고리즘을 써먹기 위해선 형태소의 나열의 확률을 동적으로 계산할 수 있어야 한다.
#117 이 문제가 우선 해결되어야 가능할 것이다.

@eubinecto eubinecto self-assigned this Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant