Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
emoUS-public
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
dsml
emoUS-public
Commits
5d818f1d
Commit
5d818f1d
authored
3 years ago
by
zqwerty
Browse files
Options
Downloads
Patches
Plain Diff
rm useless func
parent
8183031a
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
data/unified_datasets/opendialkg/preprocess.py
+0
-25
0 additions, 25 deletions
data/unified_datasets/opendialkg/preprocess.py
with
0 additions
and
25 deletions
data/unified_datasets/opendialkg/preprocess.py
+
0
−
25
View file @
5d818f1d
...
@@ -15,31 +15,6 @@ import csv
...
@@ -15,31 +15,6 @@ import csv
import
random
import
random
def
value_in_utt
(
value
,
utt
):
"""
return character level (start, end) if value in utt
"""
value
=
value
.
strip
(
punctuation
).
lower
()
utt
=
utt
p
=
'
(^|[\s,\.:\?!-])(?P<v>{})([\s,\.:\?!-
\'
]|$)
'
.
format
(
re
.
escape
(
value
))
p
=
re
.
compile
(
p
,
re
.
I
)
m
=
re
.
search
(
p
,
utt
)
if
m
:
# very few value appears more than once, take the first span
return
True
,
m
.
span
(
'
v
'
)
else
:
try
:
# solve date representation, e.g. '3 pm' vs '3pm'
date_parser
.
parse
(
value
)
if
(
value
.
endswith
(
'
pm
'
)
or
value
.
endswith
(
'
am
'
))
and
''
.
join
(
value
.
split
(
'
'
))
in
''
.
join
(
utt
.
split
(
'
'
)):
return
True
,
None
except
:
if
value
in
utt
:
# value appears, but may be in the plural, -ing, -ly, etc.
return
True
,
None
return
False
,
None
def
preprocess
():
def
preprocess
():
random
.
seed
(
42
)
random
.
seed
(
42
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment