Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dialectid/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

__version__ = '0.1.7'
__version__ = '0.2.0'

# from dialectid.text_repr import BoW, SeqTM
from dialectid.model import DialectId, BoW
4 changes: 2 additions & 2 deletions dialectid/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ def download(self, first: bool=True):
@dataclass
class DialectId(EncExpT):
"""DialectId"""
token_max_filter: int=int(2**19)
token_max_filter: int=2**19
del_diac: bool=True
with_intercept: bool=True
probability: bool=False
uniform_distribution: bool=True
max_pos: int=False
max_pos: int=2**19

def identifier_filter(self, key, value):
"""Test default parameters"""
Expand Down
10 changes: 5 additions & 5 deletions dialectid/tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def test_DialectId_predict_2cl():

def test_DialectId_download():
"""Test DialectId download"""
dialectid = DialectId(lang='es', token_max_filter=2**17)
dialectid = DialectId(lang='es')
dialectid.weights
assert len(dialectid.names) == 21

Expand All @@ -92,8 +92,8 @@ def test_DialectId_probability():
_ = enc._lr.predict_proba(X)
assert_almost_equal(_, hy)
enc2 = DialectId(lang='es',
pretrained=False,
probability=True)
pretrained=False,
probability=True)
enc2.set_weights(tweet_iterator('tailored_intercept2.json.gz'))
assert_almost_equal(enc._lr[1].coef_.T, enc2.proba_coefs[0])
assert_almost_equal(enc._lr[1].intercept_, enc2.proba_coefs[1])
Expand Down Expand Up @@ -121,8 +121,8 @@ def test_DialectId_probability_2cl():
assert_almost_equal(_, hy)
assert_almost_equal(hy[0].sum(), 1)
enc2 = DialectId(lang='es',
pretrained=False,
probability=True)
pretrained=False,
probability=True)
enc2.set_weights(tweet_iterator('tailored_intercept2.json.gz'))
assert_almost_equal(enc._lr[1].coef_[0], enc2.proba_coefs[0])
assert_almost_equal(enc._lr[1].intercept_, enc2.proba_coefs[1])
Expand Down
Loading