Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nltk
Overview
Overview
Details
Activity
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
nltk
Commits
8b3669e0
Commit
8b3669e0
authored
Feb 16, 2015
by
Steven Bird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conditional import of optional libraries, so that nltk can still be installed without them
parent
dac4274b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
nltk/parse/transitionparser.py
+8
-4
No files found.
nltk/parse/transitionparser.py
View file @
8b3669e0
...
...
@@ -12,10 +12,13 @@ import pickle
from
os
import
remove
from
copy
import
deepcopy
from
operator
import
itemgetter
from
scipy
import
sparse
from
numpy
import
array
from
sklearn.datasets
import
load_svmlight_file
from
sklearn
import
svm
try
:
from
scipy
import
sparse
from
numpy
import
array
from
sklearn.datasets
import
load_svmlight_file
from
sklearn
import
svm
except
ImportError
:
pass
from
nltk.parse
import
ParserI
,
DependencyGraph
,
DependencyEvaluator
...
...
@@ -762,6 +765,7 @@ def demo():
Note that result is very poor because of only one training example.
"""
if
__name__
==
'__main__'
:
import
doctest
doctest
.
testmod
(
optionflags
=
doctest
.
NORMALIZE_WHITESPACE
|
doctest
.
ELLIPSIS
)
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