dalla-data-processing 0.0.10__tar.gz → 0.0.11__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/PKG-INFO +1 -1
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/_version.py +3 -3
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/utils/__init__.py +1 -5
- dalla_data_processing-0.0.11/dalla_data_processing/utils/tokenize.py +80 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing.egg-info/PKG-INFO +1 -1
- dalla_data_processing-0.0.10/dalla_data_processing/utils/tokenize.py +0 -89
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/.dockerignore +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/.github/workflows/ci.yml +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/.github/workflows/release.yml +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/.gitignore +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/.pre-commit-config.yaml +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/LICENSE +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/MANIFEST.in +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/README.md +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/__init__.py +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/cli.py +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/core/README.md +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/core/__init__.py +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/core/dataset.py +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/core/parallel.py +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/README.md +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/__init__.py +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/bin/.gitignore +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/onion/COPYING +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/onion/Makefile +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/onion/Makefile.config +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/onion/README.md +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/onion/src/Makefile +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/onion/src/Makefile.g +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/onion/src/buzhash.c +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/onion/src/buzhash.h +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/onion/src/hashdup.c +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/onion/src/hashgen.c +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/onion/src/onion +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/onion/src/onion.c +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/onion/src/onion_dup.c +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/onion/src/version.c +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/onion/src/version.h +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/onion/src_sc/.gitignore +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/onion/src_sc/Makefile +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/onion/src_sc/Makefile.g +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/onion/src_sc/buzhash.c +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/onion/src_sc/buzhash.h +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/onion/src_sc/hashdup +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/onion/src_sc/hashdup.c +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/onion/src_sc/hashgen +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/onion/src_sc/hashgen.c +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/onion/src_sc/onion.c +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/onion/src_sc/onion_dup.c +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/onion/src_sc/version.c +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/onion/src_sc/version.h +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/onion_wrapper.py +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/postprocessing.py +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/deduplication/preprocessing.py +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/packing/README.md +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/packing/__init__.py +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/packing/dataset_packer.py +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/packing/pack_config.example.yaml +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/quality/README.md +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/quality/__init__.py +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/quality/checker.py +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/readability/README.md +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/readability/__init__.py +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/readability/ranking.py +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/readability/scorer.py +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/stemming/README.md +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/stemming/__init__.py +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/stemming/data/words_al.txt +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/stemming/data/words_al_t.txt +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/stemming/data/words_t.txt +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/stemming/stemmer.py +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/utils/logger.py +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing.egg-info/SOURCES.txt +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing.egg-info/dependency_links.txt +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing.egg-info/entry_points.txt +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing.egg-info/not-zip-safe +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing.egg-info/requires.txt +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing.egg-info/top_level.txt +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/pyproject.toml +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/scripts/build_onion.sh +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/scripts/release.sh +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/setup.cfg +0 -0
- {dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dalla-data-processing
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.11
|
|
4
4
|
Summary: data processing pipeline with deduplication, stemming, quality checking, and readability scoring, used for the DALLA Models
|
|
5
5
|
Author-email: Hadi Hamoud <hhamoud@dohainstitute.edu.qa>, Digital Research Unit - Arab Center <dru@dohainstitute.edu.qa>
|
|
6
6
|
License: CC-BY-NC-SA-4.0
|
{dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/_version.py
RENAMED
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '0.0.
|
|
32
|
-
__version_tuple__ = version_tuple = (0, 0,
|
|
31
|
+
__version__ = version = '0.0.11'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 0, 11)
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'g5e00041e7'
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Utility functions for text processing.
|
|
3
|
-
|
|
4
|
-
This module provides utilities for tokenization, text manipulation, and logging.
|
|
5
|
-
"""
|
|
1
|
+
"""Utility functions for text processing."""
|
|
6
2
|
|
|
7
3
|
from dalla_data_processing.utils.logger import get_logger, logger, setup_logging
|
|
8
4
|
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# MIT License
|
|
2
|
+
#
|
|
3
|
+
# Copyright 2018-2024 New York University Abu Dhabi
|
|
4
|
+
#
|
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
# furnished to do so, subject to the following conditions:
|
|
11
|
+
#
|
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
|
13
|
+
# all copies or substantial portions of the Software.
|
|
14
|
+
#
|
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
# SOFTWARE.
|
|
22
|
+
|
|
23
|
+
"""Word-boundary tokenization utilities."""
|
|
24
|
+
|
|
25
|
+
import re
|
|
26
|
+
|
|
27
|
+
__all__ = ["simple_word_tokenize"]
|
|
28
|
+
|
|
29
|
+
# Compact mode: Arabic + Latin + digits
|
|
30
|
+
_ARABIC = (
|
|
31
|
+
r"\u0621-\u063A"
|
|
32
|
+
r"\u0641-\u064A"
|
|
33
|
+
r"\u064B-\u0652"
|
|
34
|
+
r"\u0653-\u0655"
|
|
35
|
+
r"\u0670"
|
|
36
|
+
r"\u0671-\u06D3"
|
|
37
|
+
r"\u06D5-\u06FF"
|
|
38
|
+
r"\u0750-\u077F"
|
|
39
|
+
r"\u08A0-\u08FF"
|
|
40
|
+
r"\uFB50-\uFDFF"
|
|
41
|
+
r"\uFE70-\uFEFF"
|
|
42
|
+
)
|
|
43
|
+
_LATIN = r"a-zA-Z"
|
|
44
|
+
_DIGITS = r"0-9\u0660-\u0669\u06F0-\u06F9"
|
|
45
|
+
_COMPACT_CHARSET = _ARABIC + _LATIN + _DIGITS
|
|
46
|
+
|
|
47
|
+
# Full mode: Unicode letters/marks/numbers (via \w which covers all Unicode word chars)
|
|
48
|
+
_FULL_CHARSET = r"\w"
|
|
49
|
+
|
|
50
|
+
# Pre-compiled regexes for compact mode
|
|
51
|
+
_COMPACT_RE = re.compile(f"[{_COMPACT_CHARSET}]+|[^{_COMPACT_CHARSET}\\s]|\\s+")
|
|
52
|
+
_COMPACT_SPLIT_RE = re.compile(f"[{_ARABIC}{_LATIN}]+|[{_DIGITS}]+|[^{_COMPACT_CHARSET}\\s]|\\s+")
|
|
53
|
+
|
|
54
|
+
# Pre-compiled regexes for full mode
|
|
55
|
+
_FULL_RE = re.compile(r"\w+|[^\w\s]|\s+")
|
|
56
|
+
_FULL_SPLIT_RE = re.compile(r"[^\W\d]+|\d+|[^\w\s]|\s+")
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def simple_word_tokenize(sentence, split_digits=False, mode="compact"):
|
|
60
|
+
"""Tokenize a sentence by splitting on whitespace and separating punctuation.
|
|
61
|
+
|
|
62
|
+
Args:
|
|
63
|
+
sentence: Sentence to tokenize.
|
|
64
|
+
split_digits: Split digits from letters. Defaults to False.
|
|
65
|
+
mode: "compact" (Arabic + Latin + digits) or "full" (all Unicode).
|
|
66
|
+
Defaults to "compact".
|
|
67
|
+
|
|
68
|
+
Returns:
|
|
69
|
+
List of tokens.
|
|
70
|
+
"""
|
|
71
|
+
if mode == "compact":
|
|
72
|
+
if split_digits:
|
|
73
|
+
return _COMPACT_SPLIT_RE.findall(sentence)
|
|
74
|
+
return _COMPACT_RE.findall(sentence)
|
|
75
|
+
elif mode == "full":
|
|
76
|
+
if split_digits:
|
|
77
|
+
return _FULL_SPLIT_RE.findall(sentence)
|
|
78
|
+
return _FULL_RE.findall(sentence)
|
|
79
|
+
else:
|
|
80
|
+
raise ValueError(f"Unknown mode: {mode}. Use 'compact' or 'full'.")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dalla-data-processing
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.11
|
|
4
4
|
Summary: data processing pipeline with deduplication, stemming, quality checking, and readability scoring, used for the DALLA Models
|
|
5
5
|
Author-email: Hadi Hamoud <hhamoud@dohainstitute.edu.qa>, Digital Research Unit - Arab Center <dru@dohainstitute.edu.qa>
|
|
6
6
|
License: CC-BY-NC-SA-4.0
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
# MIT License
|
|
2
|
-
#
|
|
3
|
-
# Copyright 2018-2024 New York University Abu Dhabi
|
|
4
|
-
#
|
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
# of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
# furnished to do so, subject to the following conditions:
|
|
11
|
-
#
|
|
12
|
-
# The above copyright notice and this permission notice shall be included in
|
|
13
|
-
# all copies or substantial portions of the Software.
|
|
14
|
-
#
|
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
# SOFTWARE.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"""This module contains utilities for word-boundary tokenization."""
|
|
25
|
-
|
|
26
|
-
import re
|
|
27
|
-
|
|
28
|
-
from camel_tools.utils.charsets import (
|
|
29
|
-
EMOJI_MULTICHAR_CHARSET,
|
|
30
|
-
UNICODE_LETTER_CHARSET,
|
|
31
|
-
UNICODE_LETTER_MARK_NUMBER_CHARSET,
|
|
32
|
-
UNICODE_MARK_CHARSET,
|
|
33
|
-
UNICODE_NUMBER_CHARSET,
|
|
34
|
-
UNICODE_PUNCT_SYMBOL_CHARSET,
|
|
35
|
-
)
|
|
36
|
-
|
|
37
|
-
__all__ = ["simple_word_tokenize"]
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
_ALL_PUNCT_SYMBOLS = UNICODE_PUNCT_SYMBOL_CHARSET | EMOJI_MULTICHAR_CHARSET
|
|
41
|
-
_ALL_PUNCT_SYMBOLS = [re.escape(x) for x in _ALL_PUNCT_SYMBOLS]
|
|
42
|
-
_ALL_PUNCT_SYMBOLS = sorted(_ALL_PUNCT_SYMBOLS, key=len, reverse=True)
|
|
43
|
-
_WHITESPACE_RE = r"\s+"
|
|
44
|
-
_ALL_NUMBER = "".join(UNICODE_NUMBER_CHARSET)
|
|
45
|
-
_ALL_LETTER_MARK = "".join(UNICODE_LETTER_CHARSET | UNICODE_MARK_CHARSET)
|
|
46
|
-
_ALL_LETTER_MARK_NUMBER = "".join(UNICODE_LETTER_MARK_NUMBER_CHARSET)
|
|
47
|
-
|
|
48
|
-
_TOKENIZE_RE = re.compile(
|
|
49
|
-
"|".join(_ALL_PUNCT_SYMBOLS)
|
|
50
|
-
+ r"|["
|
|
51
|
-
+ re.escape(_ALL_LETTER_MARK_NUMBER)
|
|
52
|
-
+ r"]+|"
|
|
53
|
-
+ _WHITESPACE_RE
|
|
54
|
-
)
|
|
55
|
-
_TOKENIZE_NUMBER_RE = re.compile(
|
|
56
|
-
"|".join(_ALL_PUNCT_SYMBOLS)
|
|
57
|
-
+ r"|["
|
|
58
|
-
+ re.escape(_ALL_NUMBER)
|
|
59
|
-
+ r"]+|["
|
|
60
|
-
+ re.escape(_ALL_LETTER_MARK)
|
|
61
|
-
+ r"]+"
|
|
62
|
-
)
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
def simple_word_tokenize(sentence, split_digits=False):
|
|
66
|
-
"""Tokenizes a sentence by splitting on whitespace and seperating
|
|
67
|
-
punctuation. The resulting tokens are either alpha-numeric words, single
|
|
68
|
-
punctuation/symbol/emoji characters, or multi-character emoji sequences.
|
|
69
|
-
This function is language agnostic and splits all characters marked as
|
|
70
|
-
punctuation or symbols in the Unicode specification.
|
|
71
|
-
For example, tokenizing :code:`'Hello, world!!!'`
|
|
72
|
-
would yield :code:`['Hello', ',', 'world', '!', '!', '!']`.
|
|
73
|
-
If split_digits is set to True, it also splits on number.
|
|
74
|
-
For example, tokenizing :code:`'Hello, world123!!!'`
|
|
75
|
-
would yield :code:`['Hello', ',', 'world', '123', '!', '!', '!']`.
|
|
76
|
-
|
|
77
|
-
Args:
|
|
78
|
-
sentence (:obj:`str`): Sentence to tokenize.
|
|
79
|
-
split_digits (:obj:`bool`, optional): The flag to split on number.
|
|
80
|
-
Defaults to False.
|
|
81
|
-
|
|
82
|
-
Returns:
|
|
83
|
-
:obj:`list` of :obj:`str`: The list of tokens.
|
|
84
|
-
"""
|
|
85
|
-
|
|
86
|
-
if split_digits:
|
|
87
|
-
return _TOKENIZE_NUMBER_RE.findall(sentence)
|
|
88
|
-
else:
|
|
89
|
-
return _TOKENIZE_RE.findall(sentence)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/core/README.md
RENAMED
|
File without changes
|
{dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/core/__init__.py
RENAMED
|
File without changes
|
{dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/core/dataset.py
RENAMED
|
File without changes
|
{dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/core/parallel.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dalla_data_processing-0.0.10 → dalla_data_processing-0.0.11}/dalla_data_processing/utils/logger.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|