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
c51ea88e
Unverified
Commit
c51ea88e
authored
4 years ago
by
zhuqi
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fixed spacy load en_core_web_sm when using BERTNLU for MultiWOZ (#205)
parent
2a4cdb26
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
convlab2/nlu/jointBERT/multiwoz/nlu.py
+8
-0
8 additions, 0 deletions
convlab2/nlu/jointBERT/multiwoz/nlu.py
with
8 additions
and
0 deletions
convlab2/nlu/jointBERT/multiwoz/nlu.py
+
8
−
0
View file @
c51ea88e
...
...
@@ -58,6 +58,14 @@ class BERTNLU(NLU):
self
.
use_context
=
config
[
'
model
'
][
'
context
'
]
self
.
dataloader
=
dataloader
self
.
nlp
=
spacy
.
load
(
'
en_core_web_sm
'
)
try
:
self
.
nlp
=
spacy
.
load
(
"
en_core_web_sm
"
)
except
Exception
:
print
(
'
download en_core_web_sm for spacy
'
)
from
spacy.cli.download
import
download
as
spacy_download
spacy_download
(
"
en_core_web_sm
"
)
spacy_model_module
=
__import__
(
"
en_core_web_sm
"
)
self
.
nlp
=
spacy_model_module
.
load
()
with
open
(
os
.
path
.
join
(
get_root_path
(),
'
data/multiwoz/db/postcode.json
'
),
'
r
'
)
as
f
:
token_list
=
json
.
load
(
f
)
...
...
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