compling
Advanced tools
| Metadata-Version: 2.1 | ||
| Name: compling | ||
| Version: 0.0.34 | ||
| Version: 0.0.35 | ||
| Summary: Computational Linguistic | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/FrancescoPeriti/compling |
@@ -19,2 +19,3 @@ import pkg_resources | ||
| def cat(self) -> None: | ||
@@ -21,0 +22,0 @@ """Shows set-up parameters.""" |
@@ -19,3 +19,3 @@ import abc | ||
| def __init__(self, index: Iterable[dict], module: gensim.models, output:str=None, text_field='text', | ||
| skipgram_ws: int = None, tag=False, id_field:Union[str, List[str]]=None) -> None: | ||
| skipgram_ws: int = None, tag=False, id_field:Union[str, List[str]]=None, processing:Callable=None) -> None: | ||
| """ | ||
@@ -60,8 +60,12 @@ **\_\_init\_\_**: Creates a new Embeddings instance. | ||
| def process(text): | ||
| if processing is None: return text | ||
| return processing(text) | ||
| if tag: | ||
| self.data = [gensim.models.doc2vec.TaggedDocument(words=record[text_field].split(), | ||
| self.data = [gensim.models.doc2vec.TaggedDocument(words=process(record[text_field]).split(), | ||
| tags=[str(record[self.id_field])]) | ||
| if not skipgram_ws else | ||
| gensim.models.doc2vec.TaggedDocument( | ||
| words=self.self.nlp.split_skipgram(record[text_field], ws=skipgram_ws), | ||
| words=self.self.nlp.split_skipgram(process(record[text_field]), ws=skipgram_ws), | ||
| tags=[str(record[self.id_field])]) | ||
@@ -71,4 +75,4 @@ for record in index] | ||
| else: | ||
| self.data = [record[text_field].split() if not skipgram_ws else | ||
| self.nlp.split_skipgram(record[text_field], ws=skipgram_ws) | ||
| self.data = [process(record[text_field]).split() if not skipgram_ws else | ||
| self.nlp.split_skipgram(process(record[text_field]), ws=skipgram_ws) | ||
| for record in index] | ||
@@ -75,0 +79,0 @@ |
+1
-1
| Metadata-Version: 2.1 | ||
| Name: compling | ||
| Version: 0.0.34 | ||
| Version: 0.0.35 | ||
| Summary: Computational Linguistic | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/FrancescoPeriti/compling |
+1
-1
@@ -44,3 +44,3 @@ import subprocess | ||
| name="compling", | ||
| version="0.0.34", | ||
| version="0.0.35", | ||
| author="Francesco Periti", | ||
@@ -47,0 +47,0 @@ author_email="peritifrancesco@gmail.com", |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
19869374
04016
0.07%