Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
test-spring
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
倪 泽文
test-spring
Commits
844242d1
Commit
844242d1
authored
1 year ago
by
倪 泽文
Browse files
Options
Downloads
Patches
Plain Diff
删除comment68.md
parent
e23a5ea6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
comment68.md
+0
-25
0 additions, 25 deletions
comment68.md
with
0 additions
and
25 deletions
comment68.md
deleted
100644 → 0
+
0
−
25
View file @
e23a5ea6
```
待评审函数开始protected void SentenceRun(String method) throws IOException
{
String text = getString("text");
int number = getInt("number", 6);
final JcsegGlobalResource resourcePool = (JcsegGlobalResource)globalResource;
final JcsegTokenizerEntry tokenizerEntry = resourcePool.getTokenizerEntry("extractor");
if ( tokenizerEntry == null ) {
response(STATUS_INVALID_ARGS, "can't find tokenizer instance \"extractor\"");
return;
}
final ISegment seg = ISegment.COMPLEX.factory.create(tokenizerEntry.getConfig(), tokenizerEntry.getDict());
final TextRankSummaryExtractor extractor = new TextRankSummaryExtractor(seg, new SentenceSeg());
extractor.setSentenceNum(number);
long s_time = System.nanoTime();
final List<String> sentence = extractor.getKeySentenceFromString(text);
double c_time = (System.nanoTime() - s_time)/1E9;
final Map<String, Object> map = new HashMap<>();
final DecimalFormat df = new DecimalFormat("0.00000");
//response the request
response(STATUS_OK, map);
}```待评审函数结束这是一个Java方法,用于提取文本的关键句子。该方法首先获取文本和要提取的句子数,然后使用JcsegGlobalResource类获取tokenizer实例。然后,使用这个tokenizer实例创建一个复杂的segment,并使用TextRankSummaryExtractor类提取关键句子。提取的关键句子存储在一个列表中,并返回给客户端。此外,该方法还计算了提取关键句子所需的时间,并将其存储在结果中。最后,该方法返回客户端一个表示请求成功的结果。
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment