Skip to content
Permalink
Browse files

Fix sklearn joblib deprecation warning

  • Loading branch information
TimRepke committed Aug 20, 2019
1 parent 215f3c2 commit e3c606700335f3e0feb702ac0469db0c57861946
Showing with 11 additions and 9 deletions.
  1. +2 −2 pke/supervised/api.py
  2. +2 −2 pke/supervised/feature_based/kea.py
  3. +2 −2 pke/supervised/feature_based/wingnus.py
  4. +2 −1 requirements.txt
  5. +3 −2 setup.py
@@ -10,7 +10,7 @@

from pke.base import LoadFile
from sklearn.preprocessing import MinMaxScaler
from sklearn.externals import joblib
from joblib import load as load_model


class SupervisedLoadFile(LoadFile):
@@ -58,7 +58,7 @@ def classify_candidates(self, model=None):
instance + "-semeval2010.py3.pickle")

# load the model
clf = joblib.load(model)
clf = load_model(model)
# with open(model, 'rb') as f:
# clf = pickle.load(f)

@@ -23,7 +23,7 @@
import logging

import numpy as np
from sklearn.externals import joblib
from joblib import dump as dump_model
from sklearn.naive_bayes import MultinomialNB

from pke.supervised.api import SupervisedLoadFile
@@ -170,4 +170,4 @@ def train(training_instances, training_classes, model_file):

clf = MultinomialNB()
clf.fit(training_instances, training_classes)
joblib.dump(clf, model_file)
dump_model(clf, model_file)
@@ -20,7 +20,7 @@
import logging

import numpy as np
from sklearn.externals import joblib
from joblib import dump as dump_model
from sklearn.naive_bayes import MultinomialNB

from pke.supervised.api import SupervisedLoadFile
@@ -253,6 +253,6 @@ def train(training_instances, training_classes, model_file):

clf = MultinomialNB()
clf.fit(training_instances, training_classes)
joblib.dump(clf, model_file)
dump_model(clf, model_file)
# with open(model_file, 'wb') as f:
# pickle.dump(clf, f)
@@ -6,4 +6,5 @@ numpy
scipy
sklearn
unidecode
future
future
joblib
@@ -1,7 +1,7 @@
from distutils.core import setup

setup(name='pke',
version='1.8',
version='1.8.1',
description='Python Keyphrase Extraction module',
author='pke contributors',
author_email='florian.boudin@univ-nantes.fr',
@@ -19,7 +19,8 @@
'six',
'sklearn',
'unidecode',
'future'
'future',
'joblib'
],
package_data={'pke': ['models/*.pickle', 'models/*.gz']}
)

0 comments on commit e3c6067

Please sign in to comment.
You can’t perform that action at this time.