Files
phpy/examples/pipeline.php
tianfenghan 9336c2c025 init
2023-12-04 17:20:01 +08:00

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));