JRQZ
  • 关于
  • 碎片时间
  • 自用笔记

自用笔记

九月 14, 2024

Doccano自动标注配置

开源自动标注工具Doccano,项目地址https://github.com/doccano/doccano 官方教程:https://doccano.github.io/doccano/ 支持jsonl格式文件导入导出,支持REST API自动标注 自动标注api参考: https://blog.csdn.net/weixin_44826203/article/details/125719480 遇到的问题: 无法正确设置自动标注api 原因是当前版本accano前端有bug,参考https://github.com/doccano/doccano/issues/2281 可通过访问http://x.x.x.x:8000/admin/进入Django管理界面手动配置 Model attrs:{"url": "http://x.x.x.x:5739", "body": {"text": "{{ text }}"}, "method": "POST", "params": {}, "headers": {}} Template:[ {% for entity in input %} { "start_offset": {{ entity.start_offset }}, "end_offset": {{ entity.end_offset}}, "label": "{{ entity.label }}" }{% if not loop.last %},{% endif %} {% endfor %} ] Label mapping:{"label1":"match label","label2":"match label2"} # lable1: you config labels_span name # match label: interface return entity class name 正确配置后,api后台可以收到数据并正常处理,但是accanno前台不能自动标注,原因不明,要么是相关参数没有正确配置(由于accano前端写得真不太行,难以在web界面上排查),要么是accano没有收到返回的数据
继续阅读
九月 14, 2024

Django_Nginx_uWSGI配置

Django是一个开源的Web应用框架,由Python写成 Nginx是一个开源的高性能HTTP服务器和反向代理服务器 uWSGI是一个Web服务器网关接口(Web Server Gateway Interface,简称WSGI)的实现,用于在Web服务器和Python web应用程序之间进行通信 参考: https://medium.com/bucketing/nginx-uwsgi-python-%E4%B9%8B%E9%97%9C%E8%81%AF-1-nginx%E7%AF%87-e0566f43c70b https://cloud.tencent.com/developer/article/1594840 niginx官方文档:https://nginx.org/en/docs/beginners_guide.html nginx和uWSGI区别: nginx和uWSGI都是web服务器,都可以用来部署django等服务 **nginx:**处理静态资源能力非常强,还可以提供 负载均衡、反向代理、攻击拦截等 **uWSGI:**单点部署,容易部署,性能差一些,可以支持的web协议多 uWSGI 和 uwsgi区别: **uWSGI:**是一个web服务器 **uwsgi:**是一种web协议 WSGI和uwsgi区别: uwsgi: 也是一种web协议,传输快(二进制存储,其他web协议都是字符串存储) WSGI: python专业的web协议 安装Django pip install Django ALLOWED_HOSTS = ['*'] 安装uwsgi 找不到libpython3.12.a文件 python版本问题 conda create -n django_env python=3.9 conda activate django_env conda install uwsgi 再次安装Django 安装Nginx yum install nginx 启动服务 systemctl start nginx systemctl restart nginx 此时访问服务器ip即可看到nginx页面 设置开机自启动 systemctl enable nginx 停止服务 systemctl stop nginx 配置Django django-admin startproject demosite cd demosite python manage.
继续阅读
九月 14, 2024

Linux服务器配置ES+Kibana

踩坑记录 依旧是参考官网教程:https://www.elastic.co/guide/en/elasticsearch/reference/current/run-elasticsearch-locally.html 准备 云服务器配置: 8核;16G;系统盘:100G;数据盘:500G TencentOS Server ES,Kibana分别部署在docker上 安装 安装docker,略 配置环境变量: export ELASTIC_PASSWORD="<ES_PASSWORD>" # password for "elastic" username export KIBANA_PASSWORD="<KIB_PASSWORD>" # Used _internally_ by Kibana, must be at least 6 characters long 安装es docker network create elastic-net docker run -p 0.0.0.0:9200:9200 -d --name elasticsearch --network elastic-net \ -e ELASTIC_PASSWORD=$ELASTIC_PASSWORD \ -e "discovery.type=single-node" \ -e "xpack.security.http.ssl.enabled=false" \ -e "xpack.license.self_generated.type=trial" \ docker.elastic.co/elasticsearch/elasticsearch:8.14.2 安装Kibana # configure the Kibana password in the ES container curl -u elastic:$ELASTIC_PASSWORD \ -X POST \ http://localhost:9200/_security/user/kibana_system/_password \ -d '{"password":"'"$KIBANA_PASSWORD"'"}' \ -H 'Content-Type: application/json' docker run -p 0.
继续阅读
  • ««
  • «
  • 1
  • 2
  • 3
  • 4
  • 5
  • »
  • »»
© JRQZ 2025