-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from milobella/fixes/various_around_init
Various fixes around initialization and verify PLAY_MOVIE feasability
- Loading branch information
Showing
9 changed files
with
792 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
cerebro: | ||
|
||
features: | ||
use_mongo: false | ||
use_spacy: true | ||
|
||
spacy: | ||
model: fr_core_news_md | ||
iterations: 70 | ||
iterations: 80 | ||
min_score: 0.1 | ||
chunk_size: 1000 | ||
|
||
features: | ||
use_mongo: false | ||
use_spacy: true | ||
mongodb: | ||
url: "mongodb://root:example@mongo:27017/?authSource=admin" | ||
database: cerebro |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from typing import List, Dict | ||
|
||
from cerebro.repository.nlp_repository import Repository | ||
|
||
|
||
class NLPRepositoryMemory(Repository): | ||
def __init__(self): | ||
self._samples = {} | ||
self._categories = {} | ||
self._entities = {} | ||
|
||
def get_samples(self, model_id: str, start: int, limit: int) -> List[Dict]: | ||
return self._samples[model_id][start: start + limit] | ||
|
||
def get_categories(self, model_id: str) -> List[str]: | ||
return self._categories[model_id] | ||
|
||
def get_entities(self, model_id: str) -> List[str]: | ||
return self._entities[model_id] | ||
|
||
def update(self, model_id: str, samples: List[Dict]): | ||
categories = set([]) | ||
[categories.update(sample["categories"]) for sample in samples] | ||
self._categories[model_id] = categories | ||
|
||
entities = set([]) | ||
[entities.update([ent["name"] for ent in sample["entities"]]) for sample in samples if "entities" in sample] | ||
self._entities[model_id] = entities | ||
self._samples[model_id] = samples | ||
|
||
def clear(self, model_id: str): | ||
del self._categories[model_id] | ||
del self._entities[model_id] | ||
del self._samples[model_id] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
curl -iv 'http://localhost:9444/models/default/train' |
Oops, something went wrong.