Changeset - 252d3b1bca60
[Not reviewed]
default
0 3 0
Laman - 2 years ago 2022-10-17 19:12:22

models file included in the package
3 files changed with 5 insertions and 2 deletions:
0 comments (0 inline, 0 general)
setup.cfg
Show inline comments
 
@@ -15,6 +15,9 @@ long_description_content_type = text/mar
 
[options]
 
packages =
 
    languedoc
 
package_dir =
 
    =src
 
python_requires = >=3.6
 

	
 
[options.package_data]
 
languedoc = models.json.gz
src/languedoc/predict.py
Show inline comments
 
@@ -2,13 +2,13 @@ import os
 
import re
 
import itertools
 
import json
 
import gzip
 

	
 
TOP_NGRAM_COUNT = 3000
 
MODEL_PATH = os.path.join(os.path.dirname(__file__), "../../models.json.gz")
 
MODEL_PATH = os.path.join(os.path.dirname(__file__), "models.json.gz")
 

	
 

	
 
def preprocess(text):
 
	text = re.sub(r"[\W\d_]+", " ", " "+text+" ")
 
	return text.lower()
 

	
src/languedoc/train.py
Show inline comments
 
@@ -71,13 +71,13 @@ def cross_validate(sample_sets):
 

	
 
	return score / max_score, (score, max_score)
 

	
 

	
 
DATA_DIR = os.path.join(os.path.dirname(__file__), "../../data")
 
LANG_DIRS = sorted([x.path for x in os.scandir(DATA_DIR)])
 
MODEL_PATH = os.path.join(os.path.dirname(__file__), "../../models.json.gz")
 
MODEL_PATH = os.path.join(os.path.dirname(__file__), "models.json.gz")
 

	
 
if __name__ == "__main__":
 
	samples = []
 

	
 
	for d in LANG_DIRS:
 
		lang = os.path.basename(d)
0 comments (0 inline, 0 general)