Initial Commit

This commit is contained in:
Netkas 2023-07-23 16:01:28 -04:00
commit 402c3b5cb6
No known key found for this signature in database
GPG key ID: 5DAF58535614062B
27 changed files with 911 additions and 0 deletions

11
tests/model_test.php Normal file
View file

@ -0,0 +1,11 @@
<?php
require 'ncc';
import('net.nosial.keybert');
$keybert = new \Keybert\Keybert(null, '127.0.0.1', 1241);
$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);
var_dump($keywords);

23
tests/wrapper.http Normal file
View file

@ -0,0 +1,23 @@
###
POST http://0.0.0.0:5000/load_model
Content-Type: application/json
{
"model_name": "paraphrase-multilingual-mpnet-base-v2"
}
###
POST http://0.0.0.0:5000/extract_keywords
Content-Type: application/json
{
"model_name": "paraphrase-multilingual-mpnet-base-v2",
"docs": "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.",
"keyphrase_ngram_range": [1, 1],
"top_n": 5,
"min_df": 1,
"use_maxsum": false,
"use_mmr": false,
"diversity": 0.5,
"nr_candidates": 20
}