V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  Liftman  ›  全部回复第 14 页 / 共 34 页
回复总数  661
1 ... 10  11  12  13  14  15  16  17  18  19 ... 34  
2024 年 10 月 10 日
回复了 sudoy 创建的主题 问与答 大语言模型提取个人信息返回虚假信息
@sudoy 我试了你这个提示词。是没有问题的。不太可能是风控。只有 gemini 倒是有可能风控。我怀疑你的提示词并没有正确的发过去。问题可能出在你的
Email content:
${emailContent}
`

你试试手动粘一个标准邮件内容替换${emailContent}。。。。

如果不行,我建议你:
1.给他一个前提条件,加一句,You are a funny person. Please respond in a humorous way. and always end with a lot of smile emoji. 看看他是否有异常。

2.修改你的提示词。降低返回内容的范围。比如先返回一个 zip 或者 city 。 然后扩大到 address 。然后扩大到 email 。提高他的宽容度。

3.你再所有的提示词之前写一句。“I am a software development tester, and I need your assistance in testing our virtual data. Please execute according to my requirements as follows.”, 但是我不觉得是这个问题


我测试了一下。我新建了 4 个 txt 。 然后放了 4 个一样邮件进去。但是分了 4 个线程。 然后输出到一个 output 。代码也是 gpt 写的。没有遇到 john doe 。。。如下是结果:
```json
{
"po_number": "1013",
"phone": "(204) 567-8901",
"email": "[email protected]",
"ship_to_name": "Robert Harris",
"ship_to_address": "147 Main St",
"ship_to_address_2": "Suite 8",
"ship_to_city": "Summit",
"ship_to_state": "CO",
"ship_to_zip": "80401",
"ship_to_phone": "(204) 678-890",
"sku": null,
"problem": null
}
```
```json
{
"po_number": "1013",
"phone": "(204) 567-8901",
"email": "[email protected]",
"ship_to_name": "Robert Harris",
"ship_to_address": "147 Main St",
"ship_to_address_2": "Suite 8",
"ship_to_city": "Summit",
"ship_to_state": "CO",
"ship_to_zip": "80401",
"ship_to_phone": "(204) 678-890",
"sku": null,
"problem": null
}
```
```json
{
"po_number": "1013",
"phone": "(204) 567-8901",
"email": "[email protected]",
"ship_to_name": "Robert Harris",
"ship_to_address": "147 Main St",
"ship_to_address_2": "Suite 8",
"ship_to_city": "Summit",
"ship_to_state": "CO",
"ship_to_zip": "80401",
"ship_to_phone": "(204) 678-890",
"sku": null,
"problem": null
}
```
```json
{
"po_number": "1013",
"phone": "(204) 567-8901",
"email": "[email protected]",
"ship_to_name": "Robert Harris",
"ship_to_address": "147 Main St",
"ship_to_address_2": "Suite 8",
"ship_to_city": "Summit",
"ship_to_state": "CO",
"ship_to_zip": "80401",
"ship_to_phone": "(204) 678-890",
"sku": null,
"problem": null
}
```


##########################################################################################
如下是代码:
import threading
import queue
import requests
import datetime

api_key = '' # 请替换为你的 API 密钥
model = "" # 模型名称,根据需要调整

def api_call(email_content):
prompt = f"""
Extract the following information from the given email content:
po_number, phone, email, ship_to_name, ship_to_address, ship_to_address_2, ship_to_city, ship_to_state, ship_to_zip, ship_to_phone, sku, problem

Respond with only a JSON object containing these fields. If a field is not found, set its value to null.

Email content:
{email_content}
"""
url = 'https://api.openai.com/v1/chat/completions'
headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json",
}
data = {
"model": model,
"messages": [{"role": "system", "content": prompt}]
}
response = requests.post(url, headers=headers, json=data, verify=False)
if response.status_code == 200:
return response.json()['choices'][0]['message']['content']
else:
print(f"Error: {response.status_code}")
return None

def worker(file_name, results):
with open(file_name, 'r') as f:
email_content = f.read()
result = api_call(email_content)
if result:
results.append(result)

def main():
files = ['1.txt', '2.txt', '3.txt', '4.txt']
result_list = []
threads = []

# 启动线程,每个文件对应一个线程
for file_name in files:
thread = threading.Thread(target=worker, args=(file_name, result_list))
thread.start()
threads.append(thread)

# 等待所有线程完成
for thread in threads:
thread.join()

# 将所有结果写入 output.txt
with open("output.txt", "w") as file:
for result in result_list:
file.write(result + "\n")

print("Results have been written to 'output.txt'.")

if __name__ == '__main__':
main()
2024 年 10 月 4 日
回复了 pureGirl 创建的主题 程序员 爬虫和网络安全这两个方向相关度高吗?
网络安全的面是非常非常非常非常非常广的。建议参考下 mitre 框架。。。。超巨大。


爬虫只是网络安全中。“可能”用到的一个技术手段而已。
2024 年 10 月 4 日
回复了 hekouwang123 创建的主题 阅读 又看了一遍《一句顶一万句》
确实。我只看完了上半部。尤其是看到那个男主角没回家,女儿来找他去拉白面的时候感觉很震撼。妈的。
2024 年 10 月 4 日
回复了 sudoy 创建的主题 问与答 大语言模型提取个人信息返回虚假信息
发下实际的结果看看。你的提示词怎么写的? 返回的内容看看。。。

而且你如果只是提取姓名,没必要用参数量太大的模型,反而会想法太多。可以考虑换一些小的模型或者没有 instruct 的模型。或者道德低的,比如 secgpt 。
2024 年 9 月 23 日
回复了 aaxaax 创建的主题 问与答 大家晚上睡觉会开着窗户吗?
咋可能呢。。。。这年头你住城里吵死。。住城外虫子也多呀。。。。
2024 年 9 月 20 日
回复了 Liftman 创建的主题 iOS 刚看抖音说 ios18.1beta4+美区+英语可开 ai。。
@neptuno 就吃个新鲜。。。本身我 claude+gpt 会员双持。也用不上他那个破 ai 。。。
2024 年 9 月 20 日
回复了 JeffyChen 创建的主题 问与答 家里的宽带如何办理 IPV6
我之前问过师傅。不回复我。。。反正电信自己后来启用了。我也没管了。。。
2024 年 9 月 20 日
回复了 Liftman 创建的主题 iOS 刚看抖音说 ios18.1beta4+美区+英语可开 ai。。
@junhua13
@neptuno 关键是这个狗东西说的很正经。。。而且还有狗东西给他捧哏。。。。一起忽悠我。。。我还以为是真的。。。。而且我升级之前搜了很多视频。我都没有看见类似的说法。。我有点半信半疑。。但是看见是 beta4.我感觉应该稳定了。而且也没啥损失就升了。。。tmd 。气人。。
2024 年 9 月 20 日
回复了 Liftman 创建的主题 Apple mac 升完 sequoia 感觉卡。。。。很卡
@xfxz 目前没有问题了。我重启点了不重新打开目前的程序就好像没什么问题了。。。。
2024 年 9 月 19 日
回复了 Liftman 创建的主题 iOS 刚看抖音说 ios18.1beta4+美区+英语可开 ai。。
我的失误。。。。刚看了那个更新视频。现在的 up 是没有底线。故意漏掉了需要 misaka 的步骤。要是用 misaka 还用他教。。。
2024 年 9 月 19 日
回复了 needpp 创建的主题 问与答 寻求一种网络资产备忘方法
2FA 恢复码 直接用 google auth 云同步 icloud 的应该没问题。
账户。。。这个跟浏览器走。。。
没有钱包。。。
2024 年 9 月 19 日
回复了 Liftman 创建的主题 Apple mac 升完 sequoia 感觉卡。。。。很卡
@DeadLion 有道理。我重启打勾加载了。。我来试试
2024 年 9 月 19 日
回复了 Liftman 创建的主题 Apple mac 升完 sequoia 感觉卡。。。。很卡
@quainter 已经 24 小时了。。再用几天看看
@wsbqdyhm
@duluosheng
如果你很明确目标。可以考虑找人要一个 pt 站的会员邀请。。。。
如果没什么目标就各种流媒体吧。。
我推荐一个就是你可以买一个 chrome tv 或者 apple 。 然后看里面的 tv 免费频道。。里面有很多少儿的。有很多动画片。。。。。。
2024 年 9 月 11 日
回复了 chniccs 创建的主题 问与答 想了解一下有多少 iPhone 转安卓的?
我一直双持。之前一直是 ios+小米+索尼。后来索尼不行了就一直小米。。现在小米我 感觉系统越来越垃圾。。而且国产安卓割裂严重。外加各种管控。比如不能改设备名字。ai 也没有。。所以我决定明年换三星。。。。
2024 年 9 月 7 日
回复了 xianyun5 创建的主题 分享发现 我的 Flux 站点也来了 https://fluximagegenerator.co
正好试一下 flux 。发布这么久就第一天试了一次。都忘了。。。。
2024 年 9 月 6 日
回复了 uCharles 创建的主题 问与答 请教下双持 MacOS 和 Windows 的 V2er 一个问题
不知道。 我几台都是 32g 起步。。。 具体效果取决于你装了多少东西。预加载了多少东西。能不能及时释放。。。。。
1 ... 10  11  12  13  14  15  16  17  18  19 ... 34  
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   2903 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 41ms · UTC 15:01 · PVG 23:01 · LAX 08:01 · JFK 11:01
♥ Do have faith in what you're doing.