Changed environment variable behavior to accept comma separated models rather than a JSON encoded value
This commit is contained in:
parent
f681267999
commit
caa5f66389
3 changed files with 10 additions and 2 deletions
|
@ -10,6 +10,6 @@ services:
|
|||
tty: true
|
||||
environment:
|
||||
- KEYBERT_PORT=2131
|
||||
- KEYBERT_PRELOAD=["paraphrase-multilingual-MiniLM-L12-v2"]
|
||||
- KEYBERT_PRELOAD=paraphrase-multilingual-MiniLM-L12-v2
|
||||
ports:
|
||||
- "2131:2131"
|
|
@ -30,6 +30,14 @@
|
|||
else
|
||||
{
|
||||
$preload = getenv('KEYBERT_PRELOAD');
|
||||
if($preload === false || $preload == '')
|
||||
{
|
||||
$preload = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
$preload = explode(',', $preload);
|
||||
}
|
||||
}
|
||||
|
||||
$keybert = new Keybert($preload, null, $port);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
require 'ncc';
|
||||
import('net.nosial.keybert');
|
||||
|
||||
$keybert = new \Keybert\Keybert(null, '127.0.0.1', 1241);
|
||||
$keybert = new \Keybert\Keybert(null, '127.0.0.1', 2131);
|
||||
|
||||
$document = 'The history of natural language processing (NLP) generally started in the 1950s, although work can be found from earlier periods. In 1950, Alan Turing published an article titled "Computing Machinery and Intelligence" which proposed what is now called the Turing test as a criterion of intelligence.';
|
||||
$keywords = $keybert->extractKeywords('paraphrase-multilingual-MiniLM-L12-v2', $document);
|
||||
|
|
Loading…
Add table
Reference in a new issue