Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
diagrammi_po_VKR
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Веремчук Илья Олегович
diagrammi_po_VKR
Commits
4ba3b785
Commit
4ba3b785
authored
Apr 21, 2025
by
Веремчук Илья Олегович
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
7a237235
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
Class.py
Class.py
+34
-0
No files found.
Class.py
0 → 100644
View file @
4ba3b785
class
DataProcessor
:
def
__init__
(
self
,
model
,
storage
):
self
.
model
=
model
self
.
storage
=
storage
def
process
(
self
,
data
):
processed_text
=
self
.
_preprocess
(
data
)
tokens
=
self
.
model
.
tokenize
(
processed_text
)
category
=
self
.
model
.
classify
(
processed_text
)
entities
=
self
.
model
.
extract_entities
(
processed_text
)
result
=
{
"tokens"
:
tokens
,
"category"
:
category
,
"entities"
:
entities
}
self
.
storage
.
save
(
result
)
return
result
def
_preprocess
(
self
,
text
):
return
text
.
strip
()
.
lower
()
class
NLPModel
:
def
tokenize
(
self
,
text
):
return
text
.
split
()
def
classify
(
self
,
text
):
return
"UNKNOWN"
def
extract_entities
(
self
,
text
):
return
[]
class
DataStorage
:
def
save
(
self
,
data
):
print
(
f
"Сохранено: {data}"
)
return
True
def
load
(
self
):
return
{}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment