【Agent应用】运营数据分析与决策建议

基于ERNIE Bot Agent框架实现运营数据分析与决策建议功能。

请注意!!!填入自己的token才可运行。

可以选择上传自己的数据(Excel表格),或者直接使用示例数据演示。

demo链接:https://aistudio.baidu.com/application/detail/20310

作者:AI李健

场景

企业在做运营决策时,需要花大量的时间进行数据整理与分析,而管理者面临决策时,往往对时效要求特别高,因为机会稍纵即逝。

所以,如果能让AI进行数据分析并提供决策建议,将会大大提升决策效率。

假设你是一个APP运营,你需要对APP的运营数据进行分析,并制定对应的运营计划。最终目标是制定运营计划,在此之前,你需要通过管理后台拿到用户日活跃度(DAU)、月活跃度(MAU)、用户增长、成交转化率、商品库存等多项数据,并根据自己的运营经验对这些数据进行分析。

所以我们可以简单定义两个工具,并通过ERNIE Bot Agent去调用这两个工具,达成最终的目标。

第一个工具:定义一个获取数据,并使用文心一言对数据进行分析的工具

第二个工具:定义一个根据数据分析结果输出运营决策建议的工具

技术路径规划

想要实现这个功能,我们可以分为以下几个步骤:

1.对企业数据进行预处理;

2.让大模型根据决策需求,分析出需要用到的数据;

3.调用相应的数据进行分析,并输出决策建议。

安装agent工具

使用源码安装方式

In [13]

# 从GitHub仓库克隆最新的代码
# !git clone https://github.com/PaddlePaddle/ERNIE-SDK.git
# 有时候无法下载,所以为大家准备好了ERNIE-SDK源码。

In [1]

# 首先安装Ernie Bot
!pip install ./ERNIE-SDK/erniebot

# 然后安装ERNIE Bot Agent
!pip install ./ERNIE-SDK/erniebot-agent          # 安装核心模块
#pip install './erniebot-agent/.[all]'   # 也可以加上[all]一次性安装所有模块,包括gradio等依赖库
Looking in indexes: https://mirror.baidu.com/pypi/simple/, https://mirrors.aliyun.com/pypi/simple/
Processing ./ERNIE-SDK/erniebot
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: aiohttp in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from erniebot==0.0.0.dev0) (3.9.1)
Requirement already satisfied: bce-python-sdk in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from erniebot==0.0.0.dev0) (0.8.98)
Requirement already satisfied: colorlog in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from erniebot==0.0.0.dev0) (6.8.0)
Requirement already satisfied: jsonschema>=4.19 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from erniebot==0.0.0.dev0) (4.20.0)
Requirement already satisfied: requests>=2.20 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from erniebot==0.0.0.dev0) (2.31.0)
Collecting tenacity (from erniebot==0.0.0.dev0)
  Downloading https://mirrors.aliyun.com/pypi/packages/f4/f1/990741d5bb2487d529d20a433210ffa136a367751e454214013b441c4575/tenacity-8.2.3-py3-none-any.whl (24 kB)
Requirement already satisfied: typing-extensions>=4.8.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from erniebot==0.0.0.dev0) (4.9.0)
Requirement already satisfied: attrs>=22.2.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from jsonschema>=4.19->erniebot==0.0.0.dev0) (23.1.0)
Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from jsonschema>=4.19->erniebot==0.0.0.dev0) (2023.11.2)
Requirement already satisfied: referencing>=0.28.4 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from jsonschema>=4.19->erniebot==0.0.0.dev0) (0.32.0)
Requirement already satisfied: rpds-py>=0.7.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from jsonschema>=4.19->erniebot==0.0.0.dev0) (0.15.2)
Requirement already satisfied: charset-normalizer<4,>=2 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from requests>=2.20->erniebot==0.0.0.dev0) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from requests>=2.20->erniebot==0.0.0.dev0) (3.6)
Requirement already satisfied: urllib3<3,>=1.21.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from requests>=2.20->erniebot==0.0.0.dev0) (2.1.0)
Requirement already satisfied: certifi>=2017.4.17 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from requests>=2.20->erniebot==0.0.0.dev0) (2023.11.17)
Requirement already satisfied: multidict<7.0,>=4.5 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from aiohttp->erniebot==0.0.0.dev0) (6.0.4)
Requirement already satisfied: yarl<2.0,>=1.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from aiohttp->erniebot==0.0.0.dev0) (1.9.4)
Requirement already satisfied: frozenlist>=1.1.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from aiohttp->erniebot==0.0.0.dev0) (1.4.1)
Requirement already satisfied: aiosignal>=1.1.2 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from aiohttp->erniebot==0.0.0.dev0) (1.3.1)
Requirement already satisfied: async-timeout<5.0,>=4.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from aiohttp->erniebot==0.0.0.dev0) (4.0.3)
Requirement already satisfied: pycryptodome>=3.8.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from bce-python-sdk->erniebot==0.0.0.dev0) (3.19.0)
Requirement already satisfied: future>=0.6.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from bce-python-sdk->erniebot==0.0.0.dev0) (0.18.3)
Requirement already satisfied: six>=1.4.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from bce-python-sdk->erniebot==0.0.0.dev0) (1.16.0)
Building wheels for collected packages: erniebot
  Building wheel for erniebot (pyproject.toml) ... done
  Created wheel for erniebot: filename=erniebot-0.0.0.dev0-py3-none-any.whl size=64612 sha256=f29c48de8deb040dc06ab27c7de6d4fba4d64395ba20f5403e87ed00bc2cea1f
  Stored in directory: /tmp/pip-ephem-wheel-cache-yqjfzf91/wheels/88/b6/a2/52e38ae73556a8265691c9bc06bf832c2cd5644d1402bc654f
Successfully built erniebot
Installing collected packages: tenacity, erniebot
Successfully installed erniebot-0.0.0.dev0 tenacity-8.2.3
Looking in indexes: https://mirror.baidu.com/pypi/simple/, https://mirrors.aliyun.com/pypi/simple/
Processing ./ERNIE-SDK/erniebot-agent
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: aiohttp in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from erniebot-agent==0.0.0.dev0) (3.9.1)
Requirement already satisfied: anyio in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from erniebot-agent==0.0.0.dev0) (3.7.1)
Collecting asyncio-atexit (from erniebot-agent==0.0.0.dev0)
  Downloading https://mirrors.aliyun
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

军哥说AI

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值