-
Notifications
You must be signed in to change notification settings - Fork 265
Expand file tree
/
Copy pathpyproject.toml
More file actions
250 lines (229 loc) · 5.02 KB
/
pyproject.toml
File metadata and controls
250 lines (229 loc) · 5.02 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
[build-system]
requires = ["setuptools>=61.0.0"]
build-backend = "setuptools.build_meta"
[tool.setuptools.packages.find]
include = ["gliner", "gliner.*"]
[tool.setuptools.dynamic]
version = {attr = "gliner.__version__"}
[project]
name = "gliner"
description = "Generalist model for NER (Extract any entity types from texts)"
readme = "README.md"
requires-python = ">=3.8"
license = {text = "Apache-2.0"}
keywords = [
"named-entity-recognition",
"ner",
"data-science",
"natural-language-processing",
"artificial-intelligence",
"nlp",
"machine-learning",
"transformers"
]
authors = [
{name = "Urchade Zaratiana"},
{name = "Nadi Tomeh"},
{name = "Pierre Holat"},
{name = "Thierry Charnois"},
]
maintainers = [
{name = "Urchade Zaratiana"},
]
dependencies = [
"torch>=2.0.0",
"transformers>=4.51.3,<5.2.0",
"huggingface_hub>=0.21.4",
"tqdm",
"onnxruntime",
"sentencepiece",
]
dynamic = ["version"]
[project.optional-dependencies]
gpu = ["onnxruntime-gpu"]
tokenizers = [
"langdetect",
"python-mecab-ko",
"janome",
"jieba3",
"camel_tools",
"indic-nlp-library",
"spacy",
"stanza"
]
training = ["accelerate"]
stanza = [
"stanza",
"langdetect"
]
[dependency-groups]
# version pins are in uv.lock
dev = [
"pytest",
"pytest-asyncio",
"ruff"
]
[tool.ruff]
line-length = 120
indent-width = 4
output-format = "grouped"
target-version = "py39"
# Exclude common directories
exclude = [
".git",
".ruff_cache",
".venv",
"__pycache__",
"build",
"dist",
"*.egg-info",
]
[tool.ruff.format]
docstring-code-format = true
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.ruff.lint]
select = [
# Pyflakes
"F",
# pycodestyle
"E",
"W",
# isort
"I",
# pydocstyle
"D",
# pyupgrade
"UP",
# bugbear
"B",
# simplify
"SIM",
# future annotations
"FA",
# unused arguments
"ARG",
# print statements
"T20",
# type checking
"TC",
# import rules
"TID",
# comprehensions
"C4",
# errmsg
"EM",
# logging
"G",
# Pylint
"PL",
# Ruff-specific rules
"RUF"
]
ignore = [
# Missing docstring in public module
"D100",
# Missing docstring in public class
"D101",
# Missing docstring in public method
"D102",
# Missing docstring in public function
"D103",
# Missing docstring in public package
"D104",
# Missing docstring in magic method
"D105",
# Missing docstring in `__init__`
"D107",
# One-line docstring should fit on one line
"D200",
# Multi-line docstring summary should start at the first line
"D212",
# First line should end with a period
"D400",
# First line should be in imperative mood
"D401",
# Mutable class attributes should be annotated with `typing.ClassVar`
"RUF012",
# Too many arguments
"PLR0913",
# Too many branches
"PLR0912",
# Too many statements
"PLR0915",
# Magic value used in comparison
"PLR2004",
# Mutable defaults
"B006",
# Use of `assert` detected
"S101",
# Use `contextlib.suppress()` instead of try-except-pass
"SIM105",
# Use ternary operator instead of if-else-block
"SIM108",
# Deprecated typing imports
"UP035",
"UP006",
# Exceptions message formating
"EM101",
"EM102",
# Prefer absolute imports
"TID252",
# Unused method arguments
"ARG002",
# Ambiguos symbols in docstring, we may ned them for scientific notations
"RUF002"
]
unfixable = [
# Disable auto fix for unused imports (safer to review manually)
"F401",
# Disable auto fix for print statements
"T201",
"T203",
# Disable auto fix for unused variables
"F841",
]
# Allow unused variables when underscore-prefixed
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
extend-safe-fixes = [
"FA102", # future annotations
"UP", # pyupgrade fixes
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = [
"F401", # Unused imports in __init__.py are often intentional
"F403", # Star imports in __init__.py
]
"tests/**/*.py" = [
"D", # No docstring requirements in tests
"ARG", # Unused arguments are common in test fixtures
"PLR2004", # Magic values are fine in tests
"S101", # Assert is expected in tests
]
[tool.ruff.lint.isort]
length-sort = true
length-sort-straight = true
combine-as-imports = true
extra-standard-library = ["typing_extensions"]
known-first-party = ["gliner"]
section-order = [
"future",
"standard-library",
"third-party",
"first-party",
"local-folder",
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.pylint]
max-args = 20
max-branches = 15
max-returns = 8
max-statements = 60
[tool.ruff.lint.pyupgrade]
# Preserve types, even if a file imports `from __future__ import annotations`
keep-runtime-typing = true
[project.urls]
Homepage = "https://github.com/urchade/GLiNER"