Client::send()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 3
dl 0
loc 9
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of the strays/baidu-ai.
5
 *
6
 * (c) strays <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Strays\BaiDuAi\Language\Simnet;
13
14
use Strays\BaiDuAi\Kernel\BaseClient;
15
16
class Client extends BaseClient
17
{
18
    /**
19
     * 短文本相似度.
20
     *
21
     * @param string $text_1
22
     * @param string $text_2
23
     * @param string $model
24
     *
25
     * @return string
26
     */
27
    public function send(string $text_1, string $text_2, string $model = 'BOW')
28
    {
29
        $body = [
30
            'text_1' => $text_1,
31
            'text_2' => $text_2,
32
            'model' => $model,
33
        ];
34
35
        return $this->httpPostJson('/rpc/2.0/nlp/v2/simnet', $body);
36
    }
37
}
38