LLM应用构建前的非结构化数据处理(一)标准化处理认识数据

news2024/11/20 18:43:02

1.学习内容

本节次学习内容来自于吴恩达老师的Preprocessing Unstructured Data for LLM Applications课程,因涉及到非结构化数据的相关处理,遂做学习整理。

2.相关环境准备

2.1 建议python版本在3.9版本以上

chromadb==0.4.22
langchain==0.1.5
langchain-community==0.0.17
langchain-core==0.1.19
langchain-openai==0.0.5
openai==1.11.1
tiktoken==0.5.2
#"unstructured[md,pdf,pptx]"
unstructured-client==0.16.0
unstructured==0.12.3
unstructured-inference==0.7.23
unstructured.pytesseract==0.3.12
urllib3==1.26.18
python-dotenv==1.0.1
panel==1.3.8
ipython==8.18.1
python-pptx==0.6.23
pdf2image==1.17.0
pdfminer==20191125
opencv-python==4.9.0.80
pikepdf==8.13.0
pypdf==4.0.1

2.2 申请unstructured的key

地址:unstructured.io,新注册的用户有14天的免费使用时间,每天1000页的转换。如图:
在这里插入图片描述

3.准备相关素材

在这里插入图片描述

# Warning control
import warnings
warnings.filterwarnings('ignore')

from IPython.display import JSON

import json

from unstructured_client import UnstructuredClient
from unstructured_client.models import shared
from unstructured_client.models.errors import SDKError

from unstructured.partition.html import partition_html
from unstructured.partition.pptx import partition_pptx
from unstructured.staging.base import dict_to_elements, elements_to_json
# 初始化API
s = UnstructuredClient(
    api_key_auth="XXX",
    server_url="https://api.unstrXXX",
)

3.1 解析html

from IPython.display import Image
Image(filename="example_screnshoot/HTML_demo.png", height=100, width=100)

现实如图:
在这里插入图片描述

filename = "examples/medium_blog.html"
elements = partition_html(filename=filename)
element_dict = [el.to_dict() for el in elements]
example_output = json.dumps(element_dict[11:15], indent=2)
JSON(example_output)
[
  {
    "type": "Title",
    "element_id": "ca4a2c78bca728f3477958ece3222e10",
    "text": "Share",
    "metadata": {
      "category_depth": 0,
      "last_modified": "2024-07-09T15:00:56",
      "languages": [
        "eng"
      ],
      "file_directory": "examples",
      "filename": "medium_blog.html",
      "filetype": "text/html"
    }
  },
  {
    "type": "NarrativeText",
    "element_id": "23a7f3e28178ea0fa2b3e98b0275d2e3",
    "text": "In the vast digital universe, data is the lifeblood that drives decision-making and innovation. But not all data is created equal. Unstructured data in images and documents often hold a wealth of information that can be challenging to extract and analyze.",
    "metadata": {
      "last_modified": "2024-07-09T15:00:56",
      "languages": [
        "eng"
      ],
      "parent_id": "ca4a2c78bca728f3477958ece3222e10",
      "file_directory": "examples",
      "filename": "medium_blog.html",
      "filetype": "text/html"
    }
  },
  {
    "type": "NarrativeText",
    "element_id": "e1b7532458a93cfc789751895884e7bb",
    "text": "Enter Unstructured.io, a powerful tool to extract and efficiently transform structured data. With sixteen and counting pre-built connectors, the API can easily integrate with various data sources, including AWS S3, GitHub, Google Cloud Storage, and more.",
    "metadata": {
      "link_texts": [
        "Unstructured.io"
      ],
      "link_urls": [
        "https://www.unstructured.io/"
      ],
      "link_start_indexes": [
        6
      ],
      "last_modified": "2024-07-09T15:00:56",
      "languages": [
        "eng"
      ],
      "parent_id": "ca4a2c78bca728f3477958ece3222e10",
      "file_directory": "examples",
      "filename": "medium_blog.html",
      "filetype": "text/html"
    }
  },
  {
    "type": "NarrativeText",
    "element_id": "a6179d69ca1a55e0a3f98c08af0034e0",
    "text": "In this guide, we’ll cover the advantages of using the Unstructured API and Connector module, walk you through a step-by-step process of using it with the S3 Connector as an example, and show you how to be a part of the Unstructured community.",
    "metadata": {
      "last_modified": "2024-07-09T15:00:56",
      "languages": [
        "eng"
      ],
      "parent_id": "ca4a2c78bca728f3477958ece3222e10",
      "file_directory": "examples",
      "filename": "medium_blog.html",
      "filetype": "text/html"
    }
  }
]

3.2 解析pptx

Image(filename="example_screnshoot/pptx_slide.png", height=600, width=600) 

在这里插入图片描述

filename = "examples/msft_openai.pptx"
elements = partition_pptx(filename=filename)
element_dict = [el.to_dict() for el in elements]
JSON(json.dumps(element_dict[:], indent=2))

输出如下:

[
  {
    "type": "Title",
    "element_id": "e53cb06805f45fa23fb6d77966c5ec63",
    "text": "ChatGPT",
    "metadata": {
      "category_depth": 1,
      "file_directory": "examples",
      "filename": "msft_openai.pptx",
      "last_modified": "2024-07-09T15:01:08",
      "page_number": 1,
      "languages": [
        "eng"
      ],
      "filetype": "application/vnd.openxmlformats-officedocument.presentationml.presentation"
    }
  },
  {
    "type": "ListItem",
    "element_id": "34a50527166e6765aa3e40778b5764e1",
    "text": "Chat-GPT: AI Chatbot, developed by OpenAI, trained to perform conversational tasks and creative tasks",
    "metadata": {
      "category_depth": 0,
      "file_directory": "examples",
      "filename": "msft_openai.pptx",
      "last_modified": "2024-07-09T15:01:08",
      "page_number": 1,
      "languages": [
        "eng"
      ],
      "parent_id": "e53cb06805f45fa23fb6d77966c5ec63",
      "filetype": "application/vnd.openxmlformats-officedocument.presentationml.presentation"
    }
  },
  {
    "type": "ListItem",
    "element_id": "631df69dff044f977d66d71c5cbdab83",
    "text": "Backed by GPT-3.5 model (gpt-35-turbo), GPT-4 models",
    "metadata": {
      "category_depth": 0,
      "file_directory": "examples",
      "filename": "msft_openai.pptx",
      "last_modified": "2024-07-09T15:01:08",
      "page_number": 1,
      "languages": [
        "eng"
      ],
      "parent_id": "e53cb06805f45fa23fb6d77966c5ec63",
      "filetype": "application/vnd.openxmlformats-officedocument.presentationml.presentation"
    }
  },
  {
    "type": "ListItem",
    "element_id": "6ac7cc52b0b2842ce7803bb176add0fb",
    "text": "Trained over 175 billion machine learning parameters",
    "metadata": {
      "category_depth": 0,
      "file_directory": "examples",
      "filename": "msft_openai.pptx",
      "last_modified": "2024-07-09T15:01:08",
      "page_number": 1,
      "languages": [
        "eng"
      ],
      "parent_id": "e53cb06805f45fa23fb6d77966c5ec63",
      "filetype": "application/vnd.openxmlformats-officedocument.presentationml.presentation"
    }
  },
  {
    "type": "ListItem",
    "element_id": "01133c5465c85564ab1e39568d8b51f5",
    "text": "Conversation-in and message-out ",
    "metadata": {
      "category_depth": 0,
      "file_directory": "examples",
      "filename": "msft_openai.pptx",
      "last_modified": "2024-07-09T15:01:08",
      "page_number": 1,
      "languages": [
        "eng"
      ],
      "parent_id": "e53cb06805f45fa23fb6d77966c5ec63",
      "filetype": "application/vnd.openxmlformats-officedocument.presentationml.presentation"
    }
  },
  {
    "type": "ListItem",
    "element_id": "1d495819227b92f341fb4b58d723a497",
    "text": "Note: Chat Completion API for GPT-4 models",
    "metadata": {
      "category_depth": 0,
      "file_directory": "examples",
      "filename": "msft_openai.pptx",
      "last_modified": "2024-07-09T15:01:08",
      "page_number": 1,
      "languages": [
        "eng"
      ],
      "parent_id": "e53cb06805f45fa23fb6d77966c5ec63",
      "filetype": "application/vnd.openxmlformats-officedocument.presentationml.presentation"
    }
  },
  {
    "type": "ListItem",
    "element_id": "e450241caa0f39c30939a474bcff06ac",
    "text": "GPT-4 is multimodal (e.g., images + text)",
    "metadata": {
      "category_depth": 0,
      "file_directory": "examples",
      "filename": "msft_openai.pptx",
      "last_modified": "2024-07-09T15:01:08",
      "page_number": 1,
      "languages": [
        "eng"
      ],
      "parent_id": "e53cb06805f45fa23fb6d77966c5ec63",
      "filetype": "application/vnd.openxmlformats-officedocument.presentationml.presentation"
    }
  }
]

3.3 解析pdf

Image(filename="example_screnshoot/cot_paper.png", height=600, width=600) 

在这里插入图片描述

filename = "examples/CoT.pdf"
with open(filename, "rb") as f:
    files=shared.Files(
        content=f.read(), 
        file_name=filename,
    )

req = shared.PartitionParameters(
    files=files,
    strategy='hi_res',
    pdf_infer_table_structure=True,
    languages=["eng"],
)
try:
    resp = s.general.partition(req)
    print(json.dumps(resp.elements[:3], indent=2))
except SDKError as e:
    print(e)
JSON(json.dumps(resp.elements, indent=2))

输出如下:

[
  {
    "type": "Title",
    "element_id": "826446fa7830f0352c88808f40b0cc9b",
    "text": "B All Experimental Results",
    "metadata": {
      "filetype": "application/pdf",
      "languages": [
        "eng"
      ],
      "page_number": 1,
      "filename": "CoT.pdf"
    }
  },
  {
    "type": "NarrativeText",
    "element_id": "055f2fa97fbdee35766495a3452ebd9d",
    "text": "This section contains tables for experimental results for varying models and model sizes, on all benchmarks, for standard prompting vs. chain-of-thought prompting.",
    "metadata": {
      "filetype": "application/pdf",
      "languages": [
        "eng"
      ],
      "page_number": 1,
      "parent_id": "826446fa7830f0352c88808f40b0cc9b",
      "filename": "CoT.pdf"
    }
  },
  {
    "type": "NarrativeText",
    "element_id": "9bf5af5255b80aace01b2da84ea86531",
    "text": "For the arithmetic reasoning benchmarks, some chains of thought (along with the equations produced) were correct, except the model performed an arithmetic operation incorrectly. A similar observation was made in Cobbe et al. (2021). Hence, we can further add a Python program as an external calculator (using the Python eval function) to all the equations in the generated chain of thought. When there are multiple equations in a chain of thought, we propagate the external calculator results from one equation to the following equations via string matching. As shown in Table 1, we see that adding a calculator significantly boosts performance of chain-of-thought prompting on most tasks.",
    "metadata": {
      "filetype": "application/pdf",
      "languages": [
        "eng"
      ],
      "page_number": 1,
      "parent_id": "826446fa7830f0352c88808f40b0cc9b",
      "filename": "CoT.pdf"
    }
  },
  {
    "type": "NarrativeText",
    "element_id": "46381dc72867b437cb990fc7734840ee",
    "text": "Table 1: Chain of thought prompting outperforms standard prompting for various large language models on five arithmetic reasoning benchmarks. All metrics are accuracy (%). Ext. calc.: post-hoc external calculator for arithmetic computations only. Prior best numbers are from the following. a: Cobbe et al. (2021). b & e: Pi et al. (2022), c: Lan et al. (2021), d: Pi˛ekos et al. (2021).",
    "metadata": {
      "filetype": "application/pdf",
      "languages": [
        "eng"
      ],
      "page_number": 1,
      "parent_id": "826446fa7830f0352c88808f40b0cc9b",
      "filename": "CoT.pdf"
    }
  },
  {
    "type": "Table",
    "element_id": "3d22e4ba38f71ed038e9a72e4e8e225d",
    "text": "Prior best Prompting N/A (finetuning) 55a GSM8K SVAMP ASDiv 57.4b 75.3c AQuA 37.9d MAWPS 88.4e UL2 20B Standard Chain of thought 4.4 (+0.3) + ext. calc 4.1 6.9 10.1 12.5 (+2.4) 16.9 (+0.9) 23.6 (+3.1) 28.3 16.0 20.5 34.3 23.6 16.6 19.1 (+2.5) 42.7 LaMDA 137B Standard Chain of thought 14.3 (+7.8) + ext. calc 6.5 17.8 29.5 37.5 (+8.0) 46.6 (+6.5) 20.6 (-4.9) 42.1 40.1 25.5 53.4 20.6 43.2 57.9 (+14.7) 69.3 GPT-3 175B (text-davinci-002) Chain of thought 46.9 (+31.3) 68.9 (+3.2) 71.3 (+1.0) 35.8 (+11.0) 87.1 (+14.4) Standard 15.6 65.7 70.3 24.8 72.7 + ext. calc 49.6 70.3 71.1 35.8 87.5 Codex (code-davinci-002) Chain of thought 63.1 (+43.4) 76.4 (+6.5) 80.4 (+6.4) 45.3 (+15.8) 92.6 (+13.9) Standard 19.7 69.9 74.0 29.5 78.7 + ext. calc 65.4 77.0 80.0 45.3 93.3 PaLM 540B Standard Chain of thought 56.9 (+39.0) 79.0 (+9.6) 73.9 (+1.8) 35.8 (+10.6) 93.3 (+14.2) + ext. calc 17.9 69.4 72.1 25.2 79.2 79.8 58.6 72.6 35.8 93.5",
    "metadata": {
      "text_as_html": "<table><thead><tr><th></th><th>Prompting</th><th>GSMBK</th><th>SVAMP</th><th>ASDiv</th><th>AQUA</th><th>MAWPS</th></tr></thead><tbody><tr><td>Prior best</td><td>(finetuning)</td><td>55¢</td><td>57.4°</td><td>75.3¢</td><td>37.9¢</td><td>88.4¢</td></tr><tr><td rowspan=\"3\">UL2 20B</td><td>Standard</td><td>4.1</td><td>10.1</td><td>16.0</td><td>20.5</td><td>16.6</td></tr><tr><td>Chain of thought</td><td>4.4 (+0.3)</td><td>12.5 2.4</td><td>16.9 (+0.9)</td><td>23.6 (+3.1)</td><td>19.1 (2.5</td></tr><tr><td>+ ext. cale</td><td>.9</td><td>283</td><td>343</td><td>23.6</td><td>4.7</td></tr><tr><td rowspan=\"3\">LaMDA 137B</td><td>Standard</td><td>6.5</td><td>29.5</td><td>40.1</td><td>25.5</td><td>432</td></tr><tr><td>Chain of thought</td><td>14.3 (+7.8)</td><td>37.5 +8.0)</td><td>46.6 (+6.5)</td><td>20.6 (-4.9)</td><td>57.9 (+14.7)</td></tr><tr><td>+ ext. cale</td><td>78</td><td>42.</td><td>534</td><td>20.6</td><td>69.3</td></tr><tr><td>GPT-3 175B</td><td>Standard</td><td>15.6</td><td>65.7</td><td>70.3</td><td>24.8</td><td>72.7</td></tr><tr><td rowspan=\"2\">(text-davinci-002)</td><td>Chain of thought</td><td>46.9 (+31.3)</td><td>68.9 +3.2)</td><td>71.3 (+1.0)</td><td>35.8 (+11.0)</td><td>87.1 (+14.4)</td></tr><tr><td>+ ext. cale</td><td>49.6</td><td>0.3</td><td>71.1</td><td>358</td><td>875</td></tr><tr><td>Codex</td><td>Standard</td><td>19.7</td><td>69.9</td><td>74.0</td><td>29.5</td><td>8.7</td></tr><tr><td rowspan=\"2\">(code-davinci-002)</td><td>Chain of thought</td><td>63.1 (+434)</td><td>76.4 (+6.5)</td><td>80.4 (+6.4)</td><td>45.3 (+15.8)</td><td>92.6 (+13.9)</td></tr><tr><td>+ ext. cale</td><td>65.4</td><td>77.0</td><td>80.0</td><td>453</td><td>933</td></tr><tr><td rowspan=\"3\">PalLM 540B</td><td>Standard</td><td>17.9</td><td>69.4</td><td>72.1</td><td>252</td><td>79.2</td></tr><tr><td>Chain of thought</td><td>56.9 +39.0)</td><td>79.0 (+9.6)</td><td>73.9 (+1.8)</td><td>35.8 (+10.6)</td><td>93.3 (+142)</td></tr><tr><td>+ ext. cale</td><td>58.6</td><td>79.8</td><td>726</td><td>358</td><td>935</td></tr></tbody></table>",
      "filetype": "application/pdf",
      "languages": [
        "eng"
      ],
      "page_number": 1,
      "parent_id": "826446fa7830f0352c88808f40b0cc9b",
      "filename": "CoT.pdf"
    }
  },
  {
    "type": "PageNumber",
    "element_id": "0301f13983c12f215df253d2e16300d0",
    "text": "20",
    "metadata": {
      "filetype": "application/pdf",
      "languages": [
        "eng"
      ],
      "page_number": 1,
      "filename": "CoT.pdf"
    }
  }
]

4.总结

上述案例可以实现对非机构化文档的标准化,随后就可以对数据进行愉快的处理了。课程具体学习地址见参考链接1。

参考

  1. Preprocessing Unstructured Data for LLM Applications
  2. https://unstructured.io/

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1912207.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Redis-Jedis连接池\RedisTemplate\StringRedisTemplate

Redis-Jedis连接池\RedisTemplate\StringRedisTemplate 1. Jedis连接池1.1 通过工具类1.1.1 连接池&#xff1a;JedisConnectionFactory&#xff1a;1.1.2 test&#xff1a;&#xff08;代码其实只有连接池那里改变了&#xff09; 2. SpringDataRedis&#xff08;lettuce&#…

洛谷 数学进制 7.9

P1100 高低位交换 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn) 代码一 #include<bits/stdc.h> using namespace std; typedef long long ll; #define IOS ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)const ll N1e510; char a[N];int main() {IOS;ll a;int b[32]…

【分布式系统】ceph部署(命令+截图巨详细版)

目录 一.存储概述 1.单机存储设备 2.单机存储的问题 3.商业存储 4.分布式存储​编辑 4.1.什么是分布式存储 4.2.分布式存储的类型 二.ceph概述 1.ceph优点 2.ceph架构 3.ceph核心组件 4.OSD存储后端 5.ceph数据存储过程 6.ceph版本发行生命周期 7.ceph集群部署 …

用ce修改植物大战僵尸杂交版银币

第一步打开游戏 用ce打开图中进程 第二步 输入你原始银币 点首次搜索 第三步 找到这个地址 把地址拖下来 第四步 双击直接修改下面数值即可 金币 钻石 都和这个方法一样 不一样的是首次搜索可能会有很多地址 我们改变游戏里面的值 然后再次搜索游戏被改变的值即可准确找到地址

降Compose十八掌之『见龙在田』| Modifier

公众号「稀有猿诉」 原文链接 降Compose十八掌之『见龙在田』| Modifier 通过前面的文章我们学会了如何使用元素来构建和填充我们的UI页面&#xff0c;但这只完成了一半&#xff0c;元素还需要装饰&#xff0c;以及进行动画和事件响应&#xff0c;这才能生成完整的UI。这…

遍历请求后端数据引出的数组forEach异步操作的坑

有一个列表数据&#xff0c;每项数据里有一个额外的字段需要去调另外一个接口才能拿到&#xff0c;后端有现有的这2个接口&#xff0c;现在临时需要前端显示出来&#xff0c;所以这里需要前端先去调列表数据的接口拿到列表数据&#xff0c;然后再遍历请求另外一个接口去拿到对应…

C++|异常

目录 一、异常概念 二、异常使用 2.1异常的抛出与捕获 2.2异常的重新抛出 2.3异常安全注意事项 2.4异常规范 三、自定义异常体系 四、C标准库的异常体系 五、异常的优缺点 对于传统的错误处理机制&#xff0c;例如c语言常用的&#xff1a; 1.assert&#xff0c;捕获到…

社区6月月报 | Apache DolphinScheduler重要修复和优化记录

各位热爱Apache DolphinScheduler的小伙伴们&#xff0c;社区6月月报更新啦&#xff01;这里将记录Apache DolphinScheduler社区每月的重要更新&#xff0c;欢迎关注。 月度Merge Stars 感谢以下小伙伴上个月为Apache DolphinScheduler所做的精彩贡献&#xff08;排名不分先后…

过滤器与拦截器区别、应用场景介绍

我们在进行 Web 应用开发时&#xff0c;时常需要对请求进行拦截或处理&#xff0c;故 Spring 为我们提供了过滤器和拦截器来应对这种情况。 那么两者之间有什么不同呢&#xff1f;本文将详细讲解两者的区别和对应的使用场景。 过滤器 过滤器是一种在 Java Web 应用中用于处理…

2024-7-9 Windows NDK,Clion,C4droid 编译环境配置(基础|使用命令编译,非AndroidStudio),小白(记录)友好型教程

2024-7-9 Windows NDK,Clion,C4droid 编译环境配置(基础|使用命令编译),小白友好型 一直想使用NDK编译出lua库,然后进行开发.结果一直不成功,问题Bug出现了一堆(主要还是自己太菜,毕竟咱是编程散修一名>_<) NDK之前一直不会配置(直接用命令配置的那种,非AndroidStudio),一…

nvm下载

nvm下载 1.下载nvm安装包2.安装nvm3.修改settings.txt4.安装成功5.继续配置 下载nvm之前,你最好将你电脑上的node卸载掉,直接在winx中卸载就行 1.下载nvm安装包 https://github.com/coreybutler/nvm-windows/releases 2.安装nvm 3.修改settings.txt root: E:\nvm\install\nv…

哦华为仓颉语言

本来我不太想说的&#xff0c;奈何有不少粉丝提问提到了这语言&#xff0c;目前的情况我不透露太多&#xff0c;看过这课程C实现一门计算机编程语言到手撸虚拟机实战的懂的自然懂。 在互联网领域几乎大部分应用软件运行在X86 LINUX上居多&#xff0c;如果你有问题可以先学习这…

红酒的秘密配方:如何调配出个性化的口感?

在红酒的世界里&#xff0c;每一滴都蕴藏着大自然的秘密和酿酒师的匠心。那些令人陶醉的口感、迷人的色泽和香气&#xff0c;都是经过精心调配和时光酝酿的结果。今天&#xff0c;就让我们一起揭开红酒调配的神秘面纱&#xff0c;探索如何调配出个性化的口感&#xff0c;感受雷…

大语言模型垂直化训练技术与应用

在人工智能领域&#xff0c;大语言模型&#xff08;Large Language Models, LLMs&#xff09;已经成为推动技术进步的关键力量&#xff0c;垂直化训练技术逐渐成为研究的热点&#xff0c;它使得大模型能够更精准地服务于特定行业和应用场景。本文结合达观数据的分享&#xff0c…

C++·模板进阶

1. 非类型模板参数 之前我们写的模板参数都设定class类型的&#xff0c;这个模板参数用来给下面的代码中的某些元素定义类型&#xff0c;我们管这种模板参数叫类型形参。非类型模板参数就是用一个常量作为模板的一个参数&#xff0c;在模板中可将该参数当作常量来使用&#xff…

RT2-使用NLP的方式去训练机器人控制器

目标 研究在网络数据上训练的视觉语言模型也可以直接结合到端到端的机器人控制中&#xff0c;提升泛化性以及获得突出的语义推理&#xff1b;使得单个的端到端训练模型可以同时学习从机器人观测到动作的映射&#xff0c;这个过程可以受益于基于网络上的语言和视觉语言数据的预训…

Python函数 之 函数基础

print() 在控制台输出 input() 获取控制台输⼊的内容 type() 获取变量的数据类型 len() 获取容器的⻓度 (元素的个数) range() ⽣成⼀个序列[0, n) 以上都是我们学过的函数&#xff0c;函数可以实现⼀个特定的功能。我们将学习⾃⼰如何定义函数, 实现特定的功能。 1.函数是什么…

C++进阶:继承和多态

文章目录 ❤️继承&#x1fa77;继承与友元&#x1f9e1;继承和静态成员&#x1f49b;菱形继承及菱形虚拟继承&#x1f49a;继承和组合 ❤️多态&#x1fa77;什么是多态&#xff1f;&#x1f9e1;多态的定义以及实现&#x1f49b;虚函数&#x1f49a;虚函数的重写&#x1f499…

如何借助社交媒体影响者的力量,让品牌影响力倍增?

一、引言&#xff1a;为何社交媒体影响者如此关键&#xff1f; 在信息爆炸的今天&#xff0c;社交媒体已成为塑造消费者行为与品牌认知的重要渠道。社交媒体影响者&#xff0c;凭借其在特定领域的专业知识、庞大的粉丝基础及高度的互动性&#xff0c;成为了品牌传播不可忽视的…

JVM原理(二四):JVM虚拟机锁优化

高效并发是从JDK 5升级到JDK 6后一项重要的改进项&#xff0c;HotSpot虛 拟机开发团队在这个版本上花费了大量的资源去实现各种锁优化技术&#xff0c;如适应性自旋( Adaptive Spinning)、锁消除( Lock Elimination)、锁膨胀(Lock Coarsening)、轻量级锁(Lightweight Locking)、…