Repository: biolab/orange3-text

Issue:
TF-IDF widgets doesn't commit
When I push commit button on TF-IDF widget it returns following error:
`--------------------------------------------------------------------------------
AttributeError                                Traceback (most recent call last):
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/canvas/scheme/widgetsscheme.py", line 724, in process_signals_for_widget
    handler(*args)
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/widgets/utils/owbasevectorizer.py", line 62, in set_data
    self.commit()
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/widgets/gui.py", line 2198, in unconditional_commit
    do_commit()
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/widgets/gui.py", line 2206, in do_commit
    commit()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/widgets/utils/owbasevectorizer.py", line 65, in commit
    self.apply()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/widgets/utils/owbasevectorizer.py", line 69, in apply
    new_corpus = self.method.transform(self.corpus)
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/vectorization/base.py", line 11, in transform
    corpus = corpus.copy()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/corpus.py", line 250, in copy
    c.ensure_copy()
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/data/table.py", line 917, in ensure_copy
    if self.X.base is not None:
  File "/usr/local/lib/python3.4/dist-packages/scipy/sparse/base.py", line 508, in **getattr**
    raise AttributeError(attr + " not found")
## AttributeError: base not found

AttributeError                                Traceback (most recent call last):
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/canvas/scheme/widgetsscheme.py", line 724, in process_signals_for_widget
    handler(*args)
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/widgets/utils/owbasevectorizer.py", line 62, in set_data
    self.commit()
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/widgets/gui.py", line 2198, in unconditional_commit
    do_commit()
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/widgets/gui.py", line 2206, in do_commit
    commit()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/widgets/utils/owbasevectorizer.py", line 65, in commit
    self.apply()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/widgets/utils/owbasevectorizer.py", line 69, in apply
    new_corpus = self.method.transform(self.corpus)
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/vectorization/base.py", line 11, in transform
    corpus = corpus.copy()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/corpus.py", line 250, in copy
    c.ensure_copy()
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/data/table.py", line 917, in ensure_copy
    if self.X.base is not None:
  File "/usr/local/lib/python3.4/dist-packages/scipy/sparse/base.py", line 508, in **getattr**
    raise AttributeError(attr + " not found")
## AttributeError: base not found

AttributeError                                Traceback (most recent call last):
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/canvas/scheme/widgetsscheme.py", line 724, in process_signals_for_widget
    handler(*args)
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/widgets/utils/owbasevectorizer.py", line 62, in set_data
    self.commit()
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/widgets/gui.py", line 2198, in unconditional_commit
    do_commit()
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/widgets/gui.py", line 2206, in do_commit
    commit()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/widgets/utils/owbasevectorizer.py", line 65, in commit
    self.apply()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/widgets/utils/owbasevectorizer.py", line 69, in apply
    new_corpus = self.method.transform(self.corpus)
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/vectorization/base.py", line 11, in transform
    corpus = corpus.copy()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/corpus.py", line 250, in copy
    c.ensure_copy()
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/data/table.py", line 917, in ensure_copy
    if self.X.base is not None:
  File "/usr/local/lib/python3.4/dist-packages/scipy/sparse/base.py", line 508, in **getattr**
    raise AttributeError(attr + " not found")
## AttributeError: base not found

AttributeError                                Traceback (most recent call last):
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/widgets/gui.py", line 2235, in <lambda>
    b.button = btn = button(b, master, label, callback=lambda: do_commit())
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/widgets/gui.py", line 2206, in do_commit
    commit()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/widgets/utils/owbasevectorizer.py", line 65, in commit
    self.apply()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/widgets/utils/owbasevectorizer.py", line 69, in apply
    new_corpus = self.method.transform(self.corpus)
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/vectorization/base.py", line 11, in transform
    corpus = corpus.copy()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/corpus.py", line 250, in copy
    c.ensure_copy()
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/data/table.py", line 917, in ensure_copy
    if self.X.base is not None:
  File "/usr/local/lib/python3.4/dist-packages/scipy/sparse/base.py", line 508, in **getattr**
    raise AttributeError(attr + " not found")
## AttributeError: base not found

AttributeError                                Traceback (most recent call last):
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/widgets/gui.py", line 2235, in <lambda>
    b.button = btn = button(b, master, label, callback=lambda: do_commit())
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/widgets/gui.py", line 2206, in do_commit
    commit()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/widgets/utils/owbasevectorizer.py", line 65, in commit
    self.apply()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/widgets/utils/owbasevectorizer.py", line 69, in apply
    new_corpus = self.method.transform(self.corpus)
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/vectorization/base.py", line 11, in transform
    corpus = corpus.copy()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/corpus.py", line 250, in copy
    c.ensure_copy()
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/data/table.py", line 917, in ensure_copy
    if self.X.base is not None:
  File "/usr/local/lib/python3.4/dist-packages/scipy/sparse/base.py", line 508, in **getattr**
    raise AttributeError(attr + " not found")
## AttributeError: base not found

AttributeError                                Traceback (most recent call last):
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/widgets/gui.py", line 2235, in <lambda>
    b.button = btn = button(b, master, label, callback=lambda: do_commit())
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/widgets/gui.py", line 2206, in do_commit
    commit()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/widgets/utils/owbasevectorizer.py", line 65, in commit
    self.apply()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/widgets/utils/owbasevectorizer.py", line 69, in apply
    new_corpus = self.method.transform(self.corpus)
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/vectorization/base.py", line 11, in transform
    corpus = corpus.copy()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/corpus.py", line 250, in copy
    c.ensure_copy()
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/data/table.py", line 917, in ensure_copy
    if self.X.base is not None:
  File "/usr/local/lib/python3.4/dist-packages/scipy/sparse/base.py", line 508, in **getattr**
    raise AttributeError(attr + " not found")
AttributeError: base not found
`

TF-IDF widgets doesn't commit
When I push commit button on TF-IDF widget it returns following error:
`--------------------------------------------------------------------------------
AttributeError                                Traceback (most recent call last):
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/canvas/scheme/widgetsscheme.py", line 724, in process_signals_for_widget
    handler(*args)
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/widgets/utils/owbasevectorizer.py", line 62, in set_data
    self.commit()
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/widgets/gui.py", line 2198, in unconditional_commit
    do_commit()
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/widgets/gui.py", line 2206, in do_commit
    commit()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/widgets/utils/owbasevectorizer.py", line 65, in commit
    self.apply()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/widgets/utils/owbasevectorizer.py", line 69, in apply
    new_corpus = self.method.transform(self.corpus)
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/vectorization/base.py", line 11, in transform
    corpus = corpus.copy()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/corpus.py", line 250, in copy
    c.ensure_copy()
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/data/table.py", line 917, in ensure_copy
    if self.X.base is not None:
  File "/usr/local/lib/python3.4/dist-packages/scipy/sparse/base.py", line 508, in **getattr**
    raise AttributeError(attr + " not found")
## AttributeError: base not found

AttributeError                                Traceback (most recent call last):
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/canvas/scheme/widgetsscheme.py", line 724, in process_signals_for_widget
    handler(*args)
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/widgets/utils/owbasevectorizer.py", line 62, in set_data
    self.commit()
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/widgets/gui.py", line 2198, in unconditional_commit
    do_commit()
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/widgets/gui.py", line 2206, in do_commit
    commit()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/widgets/utils/owbasevectorizer.py", line 65, in commit
    self.apply()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/widgets/utils/owbasevectorizer.py", line 69, in apply
    new_corpus = self.method.transform(self.corpus)
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/vectorization/base.py", line 11, in transform
    corpus = corpus.copy()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/corpus.py", line 250, in copy
    c.ensure_copy()
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/data/table.py", line 917, in ensure_copy
    if self.X.base is not None:
  File "/usr/local/lib/python3.4/dist-packages/scipy/sparse/base.py", line 508, in **getattr**
    raise AttributeError(attr + " not found")
## AttributeError: base not found

AttributeError                                Traceback (most recent call last):
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/canvas/scheme/widgetsscheme.py", line 724, in process_signals_for_widget
    handler(*args)
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/widgets/utils/owbasevectorizer.py", line 62, in set_data
    self.commit()
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/widgets/gui.py", line 2198, in unconditional_commit
    do_commit()
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/widgets/gui.py", line 2206, in do_commit
    commit()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/widgets/utils/owbasevectorizer.py", line 65, in commit
    self.apply()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/widgets/utils/owbasevectorizer.py", line 69, in apply
    new_corpus = self.method.transform(self.corpus)
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/vectorization/base.py", line 11, in transform
    corpus = corpus.copy()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/corpus.py", line 250, in copy
    c.ensure_copy()
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/data/table.py", line 917, in ensure_copy
    if self.X.base is not None:
  File "/usr/local/lib/python3.4/dist-packages/scipy/sparse/base.py", line 508, in **getattr**
    raise AttributeError(attr + " not found")
## AttributeError: base not found

AttributeError                                Traceback (most recent call last):
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/widgets/gui.py", line 2235, in <lambda>
    b.button = btn = button(b, master, label, callback=lambda: do_commit())
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/widgets/gui.py", line 2206, in do_commit
    commit()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/widgets/utils/owbasevectorizer.py", line 65, in commit
    self.apply()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/widgets/utils/owbasevectorizer.py", line 69, in apply
    new_corpus = self.method.transform(self.corpus)
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/vectorization/base.py", line 11, in transform
    corpus = corpus.copy()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/corpus.py", line 250, in copy
    c.ensure_copy()
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/data/table.py", line 917, in ensure_copy
    if self.X.base is not None:
  File "/usr/local/lib/python3.4/dist-packages/scipy/sparse/base.py", line 508, in **getattr**
    raise AttributeError(attr + " not found")
## AttributeError: base not found

AttributeError                                Traceback (most recent call last):
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/widgets/gui.py", line 2235, in <lambda>
    b.button = btn = button(b, master, label, callback=lambda: do_commit())
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/widgets/gui.py", line 2206, in do_commit
    commit()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/widgets/utils/owbasevectorizer.py", line 65, in commit
    self.apply()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/widgets/utils/owbasevectorizer.py", line 69, in apply
    new_corpus = self.method.transform(self.corpus)
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/vectorization/base.py", line 11, in transform
    corpus = corpus.copy()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/corpus.py", line 250, in copy
    c.ensure_copy()
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/data/table.py", line 917, in ensure_copy
    if self.X.base is not None:
  File "/usr/local/lib/python3.4/dist-packages/scipy/sparse/base.py", line 508, in **getattr**
    raise AttributeError(attr + " not found")
## AttributeError: base not found

AttributeError                                Traceback (most recent call last):
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/widgets/gui.py", line 2235, in <lambda>
    b.button = btn = button(b, master, label, callback=lambda: do_commit())
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/widgets/gui.py", line 2206, in do_commit
    commit()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/widgets/utils/owbasevectorizer.py", line 65, in commit
    self.apply()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/widgets/utils/owbasevectorizer.py", line 69, in apply
    new_corpus = self.method.transform(self.corpus)
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/vectorization/base.py", line 11, in transform
    corpus = corpus.copy()
  File "/home/fazel/dev/venv/pyenv/orange/orange3env/lib/python3.4/site-packages/Orange3_Text-0.1.11-py3.4.egg/orangecontrib/text/corpus.py", line 250, in copy
    c.ensure_copy()
  File "/home/fazel/dev/venv/pyenv/orange/orange3/Orange/data/table.py", line 917, in ensure_copy
    if self.X.base is not None:
  File "/usr/local/lib/python3.4/dist-packages/scipy/sparse/base.py", line 508, in **getattr**
    raise AttributeError(attr + " not found")
AttributeError: base not found
`



Discussion:
It seems that the problem is `Table.copy` (hence `Corpus.copy`) doesn't support sparse `X`. We probably should reimplement this method here. 

The only way I could reproduce this was to chain two TF-IDF widgets one after an other or inside scripts. @Fazel94 if that's the case then, until this is fixed, I recommend not to chain vectorization widgets. If not, what was your schema?

As far as I understand this only happens when the input to TF-IDF is in sparse matrix. And input only gets sparse after it is passed through one of the vectorization widgets since initially it is set to an empty numpy array. Since all vectorization widgets extend BaseVectorizer I assue this targets all of them.

> We probably should reimplement this method here.

Or we should fix this in Orange since it supports sparse matrices. I can take a look.

I was chaining bag of words and TF-IDF together. It is good when I use just one of them.

It seems that the problem is `Table.copy` (hence `Corpus.copy`) doesn't support sparse `X`. We probably should reimplement this method here. 

The only way I could reproduce this was to chain two TF-IDF widgets one after an other or inside scripts. @Fazel94 if that's the case then, until this is fixed, I recommend not to chain vectorization widgets. If not, what was your schema?

As far as I understand this only happens when the input to TF-IDF is in sparse matrix. And input only gets sparse after it is passed through one of the vectorization widgets since initially it is set to an empty numpy array. Since all vectorization widgets extend BaseVectorizer I assue this targets all of them.

> We probably should reimplement this method here.

Or we should fix this in Orange since it supports sparse matrices. I can take a look.

I was chaining bag of words and TF-IDF together. It is good when I use just one of them.


Resolving patch:
diff --git a/orangecontrib/text/corpus.py b/orangecontrib/text/corpus.py
--- a/orangecontrib/text/corpus.py
+++ b/orangecontrib/text/corpus.py
@@ -1,4 +1,5 @@
 import os
+from copy import copy
 from numbers import Integral
 from itertools import chain
 
@@ -246,8 +247,9 @@ def ngrams(self):
 
     def copy(self):
         """Return a copy of the table."""
-        c = self.__class__(self.X, self.Y, self.metas, self.domain, self.text_features)
-        c.ensure_copy()
+        c = self.__class__(self.X.copy(), self.Y.copy(), self.metas.copy(),
+                           self.domain, copy(self.text_features))
+        # since tokens and dictionary are considered immutable copies are not needed
         c._tokens = self._tokens
         c._dictionary = self._dictionary
         c.ngram_range = self.ngram_range


Test patch: