SubmitCustomSourceTopicAnalysis
Submit topic trend analysis using a custom data source
Try it now
Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.
RAM authorization
The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:
-
Action: The actions can be used in the
Actionelement of RAM permission policy statements to grant permissions to perform the operation. -
API: The API that you can call to perform the action.
-
Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.
-
Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.
- For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the
Resourceelement of the policy. - For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the
Resourceelement of the policy.
- For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the
-
Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.
-
Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.
Action | Access level | Resource type | Condition key | Dependent action |
|---|---|---|---|---|
aimiaobi:SubmitCustomSourceTopicAnalysis | create | *All Resource
| None | None |
Request parameters
Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| FileUrl | string | No | The file URL. You must specify either | |
| FileType | string | No | The file type. Valid values: | json |
| MaxTopicSize | integer | No | The maximum number of topics to analyze. By default, the service sorts clustered news by count in descending order and analyzes the top 50 topics. The maximum value is 200. | 50 |
| News | array<object> | No | A list of news articles. You must specify either | |
array<object> | No | A news object. | ||
| Title | string | No | The title of the news article. | News title |
| Content | string | No | The content of the news article. | News content |
| Url | string | No | The URL of the news article. | |
| Comments | array<object> | No | A list of comments. | |
object | No | A comment object. | ||
| Text | string | No | The comment text. | Comment content |
| PubTime | string | No | The publication time. The format must be | 2024-01-22 10:29:00 |
| Source | string | No | The source of the news article. | Baidu |
| WorkspaceId | string | Yes | llm-xx | |
| AnalysisTypes | array | No | The types of analysis for hot topic selection. Multiple values are supported. If you omit this parameter, the service analyzes all types by default. If you pass an empty array, the service performs only clustering and skips the analysis of hot topics for selection. | |
string | No | The type of analysis for hot topic selection. | TimedViewPoints | |
| Topics | array<object> | No | A list of topics. | |
object | No | A topic object. | ||
| Topic | string | No | The topic name. | Topic name |
| News | array | No | A list of news articles. | |
| HottopicNews | No | A news object. | ||
| CustomField | string | No | A custom field. You can use this field to filter results when you call the | xxx |
| TopicUrl | string | No | The URL of the topic. This value is passed through to the | |
| TopicsFileUrl | string | No | The URL of the file that contains the topic list. The file must be in JSON Lines format, with each line representing a single JSON object. |
Two analysis modes are available:
-
Perform news clustering on a batch of articles, followed by topic planning analysis.
- The analysis requires a news list object. See the
Newsfield for the object's structure. - Specify either the
Newsfield or thefileUrlfield. - You can analyze up to 10,000 news articles per request.
- The
MaxTopicSizeparameter controls the number of aggregated topics you can generate, up to a maximum of 200.
- The analysis requires a news list object. See the
-
Perform topic planning analysis directly on pre-clustered news.
- The analysis requires a topic list object. See the
Topicsfield for the object's structure. - Specify either the
Topicsfield or theTopicsFileUrlfield.
- The analysis requires a topic list object. See the
-
You can export analysis results in JSON or Excel format. The
ExportTypefield in the export API specifies the format. -
For guidance on best practices, see Best Practices for Miaoce Custom Data Sources.
The following example shows the fileUrl format:
[
{
"Content": "This is a sample article about artificial intelligence. Artificial intelligence is evolving fast and is widely used across many domains. From autonomous driving to medical diagnosis, AI is changing how we live.",
"Title": "Trends in artificial intelligence",
"Source": "Science and Technology Daily"
},
{
"Content": "As climate change becomes more severe, renewable energy has become a global focus. Advances in clean energy technologies such as solar and wind provide new ways to address environmental challenges.",
"Title": "The future of renewable energy",
"Source": "Environmental Weekly"
},
{
"Content": "The rollout of 5G creates new opportunities for the internet of things (IoT). Smart home and smart city concepts are moving from science fiction to reality and are changing how we interact with the world.",
"Title": "Integrated development of 5G and the internet of things",
"Source": "Communications World"
},
{
"Content": "As health awareness grows, the fitness industry is expanding fast. From traditional gyms to new online fitness platforms, diverse exercise options meet the needs of different groups.",
"Title": "The rise of the fitness industry",
"Source": "Healthy Living"
},
{
"Content": "The rise of short video platforms has changed how people consume content. Users get information and entertainment through short clips. This fragmented distribution model has had a deep impact on traditional media.",
"Title": "Content shifts in the short video era",
"Source": "Media Watch"
}
]
Response elements
Element | Type | Description | Example |
|---|---|---|---|
object | PlainResult | ||
| Code | string | The status code. | NoData |
| Data | object | The data returned by the operation. | |
| TaskId | string | The unique ID of the task. | 3f7045e099474ba28ceca1b4eb6d6e21 |
| TaskName | string | The name of the task. | Task name |
| HttpStatusCode | integer | The HTTP status code. | 200 |
| Message | string | The message that describes the error. | success |
| RequestId | string | The unique ID of the request. | 1813ceee-7fe5-41b4-87e5-982a4d18cca5 |
| Success | boolean | Indicates whether the request was successful. A value of | true |
Examples
Success response
JSON format
{
"Code": "NoData",
"Data": {
"TaskId": "3f7045e099474ba28ceca1b4eb6d6e21",
"TaskName": "任务名称"
},
"HttpStatusCode": 200,
"Message": "success",
"RequestId": "1813ceee-7fe5-41b4-87e5-982a4d18cca5",
"Success": true
}
Error codes
HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 403 | NoPermission | You are not authorized to perform this action. | Please check the workspaceId assignment |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.