Skip to content

Commit 02b0e81

Browse files
authored
Update README.md
1 parent 0dec7d6 commit 02b0e81

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Index
1919
$source = '李彦宏是马云最大威胁嘛?';
2020
$pullWord = new PullWord($source);
2121
$result = $pullWord->get();
22-
var_dump($result);
22+
// result 李彦 李彦宏 彦宏 马云 最大 大威 威胁
2323
}
2424
}
2525
```
@@ -70,16 +70,22 @@ class Index
7070
## 其它链式方法
7171
#### 返回json格式
7272
```php
73-
PullWord::source($source)->toJson()->get()
73+
$source = '李彦宏是马云最大威胁嘛?';
74+
PullWord::source($source)->toJson()->get();
75+
// 结果 [{"t":"李彦"},{"t":"李彦宏"},{"t":"彦宏"},{"t":"马云"},{"t":"最大"},{"t":"大威"},{"t":"威胁"}]
7476
```
7577
#### 开启调试模式
76-
含有出词概率
78+
结果含有出词概率
7779
```php
78-
PullWord::source($source)->debug()->get()
80+
$source = '李彦宏是马云最大威胁嘛?';
81+
PullWord::source($source)->debug()->get();
82+
// 结果 李彦:0.23007 李彦宏:0.900302 彦宏:0.0703263 马云:1 最大:0.892363 大威:0.289136 威胁:0.9367
7983
```
8084

8185
#### 开启阈值
8286
出词概率阈值(0-1之间的小数),1表示只有100%有把握的词才出
8387
```php
84-
PullWord::source($source)->threshold(0.5)->get()
88+
$source = '李彦宏是马云最大威胁嘛?';
89+
PullWord::source($source)->threshold(0.4)->get();
90+
// 结果 李彦宏 马云 最大 威胁
8591
```

0 commit comments

Comments
 (0)