
Research
Malicious npm Package Brand-Squats TanStack to Exfiltrate Environment Variables
A brand-squatted TanStack npm package used postinstall scripts to steal .env files and exfiltrate developer secrets to an attacker-controlled endpoint.
github.com/DengBoCong/nlp-dialogue
Advanced tools
开放域生成问答模型 Leveraging Passage Retrieval with Generative Models for Open Domain Question Answerin
检索 Dense Passage Retrieval for Open-Domain Question Answering
APScheduler
一个能够部署执行的全流程对话系统
本项目奔着构建一个能够在线部署对话系统,同时包含开放域和面向任务型两种对话系统,针对相关模型进行复现,论文阅读笔记放置另一个项目:nlp-paper,项目中使用TensorFlow和Pytorch进行实现。
仓库中的data目录下放着各语料的玩具数据,可用于验证系统执行性,完整语料以及Paper可以在这里查看
python actuator.py --version [Options] --model [Options] ...
--version、--model和--act为必传参数,其中--version为代码版本tf/torch,--model为执行对应的模型transformer/smn...,而act为执行模式(缺省状态下为pre_treat模式),更详细指令参数参见各模型下的actuator.py或config目录下的对应json配置文件。--act执行模式说明如下:
SMN检索式对话系统使用前需要准备solr环境,solr部署系统环境推荐Linux,工具推荐使用容器部署(推荐Docker),并准备:
以下提供简要说明,更详细可参见文章:搞定检索式对话系统的候选response检索--使用pysolr调用Solr
需要保证solr在线上运行稳定,以及方便后续维护,请使用DockerFile进行部署,DockerFile获取地址:docker-solr
仅测试模型使用,可使用如下最简构建指令:
docker pull solr:8.6.3
# 然后启动solr
docker run -itd --name solr -p 8983:8983 solr:8.6.3
# 然后创建core核心选择器,这里取名smn(可选)
docker exec -it --user=solr solr bin/solr create_core -c smn
关于solr中分词工具有IK Analyzer、Smartcn、拼音分词器等等,需要下载对应jar,然后在Solr核心配置文件managed-schema中添加配置。
特别说明:如果使用TF-IDF,还需要在managed-schema中开启相似度配置。
线上部署好Solr之后,在Python中使用pysolr进行连接使用:
pip install pysolr
添加索引数据(一般需要先安全检查)方式如下。将回复数据添加索引,responses是一个json,形式如:[{},{},{},...],里面每个对象构建按照你回复的需求即可:
solr = pysolr.Solr(url=solr_server, always_commit=True, timeout=10)
# 安全检查
solr.ping()
solr.add(docs=responses)
查询方式如下,以TF-IDF查询所有语句query语句方式如下:
{!func}sum(product(idf(utterance,key1),tf(utterance,key1),product(idf(utterance,key2),tf(utterance,key2),...)
使用前需要先将数据添加至Solr,在本SMN模型中使用,先执行pre_treat模式即可。
Licensed under the Apache License, Version 2.0. Copyright 2021 DengBoCong. Copy of the license.
FAQs
Unknown package
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
A brand-squatted TanStack npm package used postinstall scripts to steal .env files and exfiltrate developer secrets to an attacker-controlled endpoint.

Research
Compromised SAP CAP npm packages download and execute unverified binaries, creating urgent supply chain risk for affected developers and CI/CD environments.

Company News
Socket has acquired Secure Annex to expand extension security across browsers, IDEs, and AI tools.