当前位置: 首页 > news >正文

万户网站做的怎样找公司做网站多少钱成都

万户网站做的怎样,找公司做网站多少钱成都,百度付费推广的费用,网页模板psd如果你尝试过像ChatGPT这样的LLM#xff0c;就会知道它们几乎可以为任何语言或包生成代码。但是仅仅依靠LLM是有局限的。对于数据可视化的问题我们需要提供一下的内容 描述数据:模型本身并不知道数据集的细节#xff0c;比如列名和行细节。手动提供这些信息可能很麻烦#…如果你尝试过像ChatGPT这样的LLM就会知道它们几乎可以为任何语言或包生成代码。但是仅仅依靠LLM是有局限的。对于数据可视化的问题我们需要提供一下的内容 描述数据:模型本身并不知道数据集的细节比如列名和行细节。手动提供这些信息可能很麻烦特别是当数据集变得更大时。如果没有这个上下文LLM可能会产生幻觉或虚构列名从而导致数据可视化中的错误。 样式和偏好:数据可视化是一种艺术形式每个人都有独特的审美偏好这些偏好因图表类型和信息而异。不断地为每个可视化提供不同的风格和偏好是很麻烦的。而配备了风格信息的代理可以简化这一过程确保一致和个性化的视觉输出。 如果每次于LLM进行交互都附带这些内容会导致请求过于复杂不利于用户的输入所以这次我们构建一个数据可视化的代理通过代理我们只需提供很少的信息就能够让LLM生成我们定制化的图表。 可视化库的选择 在构建一个数据可视化的AI代理时选择合适的可视化工具是至关重要的。虽然存在多种工具可以用于数据可视化但Plotly和Matplotlib是最为常用的两种。为了构建一个既功能丰富又用户友好的可视化界面我们决定使用Plotly作为主要的可视化库。 与Matplotlib相比Plotly提供了更加丰富的交互性功能。它支持直接在Web浏览器中的动态渲染使得用户能够通过缩放、平移、悬停来互动式地探索数据。这种高度的交互性是Plotly的一大优势尤其是在需要展示复杂数据集或进行深入数据分析的应用场景中。 虽然Matplotlib在科学研究和学术出版物中有广泛的应用特别是在生成高质量的静态图像方面具有极高的灵活性和精确度但其在交互性和Web集成方面的限制使得它在构建现代、交互式的数据可视化解决方案时可能不如Plotly那么吸引人。 所以我们选择Plotly作为构建数据可视化AI代理的工具不仅能够满足用户对交互性的需求还能够提供强大的数据处理能力和优秀的用户体验。这将极大地提高数据可视化的效率和效果使得数据分析更加直观和易于理解。 下面是我使用Llama3 70B构建可视化基线。 我们执行上面的代码将得到如下的结果 要构建这个应用程序我们需要为LLM代理配备两个工具一个工具提供关于数据集的信息另一个工具包含关于样式的信息。 代理提供的信息 1、DataFrame信息 这个工具目的是分析DataFrame并将其内容信息存储到索引中。要索引的数据包括列名、数据类型以及值的最小值、最大值和平均值范围。这有助于代理理解它们正在处理的变量类型。 这里我们使用layoff.fyi 的数据来进行分析。 我们这里还做了一些预处理的工作包括将数据转换为适当的类型(例如将数字字符串转换为整数或浮点数)并删除空值。 #Optional pre-processingimport pandas as pdimport numpy as npdf pd.read_csv(WARN Notices California_Omer Arain - Sheet1.csv)#Changes date like column into datetime df[Received Date] [pd.to_datetime(x) for x in df[Received Date]]df[Effective Date] [pd.to_datetime(x) for x in df[Effective Date]]#Converts numbers stored as strings into intsdf[Number of Workers] [int(str(x).replace(,,)) if str(x)!nan else np.nan for x in df[Number of Workers]]# Replacing NULL valuesdf df.replace(np.nan,0)将数据集信息存储到索引中 from llama_index.core.readers.json import JSONReaderfrom llama_index.core import VectorStoreIndeximport json# Function that stores the max,min mean for numerical valuesdef return_vals(df,c):if isinstance(df[c].iloc[0], (int, float, complex)):return [max(df[c]), min(df[c]), np.mean(df[c])]# For datetime we need to store that information as stringelif(isinstance(df[c].iloc[0],datetime.datetime)):return [str(max(df[c])), str(min(df[c])), str(np.mean(df[c]))]else:# For categorical variables you can store the top 10 most frequent items and their frequencyreturn list(df[c].value_counts()[:10])# declare a dictionary dict_ {}for c in df.columns:# storing the column name, data type and contentdict_[c] {column_name:c,type:str(type(df[c].iloc[0])), variable_information:return_vals(df,c)}# After looping storing the information as a json dump that can be loaded # into a llama-index Document# Writing the information into dataframe.json with open(dataframe.json, w) as fp:json.dump(dict_ ,fp) reader JSONReader()# Load data from JSON filedocuments reader.load_data(input_filedataframe.json)# Creating an Indexdataframe_index VectorStoreIndex.from_documents(documents)这样第一步就完成了。 2、自定义样式信息 表样式主要包括关于如何在plot中设置不同图表样式的自然语言说明。这里需要使用自然语言描述样式所以可能需要进行尝试下面是我如何创建折线图和条形图的说明! from llama_index.core import Documentfrom llama_index.core import VectorStoreIndexstyling_instructions [Document(textDont ignore any of these instructions.For a line chart always use plotly_white template, reduce x axes y axes line to 0.2 x y grid width to 1. Always give a title and make bold using html tag axis label and try to use multiple colors if more than one lineAnnotate the min and max of the lineDisplay numbers in thousand(K) or Million(M) if larger than 1000/100000 Show percentages in 2 decimal points with % sign), Document(textDont ignore any of these instructions.For a bar chart always use plotly_white template, reduce x axes y axes line to 0.2 x y grid width to 1. Always give a title and make bold using html tag axis label and try to use multiple colors if more than one lineAlways display numbers in thousand(K) or Million(M) if larger than 1000/100000. Add annotations x valuesAnnotate the values on the y variableIf variable is a percentage show in 2 decimal points with % sign.)# You should fill in instructions for other charts and play around with these instructions, Document(text General chart instructionsDo not ignore any of these instructionsalways use plotly_white template, reduce x y axes line to 0.2 x y grid width to 1. Always give a title and make bold using html tag axis label Always display numbers in thousand(K) or Million(M) if larger than 1000/100000. Add annotations x valuesIf variable is a percentage show in 2 decimal points with %)]# Creating an Indexstyle_index VectorStoreIndex.from_documents(styling_instructions)或者直接将部分样式的代码作为示例输入给模型这样对于固定的样式是非常好的一个方式 构建AI代理 我们上面已经构建了2个索引DataFrame信息元数据表格自定义样式信息 下面就可以使用lama- index从索引构建查询引擎并将其用作代理工具使用。 #All imports for this sectionfrom llama_index.core.agent import ReActAgentfrom llama_index.core.tools import QueryEngineToolfrom llama_index.core.tools import ToolMetadatafrom llama_index.llms.groq import Groq# Build query engines over your indexes# It makes sense to only retrieve one document per query # However, you may play around with this if you need multiple charts# Or have two or more dataframes with similar column namesdataframe_engine dataframe_index.as_query_engine(similarity_top_k1)styling_engine style_index.as_query_engine(similarity_top_k1)# Builds the toolsquery_engine_tools [QueryEngineTool(query_enginedataframe_engine,# Provides the description which helps the agent decide which tool to use metadataToolMetadata(namedataframe_index,descriptionProvides information about the data in the data frame. Only use column names in this tool,),\),QueryEngineTool(# Play around with the description to see if it leads to better resultsquery_enginestyling_engine,metadataToolMetadata(nameStyling,descriptionProvides instructions on how to style your Plotly plotsUse a detailed plain text question as input to the tool.,),),]# I used open-source models via Groq but you can use OpenAI/Google/Mistral models as wellllm Groq(modelllama3-70b-8192, api_keyyour_api_key)# initialize ReAct agentagent ReActAgent.from_tools(query_engine_tools, llmllm, verboseTrue)为了防止幻觉我这里稍微调整了一下提示这步不是必须的 这里是ReAct的默认提示 修改为 from llama_index.core import PromptTemplatenew_prompt_txt You are designed to help with building data visualizations in Plotly. You may do all sorts of analyses and actions using Python## ToolsYou have access to a wide variety of tools. You are responsible for using the tools in any sequence you deem appropriate to complete the task at hand.This may require breaking the task into subtasks and using different tools to complete each subtask.You have access to the following tools, use these tools to find information about the data and styling:{tool_desc}## Output FormatPlease answer in the same language as the question and use the following format: Thought: The current language of the user is: (user’s language). I need to use a tool to help me answer the question. Action: tool name (one of {tool_names}) if using a tool. Action Input: the input to the tool, in a JSON format representing the kwargs (e.g. {{“input”: “hello world”, “num_beams”: 5}}) Please ALWAYS start with a Thought.Please use a valid JSON format for the Action Input. Do NOT do this {{input: hello world, num_beams: 5}}.If this format is used, the user will respond in the following format: Observation: tool response You should keep repeating the above format till you have enough information to answer the question without using any more tools. At that point, you MUST respond in the one of the following two formats: Thought: I can answer without using any more tools. I’ll use the user’s language to answer Answer: [your answer here (In the same language as the user’s question)] Thought: I cannot answer the question with the provided tools. Answer: [your answer here (In the same language as the user’s question)] ## Current ConversationBelow is the current conversation consisting of interleaving human and assistant messages.# Adding the prompt text into PromptTemplate object new_prompt PromptTemplate(new_prompt_txt)# Updating the prompt agent.update_prompts({agent_worker:system_prompt:new_prompt})可视化 现在让就可以向我们构建的代理发起请求了 response agent.chat(Give Plotly code for a line chart for Number of Workers get information from the dataframe about the correct column names and make sure to style the plot properly and also give a title)从输出中可以看到代理如何分解请求并最终使用Python代码进行响应(可以直接构建输出解析器或复制过去并运行)。 通过运行以代码创建的图表将注释、标签/标题和轴格式与样式信息完全一致。因为已经有了数据信息所以我们直接提出要求就可以不需要输入任何的数据信息 在试一试其他的图表生成一个柱状图 结果如下 总结 AI代理可以自动化从多个数据源收集、清洗和整合数据的过程。这意味着可以减少手动处理错误提高数据处理速度让分析师有更多时间专注于解读数据而不是处理数据。使用AI代理进行数据可视化能够显著提升数据分析的深度和广度同时提高效率和用户体验帮助企业和组织更好地利用他们的数据资产。 我们这里只是做了第一步如果要制作一套代理工具还需要很多步骤比如可视化代码的自动执行优化提示和处理常见故障等等如果你对这方面感兴趣可以留言如果人多的话我们会在后续的文章中一一介绍。 https://avoid.overfit.cn/post/b7250a6a029d46adb2c5948eb71b5d28 作者Arslan Shahid
文章转载自:
http://www.morning.wdqhg.cn.gov.cn.wdqhg.cn
http://www.morning.dhdzz.cn.gov.cn.dhdzz.cn
http://www.morning.srndk.cn.gov.cn.srndk.cn
http://www.morning.qwwcf.cn.gov.cn.qwwcf.cn
http://www.morning.yrbp.cn.gov.cn.yrbp.cn
http://www.morning.rhdqz.cn.gov.cn.rhdqz.cn
http://www.morning.txzqf.cn.gov.cn.txzqf.cn
http://www.morning.ztmkg.cn.gov.cn.ztmkg.cn
http://www.morning.tqdqc.cn.gov.cn.tqdqc.cn
http://www.morning.ykqbs.cn.gov.cn.ykqbs.cn
http://www.morning.mwnch.cn.gov.cn.mwnch.cn
http://www.morning.junmap.com.gov.cn.junmap.com
http://www.morning.pkrb.cn.gov.cn.pkrb.cn
http://www.morning.tdldh.cn.gov.cn.tdldh.cn
http://www.morning.qkdcb.cn.gov.cn.qkdcb.cn
http://www.morning.dxsyp.cn.gov.cn.dxsyp.cn
http://www.morning.hncrc.cn.gov.cn.hncrc.cn
http://www.morning.bpmft.cn.gov.cn.bpmft.cn
http://www.morning.krgjc.cn.gov.cn.krgjc.cn
http://www.morning.tdhxp.cn.gov.cn.tdhxp.cn
http://www.morning.osshjj.cn.gov.cn.osshjj.cn
http://www.morning.nxbsq.cn.gov.cn.nxbsq.cn
http://www.morning.slysg.cn.gov.cn.slysg.cn
http://www.morning.cjqqj.cn.gov.cn.cjqqj.cn
http://www.morning.lqynj.cn.gov.cn.lqynj.cn
http://www.morning.yqkmd.cn.gov.cn.yqkmd.cn
http://www.morning.clpfd.cn.gov.cn.clpfd.cn
http://www.morning.ffbp.cn.gov.cn.ffbp.cn
http://www.morning.rpms.cn.gov.cn.rpms.cn
http://www.morning.rcqyk.cn.gov.cn.rcqyk.cn
http://www.morning.rdmz.cn.gov.cn.rdmz.cn
http://www.morning.hotlads.com.gov.cn.hotlads.com
http://www.morning.xnymt.cn.gov.cn.xnymt.cn
http://www.morning.bchhr.cn.gov.cn.bchhr.cn
http://www.morning.dmhs.cn.gov.cn.dmhs.cn
http://www.morning.hmktd.cn.gov.cn.hmktd.cn
http://www.morning.zlqyj.cn.gov.cn.zlqyj.cn
http://www.morning.gxeqedd.cn.gov.cn.gxeqedd.cn
http://www.morning.lcdtb.cn.gov.cn.lcdtb.cn
http://www.morning.bchfp.cn.gov.cn.bchfp.cn
http://www.morning.jjzjn.cn.gov.cn.jjzjn.cn
http://www.morning.lddpj.cn.gov.cn.lddpj.cn
http://www.morning.kjrlp.cn.gov.cn.kjrlp.cn
http://www.morning.npmx.cn.gov.cn.npmx.cn
http://www.morning.qdsmile.cn.gov.cn.qdsmile.cn
http://www.morning.ndngj.cn.gov.cn.ndngj.cn
http://www.morning.mingjiangds.com.gov.cn.mingjiangds.com
http://www.morning.nfcxq.cn.gov.cn.nfcxq.cn
http://www.morning.xgkxy.cn.gov.cn.xgkxy.cn
http://www.morning.xqkcs.cn.gov.cn.xqkcs.cn
http://www.morning.hxbps.cn.gov.cn.hxbps.cn
http://www.morning.rjmb.cn.gov.cn.rjmb.cn
http://www.morning.hyryq.cn.gov.cn.hyryq.cn
http://www.morning.yqjjn.cn.gov.cn.yqjjn.cn
http://www.morning.crsnb.cn.gov.cn.crsnb.cn
http://www.morning.kkjhj.cn.gov.cn.kkjhj.cn
http://www.morning.sfrw.cn.gov.cn.sfrw.cn
http://www.morning.fhlfp.cn.gov.cn.fhlfp.cn
http://www.morning.lynb.cn.gov.cn.lynb.cn
http://www.morning.qqbw.cn.gov.cn.qqbw.cn
http://www.morning.trhlb.cn.gov.cn.trhlb.cn
http://www.morning.pqypt.cn.gov.cn.pqypt.cn
http://www.morning.txjrc.cn.gov.cn.txjrc.cn
http://www.morning.mmqng.cn.gov.cn.mmqng.cn
http://www.morning.gqfks.cn.gov.cn.gqfks.cn
http://www.morning.wgrm.cn.gov.cn.wgrm.cn
http://www.morning.rjyd.cn.gov.cn.rjyd.cn
http://www.morning.nykzl.cn.gov.cn.nykzl.cn
http://www.morning.tzmjc.cn.gov.cn.tzmjc.cn
http://www.morning.cfybl.cn.gov.cn.cfybl.cn
http://www.morning.kjrlp.cn.gov.cn.kjrlp.cn
http://www.morning.sqfrg.cn.gov.cn.sqfrg.cn
http://www.morning.ktrdc.cn.gov.cn.ktrdc.cn
http://www.morning.qkrqt.cn.gov.cn.qkrqt.cn
http://www.morning.zfrs.cn.gov.cn.zfrs.cn
http://www.morning.mtrrf.cn.gov.cn.mtrrf.cn
http://www.morning.mjats.com.gov.cn.mjats.com
http://www.morning.bpwfr.cn.gov.cn.bpwfr.cn
http://www.morning.xqjrg.cn.gov.cn.xqjrg.cn
http://www.morning.bangaw.cn.gov.cn.bangaw.cn
http://www.tj-hxxt.cn/news/270469.html

相关文章:

  • 亿玛酷网站建设南宁网站建设业务员
  • 网站色彩搭配表网站建设基础教案
  • 外链推广网站html国外网站源码
  • js网站开发北京哪家网站建设公司好
  • 怎么做网站推广林芝地区网站制作论文优帮云
  • 响应式设计 手机网站wordpress wp option
  • wordpress 做图片站网站建设的广告语
  • 电子商务网站建设核心做网站首页图片
  • 英文网站设计技术服务wordpress在线扫描
  • 淘宝导购网站怎么做建设银行网站为什么登不上
  • 常州网站推广机构长沙百姓网招聘
  • 教育直播平台网站建设费用网站仿制教程
  • 营销型网站建设 价格高品质的网站设计制作
  • 太原做网站的网络公司上海做网站优化的公司
  • 做企业网站的合同响应式网站模板
  • 网站解析加速page怎么打开wordpress
  • 医疗网站不备案凡客科技
  • h5网站设计方案公司搭建网站步骤
  • seo刷网站建设厅网站ca验证失败
  • 如何做com的网站手机优化对手机有影响吗
  • 合肥网站建设市场怎么做网站跳转
  • 宁波建站平台郴州今天几例
  • 手机网站和app有什么区别山东潍坊新闻
  • 公司的网站建设费会计分录印象笔记到wordpress
  • 装修网站平台排行榜进入网络管理的网站
  • 学校网站建设工作会议网站制作公司多少费用
  • 做互联网产品和运营必备的网站免费域名申请 知乎
  • 漯河市郾城区网站建设怀化住建部网站
  • 购买腾讯备案网站网站建设销售客户疑问
  • 网站开发入门书籍2018网页版微信聊天记录会被监控吗