Skip to content

Extend tokens function with additional tokenizers - #79001

Merged
rschu1ze merged 17 commits into
masterfrom
ahmadov/tokenizer-cn
May 13, 2025
Merged

rschu1ze merged 17 commits into
masterfrom
ahmadov/tokenizer-cn

Conversation

@ahmadov

@ahmadov ahmadov commented Apr 10, 2025 •

Copy link
Copy Markdown
Member

Extend the existing tokens function with multiple tokenizers support. The supported tokenizers are default, noop, ngram. Deprecated the existing ngrams function in favor of tokens function with the ngram tokenizer.

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

The tokens function was extended to accept an additional "tokenizer" argument plus further tokenizer-specific arguments.

@clickhouse-gh

clickhouse-gh Bot commented Apr 10, 2025 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [3c49d37]

@ahmadov
ahmadov force-pushed the ahmadov/tokenizer-cn branch from 1c010d7 to 8ced483 Compare April 10, 2025 18:27
@clickhouse-gh clickhouse-gh Bot added pr-experimental Experimental Feature submodule changed At least one submodule changed in this PR. labels Apr 10, 2025
@ahmadov
ahmadov force-pushed the ahmadov/tokenizer-cn branch 2 times, most recently from 5ec54d8 to 6d6a056 Compare April 16, 2025 15:20
@ahmadov
ahmadov marked this pull request as ready for review April 16, 2025 15:20
@ahmadov
ahmadov requested a review from rschu1ze April 16, 2025 15:21
@ahmadov
ahmadov force-pushed the ahmadov/tokenizer-cn branch 3 times, most recently from 95bec71 to f66cfd6 Compare April 16, 2025 19:17
@ahmadov
ahmadov force-pushed the ahmadov/tokenizer-cn branch from f66cfd6 to cf5310a Compare April 22, 2025 08:44
Comment thread ci/jobs/fast_test.py Resolved
Comment thread contrib/cppjieba-cmake/CMakeLists.txt Resolved
Comment thread src/Common/Tokenizer/ChineseTokenizer.h Resolved
Comment thread src/Functions/tokenizeChinese.cpp Resolved
Comment thread src/Functions/tokenizeChinese.cpp Resolved
@rschu1ze rschu1ze changed the title Add ChineseTokenizer and tokenizeChinese function Add Chinese tokenizer and tokenizeChinese function May 5, 2025
@rschu1ze rschu1ze self-assigned this May 5, 2025
@ahmadov
ahmadov force-pushed the ahmadov/tokenizer-cn branch from 6a842f8 to d27ec6c Compare May 7, 2025 11:04
@ahmadov ahmadov changed the title Add Chinese tokenizer and tokenizeChinese function Add generic tokenize function May 7, 2025
@ahmadov
ahmadov force-pushed the ahmadov/tokenizer-cn branch 2 times, most recently from 6d6f27c to 93d15fc Compare May 7, 2025 12:13
@ahmadov
ahmadov force-pushed the ahmadov/tokenizer-cn branch 3 times, most recently from 88645f7 to ce933a9 Compare May 9, 2025 18:17
@ahmadov ahmadov changed the title Add generic tokenize function Extend tokens function with additional tokenizers May 9, 2025
@ahmadov
ahmadov force-pushed the ahmadov/tokenizer-cn branch from ce933a9 to 7d0b70b Compare May 9, 2025 18:49
- avoid duplication for validating arguments
- Make `tokenizer` a drop-in replacement of `tokens`
- Add examples into documentation
- Split functions into different C++ files for better maintaining
- Deprecate `ngrams` function and document it
Comment thread src/Interpreters/ChineseTokenizer.cpp Resolved
Comment thread src/Interpreters/ChineseTokenizer.h Resolved
Comment thread src/Interpreters/ITokenExtractor.cpp Resolved
Comment thread src/Interpreters/ITokenExtractor.cpp Resolved
Comment thread src/Interpreters/ITokenExtractor.cpp Resolved
Comment thread src/Interpreters/ITokenExtractor.h Resolved
Comment thread src/Interpreters/ITokenExtractor.h Resolved
@rschu1ze

This comment was marked as resolved.

@rschu1ze

Copy link
Copy Markdown
Member

Stateless tests (msan, 3/4):

AST fuzzer (amd_debug):

@rschu1ze
rschu1ze added this pull request to the merge queue May 13, 2025
Merged via the queue into master with commit 9cd5936 May 13, 2025
@rschu1ze
rschu1ze deleted the ahmadov/tokenizer-cn branch May 13, 2025 17:07
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label May 13, 2025
@rschu1ze rschu1ze removed submodule changed At least one submodule changed in this PR. pr-experimental Experimental Feature labels May 13, 2025
@clickgapai

Copy link
Copy Markdown
Contributor

Hi @ahmadov @rschu1ze — while reviewing this PR I found the following:

Happy to discuss — close anything that's wrong or already addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants