# 数据挖掘

#### 1.新建数据集

a. 进入TensorBay，在个人或团队账户下，点击【新建数据集】&#x20;

![](/files/Ig3eC4alxFKrV83MvbAG)

#### 2.配置密钥

a. 点击导航栏中的【开发者工具】，点击【新建AccessKey】并复制accesskey &#x20;

![](/files/IHc8obuWUqpYgZUErMvg)

b. 在新建数据集界面，点击【设置】->【自动化配置】->【新建密钥】 &#x20;

![](/files/7EZ48wg6xvzLSQgIVEa8)

c. 新建密钥，密钥名为`accesskey`, 密钥值为a步骤复制的accesskey&#x20;

![](/files/Hlhw00ZmDMca50ibHt47)

#### 3.创建工作流

a. 在新建数据集详情页，点击【自动化】->【新建工作流】 &#x20;

![](/files/SPKsseD2AWbc8Oz4Vm79)

b. 填写工作流名称（注： Workflow名称只能包含小写字母、数字以及减号，名称不得少于2位字符且首位不能为减号。） &#x20;

![](/files/UrExd8sr9UxsJDb91oHg)

c. 选择工作流触发机制【Trigger】（默认manual）&#x20;

![](/files/w8f1704BatPQQ4IJqjMc)

d. 设置工作流参数【Parameters】（注：本次示例参数来源于镜像设置的命令行参数，用以调整爬取论文的月份，默认为1。）

![](/files/tga8LcwtjFT5wVQeO6Kz)

e. 选择实例配置【Instance】 &#x20;

![](/files/ipYdGBYwu2zaM3omNK3x)

f. 复制下列内容建立YAML文件

```
# 一个workflow由多个task构成，它们可以串行或并行运行.
tasks:
  # 本workflow包括四个task，分别为：scraper,pdf2txt,parser,statistics
  scraper:
    container:
         # 本task运行所依赖性的镜像名, 支持公开及私有的镜像仓库
      image: hub.graviti.cn/miner/scraper:2.3

      # 镜像运行后执行`./archive/run.py {{workflow.parameters.month}}`这条命令
      command: [python3]
      args: ["./archive/run.py", "{{workflow.parameters.month}}"]
  pdf2txt:
    # pdf2txt依赖于scraper，即仅在scraper运行结束后才开始运行
    dependencies:
      - scraper
    container:
      image: hub.graviti.cn/miner/pdf2txt:2.0
      command: [python3]
      args: ["pdf2txt.py"]
  parser:
    # parser依赖于pdf2txt，即仅在pdf2txt运行结束后才开始运行
    dependencies:
      - pdf2txt
    container:
      image: hub.graviti.cn/miner/parser:2.0
      command: [python3]
      args: ["parser.py"]
  statistics:
    # statistics依赖于parser, 即仅在parser运行结束后才开始运行
    dependencies:
      - parser
    container:
      image: hub.graviti.cn/miner/statistics:2.0
      command: [python3]
      args: ["statistics.py"]
```

&#x20;

![](/files/IKVNodH2zxWCZFKCUS0x)

g. 点击【发布】后并点击【确定】&#x20;

![](/files/4VTjVcoSUrvFjwp2D7j9)

#### 4.运行工作流

a. 点击【自动化】，回到工作流界面。选择刚创建好的工作流并点击【运行工作流】 &#x20;

![](/files/iTxV2lJlf8ntHBbhcjRf)

b. 调整参数，比如将month对应参数调整成10（月份），并点击【运行】&#x20;

![](/files/USUyAh2BnCt6qVLh116h)

#### 5.查看结果

a. 在工作流详情页，点击【用户日志】查看工作流运行日志&#x20;

![](/files/dRrXWoEpbBDXbacU6r6H)

b. 在数据集详情页，点击【概要】->【数据预览】查看统计结果 &#x20;

![](/files/pZQpsYsRnISMMOH9zIHi)

![](/files/nSICUWeJdx55UqFA7YvA)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.graviti.cn/dev-doc/tools/shi-li-yan-shi/shu-ju-wa-jue.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
