mirror of
https://github.com/php-win-ext/phpy.git
synced 2026-03-24 00:42:11 +01:00
15 lines
451 B
PHP
15 lines
451 B
PHP
<?php
|
|
$transformers = PyCore::import('transformers');
|
|
|
|
$os = PyCore::import('os');
|
|
$os->environ->__setitem__('https_proxy', getenv('https_proxy'));
|
|
|
|
$distilled_student_sentiment_classifier = $transformers->pipeline(
|
|
model: "lxyuan/distilbert-base-multilingual-cased-sentiments-student",
|
|
top_k: null,
|
|
);
|
|
|
|
$rs = $distilled_student_sentiment_classifier ("I love this movie and i would watch it again and again!");
|
|
var_dump(PyCore::scalar($rs));
|
|
|