Azure 认知服务浅尝:徒然学会了抗拒热闹,却还来不及透悟真正的冷清;写个聊天机器人治愈自己吧

本文主要是介绍Azure 认知服务浅尝:徒然学会了抗拒热闹,却还来不及透悟真正的冷清;写个聊天机器人治愈自己吧,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

写在前面


  • 之前上学使用华为ModelArts平台做了类似的图像识别之类的小项目,零编码,但是需要自己搞数据集,标注、选择算法、训练模型等,用的话直接调API。
  • NLP方面之前的一个实习公司有用,对一些类似招股书文件数据进行核查的。那会我作为Java开发做些数据清洗的工作,调NLP的接口去识别一些表格,然后用java写一些逻辑,把数据的按要求分类整理上传。
  • 在之后工作中没有接触过,也没有学习过,但是对这方面蛮感兴趣的。基本算是小白,对NLP之类的算法也不懂,买了一本相关的书籍,也落灰了。看到这个活动,想学习学习,所以参加了。
  • 依旧,附上活动链接:https://bbs.csdn.net/topics/601636817

活动内容:使用Azure认知服务免费提供的AI服务(包括语音转文本、文本转语音、语音翻译、文本分析、文本翻译、语言理解)开发智能应用,并以博文形式分享使用上述服务(至少试用3项服务)教程以及自己的使用心得体验;

我徒然学会了抗拒热闹,却还来不及透悟真正的冷清。--------张大春


在使用之前我们需要先了解下相关概念

一、关于认知服务的一些基本概念和术语

什么是 Azure 认知服务?:

认知服务: 提供认知理解(看、听、说、理解,甚至可以决策的认知)功能的服务。

认知服务主要分为四大类:

  • 影像
  • 语音
  • 语言
  • 决策

Azure 认知服务是具有 REST API和客户端库 SDK基于云的服务,可用于帮助你将认知智能构建到应用程序中。 即使你没有人工智能 (AI) 或数据科学技能,也可向应用程序添加认知功能。Azure 认知服务包含各种 AI 服务,让你能够构建可以看、听、说、理解,甚至可以决策的认知解决方案。

我们要做一个可以和自己聊天的机器人,需要语言理解,即告诉机器人想说什么话,我们先看看这部分

二、什么是语言理解 (LUIS)?

语言理解 (LUIS) 是一种基于云的对话式 AI 服务,可在用户对话的自然语言文本中应用自定义机器学习智能,以便预测整体含义并提炼出相关的详细信息。 LUIS 通过其自定义门户、API 和 SDK 客户端库提供访问权限。找重点,会提炼出相关信息,换句话讲,就是把要表达的信息转化成机器或者说AI能够识别的信息。

1)、服务构建步骤

1、创建一个资源
使用Azure门户创建新资源
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
关于Azure 认知服务入门方面的教程,小伙伴可以移步官方文档 https://docs.azure.cn/zh-cn/cognitive-services/cognitive-services-apis-create-account?tabs=multiservice%2Cwindows
2、服务应用构建
步骤
登录到LUIS门户
在这里插入图片描述
创建新应用
在这里插入图片描述
在这里插入图片描述
生成模型
添加意向,即你要说些什么话,即语料,这个随便写点
在这里插入图片描述
添加13-15个
在这里插入图片描述
添加实体
在这里插入图片描述
使用预构建的模型,这里我们全都选择了,上面的2步应该就是生成这个,类似模板
在这里插入图片描述
训练模型
在这里插入图片描述
发布模型
在这里插入图片描述
查看信息
在这里插入图片描述
3、发布应用服务测试,使用python脚本调用接口

########### Python 3.6 ##############
# This quickstart shows how to predict the intent of an utterance by using the LUIS REST APIs.
# 导入模块
import requeststry:########### Values to modify.# YOUR-APP-ID: The App ID GUID found on the www.luis.ai Application Settings page.# 替换为自己的APP-IDappId = '949d3538-07df-4149-bee8-83dc7f4e11bd'# YOUR-PREDICTION-KEY: Your LUIS prediction key, 32 character value.prediction_key = '24440ef2829c45f0**61599ee00b496a'# YOUR-PREDICTION-ENDPOINT: Replace with your prediction endpoint.# For example, "https://westus.api.cognitive.microsoft.com/"prediction_endpoint = 'https://chatbot0.cognitiveservices.azure.cn/'# The utterance you want to use.# 你想和他说的话..utterance = '一个人怎么生活?'########### The headers to use in this REST call.headers = {}# The URL parameters to use in this REST call.params ={'query': utterance,'timezoneOffset': '0','verbose': 'true','show-all-intents': 'true','spellCheck': 'false','staging': 'false','subscription-key': prediction_key}# Make the REST call.response = requests.get(f'{prediction_endpoint}luis/prediction/v3.0/apps/{appId}/slots/production/predict', headers=headers, params=params)# Display the results on the console.print(response.json())except Exception as e:# Display the error string.print(f'{e}')

这里我们用docker搞一个python环境,然后执行一下脚本,测试一下

┌──[root@liruilongs.github.io]-[/liruilong]
└─$ docker pull centos/python-36-centos7
┌──[root@liruilongs.github.io]-[/liruilong]
└─$ ls
input  luis_run.sh  output  predict.py
┌──[root@liruilongs.github.io]-[/liruilong]
└─$ docker run --rm -it  --name=chatbot -v $PWD/predict.py:/predict.py centos/python-36-centos7  /bin/bash
(app-root) cd /
(app-root) ls
anaconda-post.log  bin  boot  dev  etc  help.1  home  lib  lib64  media  mnt  opt  predict.py  proc  root  run  sbin  srv  sys  tmp  usr  var
(app-root) python predict.py
Traceback (most recent call last):File "predict.py", line 6, in <module>import requests
ModuleNotFoundError: No module named 'requests'
(app-root) pip install requests
.........................
Collecting requestsDownloading https:/.....
(app-root) python predict.py
{'query': '一个人怎么生活?', 'prediction':{'topIntent': '生活加油', 'intents': {'生活加油': {'score': 0.8969882}, 'Calendar.ShowNext': {'score': 0.58274937}, 'Calendar.FindCalendarWhen': {'score': 0.25383785}, 'Places.GetReviews': {'score': 0.24764298}, 'Utilities.ReadAloud': {'score': 0.20971665}, 'HomeAutomation.QueryState': {'score': 0.15509635}, 'Calendar.CheckAvailability': {'score': 0.12212229}, 'Places.GetPriceRange': {'score': 0.122063436},........

测试成功 :predict.py脚本

2)、本地部署服务,启动和运行

1、 LUIS环境准备
进入资源
在这里插入图片描述
按照部署要求一步步构建
在这里插入图片描述
拉取镜像
在这里插入图片描述
最好找个镜像加速器配置一下,要不太慢了
2、安装并运行 LUIS 的 Docker 容器
运行步骤
必需的参数:所有认知服务容器都需要三个主要参数。 最终用户许可协议 (EULA) 的值必须为 accept。 此外,终结点URLAPI密钥都是必需的。
在这里插入图片描述

运行 LUIS 的 Docker 容器

┌──[root@liruilongs.github.io]-[/liruilong]
└─$ mkdir input output
┌──[root@liruilongs.github.io]-[/liruilong]
└─$ ls
input  luis_run.sh  output
┌──[root@liruilongs.github.io]-[/liruilong]
└─$ cat luis_run.sh
docker run --rm -it -p 5000:5000 --memory 4g --cpus 2 -v $PWD/input:/input -v $PWD/output:/output mcr.microsoft.com/azure-cognitive-services/language/luis Eula=accept Billing=https://chatbot0.cognitiveservices.azure.cn/ ApiKey=24440ef2829c45f0**61599ee00b496a  ##这里参数填自己的
┌──[root@liruilongs.github.io]-[/liruilong]
└─$ docker run --rm -it -p 5000:5000 --memory 4g --cpus 2 -v $PWD/input:/input -v $PWD/output:/output mcr.microsoft.com/azure-cognitive-services/language/luis Eula=accept Billing=https://chatbot0.cognitiveservices.azure.cn/ ApiKey=24440ef2829c45f0a**1599ee00b496a  ## 启动容器EULA Notice: Copyright © Microsoft Corporation 2020. This Cognitive Services Container image is made available to you under the terms [https://go.microsoft.com/fwlink/?linkid=2018657] governing your subscription to Microsoft Azure Services (including the Online Services Terms [https://go.microsoft.com/fwlink/?linkid=2018760]). If you do not have a valid Azure subscription, then you may not use this container.Using '/input' for reading models and other read-only data.
Using '/output/luis/ff2a18ee78a1' for writing logs and other output data.
Logging to console.
Submitting metering to 'https://chatbot0.cognitiveservices.azure.cn/'.
warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]No XML encryptor configured. Key {d826e89b-febe-4b93-bad8-db07cb994012} may be persisted to storage in unencrypted form.
warn: Microsoft.AspNetCore.Server.Kestrel[0]Overriding address(es) 'http://+:80'. Binding to endpoints defined in UseKestrel() instead.
Hosting environment: Production
Content root path: /app
Now listening on: http://0.0.0.0:5000
Application started. Press Ctrl+C to shut down.
测试
在这里插入图片描述
查看接口API
在这里插入图片描述
在这里插入图片描述

应用包上传,放到input文件夹下

┌──(liruilong㉿Liruilong)-[/mnt/c/Users/lenovo/Downloads]
└─$ scp ./949d3538-07df-4149-bee8-83dc7f4e11bd_production.gz  root@192.168.26.55:/
949d3538-07df-4149-bee8-83dc7f4e11bd_production.gz                                    100% 6434KB  19.0MB/s   00:00

放到input文件夹下,启动容器

┌──[root@liruilongs.github.io]-[/]
└─$ cp 949d3538-07df-4149-bee8-83dc7f4e11bd_production.gz  /liruilong/input/
┌──[root@liruilongs.github.io]-[/]
└─$ cd /liruilong/input/
┌──[root@liruilongs.github.io]-[/liruilong/input]
└─$ ls
949d3538-07df-4149-bee8-83dc7f4e11bd_production.gz
┌──[root@liruilongs.github.io]-[/liruilong/input]
└─$ cd ..
┌──[root@liruilongs.github.io]-[/liruilong]
└─$ pwd
/liruilong
┌──[root@liruilongs.github.io]-[/liruilong]
└─$ # 启动容器服务┌──[root@liruilongs.github.io]-[/liruilong]
└─$ docker run --rm --name=demo  -it -p 5000:5000 --memory 4g --cpus 2 -v $PWD/input:/input -v $PWD/output:/output mcr.microsoft.com/azure-cognitive-services/language/luis Eula=accept Billing=https://chatbot0.cognitiveservices.azure.cn/ ApiKey=24440ef2829c45f0a**1599ee00b496aEULA Notice: Copyright © Microsoft Corporation 2020. This Cognitive Services Container image is made available to you under the terms [https://go.microsoft.com/fwlink/?linkid=2018657] governing your subscription to Microsoft Azure Services (including the Online Services Terms [https://go.microsoft.com/fwlink/?linkid=2018760]). If you do not have a valid Azure subscription, then you may not use this container.Using '/input' for reading models and other read-only data.
Using '/output/luis/da43b9631f9d' for writing logs and other output data.
Logging to console.
Submitting metering to 'https://chatbot0.cognitiveservices.azure.cn/'.
warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]No XML encryptor configured. Key {886021ff-6bf5-423d-be12-ba9b52383b9e} may be persisted to storage in unencrypted form.
warn: Microsoft.AspNetCore.Server.Kestrel[0]Overriding address(es) 'http://+:80'. Binding to endpoints defined in UseKestrel() instead.
Hosting environment: Production
Content root path: /app
Now listening on: http://0.0.0.0:5000
Application started. Press Ctrl+C to shut down.
文件名不对,需要改一下
在这里插入图片描述
用swagger测试一下
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

随便找一句测试一下:

据悉,该活动由世界休闲组织,杭州市政府主办,中国国际科技促进会三农发展工作委员会等联合会承办。

{"query": "据悉,该活动由世界休闲组织,杭州市政府主办,中国国际科技促进会三农发展工作委员会等联合会承办。","topScoringIntent": {"intent": "Places.GetPhoneNumber","score": 0.9103095},"entities": [{"entity": "工作","type": "Calendar.Subject","startIndex": 35,"endIndex": 36,"score": 0.63087225},{"entity": "际科技促进会三农发展工作委员会等联合会承办 。","type": "Note.Text","startIndex": 25,"endIndex": 46,"score": 0.6798551},{"entity": "杭州市","type": "Places.AbsoluteLocation","startIndex": 14,"endIndex": 16,"score": 0.966151536},{"entity": "国际科","type": "Places.PlaceName","startIndex": 24,"endIndex": 26,"score": 0.3605822},{"entity": "工作","type": "Calendar.DestinationCalendar","startIndex": 35,"endIndex": 36,"resolution": {"values": ["工作"]}},{"entity": "工作","type": "Places.OpenStatus","startIndex": 35,"endIndex": 36,"resolution": {"values": ["工作"]}},{"entity": "休闲","type": "RestaurantReservation.Atmosphere","startIndex": 9,"endIndex": 10,"resolution": {"values": ["休闲"]}}]
}

回过头看看语言理解的定义:

语言理解 (LUIS) 是一种基于云的对话式 AI 服务,可在用户对话的自然语言文本中应用自定义机器学习智能,以便预测整体含义并提炼出相关的详细信息。 LUIS 通过其自定义门户、API 和 SDK 客户端库提供访问权限。找重点,会提炼出相关信息,换句话讲,就是把要表达的信息转化成机器或者说AI能够识别的信息。

简单尝试一下,可以把生成的实体组合,作为关键字给类似图灵机器人用,进行简单对话,简单测试了下,发现效果很一般,可能方法不太对,或者我找的机器人太差了,Azure的机器人需要注册绑卡…所以这个以后有时间研究研究


额…聊天机器人没出写来,唐突了,没法治愈自己了 ^ _ ^

下面看看其他的认知服务,语音合成产品系列,我们现在聊天大都是语音,对于聊天机器人来说,需要把语音转化为文本。然后才是语言理解。

三、什么是语音转文本?

使用语音转文本(也称为语音识别)功能,可将音频流实时听录为文本。 应用程序、工具或设备可以使用、显示和处理此文本即命令输入

1)、服务构建:

1、创建一个资源
创建一个资源
在这里插入图片描述
在这里插入图片描述

2) JAVA开发环境准备,拉去github的Demo

这里我们使用过java的方式

Git :https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/quickstart/java/jre/from-microphone

步骤
克隆代码
在这里插入图片描述
在这里插入图片描述
导入项目

3)调用API测试

调用API测试
语音文件转文本
找了一首 梁静茹-我还记得 歌曲测试下,发现不行,可能还没这么智能,或者歌词太长了
在这里插入图片描述
麦克风转文本:大城小爱中的一句歌词识别:是妈妈告诉我的哲理 ===》妈妈告诉我,我的心里。应该是歌曲的原因,正常说话可以还是不错的,这里调硬件的代码直接封装好了,特别方便
在这里插入图片描述
在这里插入图片描述
package speechsdk.quickstart;import com.microsoft.cognitiveservices.speech.*;
import com.microsoft.cognitiveservices.speech.audio.AudioConfig;import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.Semaphore;import static com.microsoft.cognitiveservices.speech.ResultReason.*;/*** @Classname Program* @Description TODO* @Date 2021/10/30 13:58* @Created LiRuilong*/
public class Program {private static Semaphore stopTranslationWithFileSemaphore;public static void main(String[] args) throws InterruptedException, ExecutionException {SpeechConfig speechConfig = SpeechConfig.fromSubscription("eb48f918a90448fe***53633d6301ebb", "chinanorth2");speechConfig.setSpeechRecognitionLanguage("zh-cn");// 从文件中识别// SpeechRecognitionResult result =  fromFile(speechConfig);// 从麦克风识别SpeechRecognitionResult result =  fromMic(speechConfig);switch (result.getReason()) {case RecognizedSpeech:System.out.println("We recognized: " + result.getText());break;case NoMatch:System.out.println("NOMATCH: 无法识别语音.");break;case Canceled: {CancellationDetails cancellation = CancellationDetails.fromResult(result);System.out.println("CANCELED: Reason=" + cancellation.getReason());if (cancellation.getReason() == CancellationReason.Error) {System.out.println("CANCELED: ErrorCode=" + cancellation.getErrorCode());System.out.println("CANCELED: ErrorDetails=" + cancellation.getErrorDetails());System.out.println("CANCELED: Did you update the subscription info?");}}default:{};break;}}/*** @param speechConfig:* @return: void* @Description  从麦克风识别* @author LiRui long* @date  2021/11/1  18:30**/public static SpeechRecognitionResult  fromMic(SpeechConfig speechConfig) throws InterruptedException, ExecutionException {AudioConfig audioConfig = AudioConfig.fromDefaultMicrophoneInput();SpeechRecognizer recognizer = new SpeechRecognizer(speechConfig, audioConfig);System.out.println("对这麦克风说话.");Future<SpeechRecognitionResult> task = recognizer.recognizeOnceAsync();SpeechRecognitionResult result = task.get();return  result;}/*** @param speechConfig:* @return: com.microsoft.cognitiveservices.speech.SpeechRecognitionResult* @Description          从文件中识别* @author LiRui long* @date  2021/11/1  18:29**/public static SpeechRecognitionResult fromFile(SpeechConfig speechConfig) throws InterruptedException, ExecutionException {AudioConfig audioConfig = AudioConfig.fromWavFileInput("E:\\docker\\cognitive-services-speech-sdk\\quickstart\\java\\jre\\translate-speech-to-text\\src\\speechsdk\\quickstart\\梁静茹-我还记得.wav");SpeechRecognizer recognizer = new SpeechRecognizer(speechConfig, audioConfig);// First initialize the semaphore.stopTranslationWithFileSemaphore = new Semaphore(0);recognizer.recognizing.addEventListener((s, e) -> {System.out.println("RECOGNIZING: Text=" + e.getResult().getText());});recognizer.recognized.addEventListener((s, e) -> {if (e.getResult().getReason() == RecognizedSpeech) {System.out.println("RECOGNIZED: Text=" + e.getResult().getText());}else if (e.getResult().getReason() == NoMatch) {System.out.println("NOMATCH: Speech could not be recognized.");}});recognizer.canceled.addEventListener((s, e) -> {System.out.println("CANCELED: Reason=" + e.getReason());if (e.getReason() == CancellationReason.Error) {System.out.println("CANCELED: ErrorCode=" + e.getErrorCode());System.out.println("CANCELED: ErrorDetails=" + e.getErrorDetails());System.out.println("CANCELED: Did you update the subscription info?");}stopTranslationWithFileSemaphore.release();});recognizer.sessionStopped.addEventListener((s, e) -> {System.out.println("\n    Session stopped event.");stopTranslationWithFileSemaphore.release();});Future<SpeechRecognitionResult> task = recognizer.recognizeOnceAsync();SpeechRecognitionResult result = task.get();return  result;//System.out.println("RECOGNIZED: Text=" + result.getText());}}

四、什么是文本翻译

文本翻译是一种基于云的机器翻译服务,是 Azure 认知服务系列 REST API 的一部分。 翻译器可用于任何操作系统

1)、服务构建:

创建资源
在这里插入图片描述
在这里插入图片描述

2)Node环境调用API测试

这里我们用node环境来测试一下;

$ docker pull node
$ mkdir translateDemo;cd translateDemo
$ vim translateDemo.js

测试js准备

const axios = require('axios').default;
const { v4: uuidv4 } = require('uuid');let subscriptionKey = "3c6588c7026b41a4**7f81551cb4a737";
let endpoint = "https://api.translator.azure.cn/";let location = "chinanorth";axios({baseURL: endpoint,url: '/translate',method: 'post',headers: {'Ocp-Apim-Subscription-Key': subscriptionKey,'Ocp-Apim-Subscription-Region': location,'Content-type': 'application/json','X-ClientTraceId': uuidv4().toString()},params: {'api-version': '3.0','from': 'zh-Hans','to': ['zh-Hant', 'en']},data: [{'text': '我徒然学会了抗拒热闹,却还来不及透悟真正的冷清。--------张大春'}],responseType: 'json'
}).then(function(response){console.log(JSON.stringify(response.data, null, 4));
})

这里测试将 【我徒然学会了抗拒热闹,却还来不及透悟真正的冷清。--------张大春】中文简体翻译为中文繁体,英语。

┌──[root@liruilongs.github.io]-[~/translateDemo]
└─$ vim translateDemo.js
┌──[root@liruilongs.github.io]-[~/translateDemo]
└─$ docker run -it --rm --name=translateDemo -v $PWD/translateDemo.js:/root/translateDemo.js node:latest /bin/bash
root@35376c1c05d8:/# pwd
/
root@35376c1c05d8:/# cd root/;npm install axios uuidadded 3 packages, and audited 4 packages in 7s1 package is looking for fundingrun `npm fund` for detailsfound 0 vulnerabilities
root@35376c1c05d8:~# node translateDemo.js
[{"translations": [{"text": "我徒然學會了抗拒熱鬧,卻還來不及透悟真正的冷清。 --------張大春","to": "zh-Hant"},{"text": "I learned in vain to resist the excitement, but it is too late to understand the real cold. -------- Zhang Dachun","to": "en"}]}
]
root@35376c1c05d8:~#

时间原因,关于Azure认知服务免费提供的AI服务就尝试到这里,聊天机器人没有写出来哈,但是对Azure认知服务有一些了解,嘻,生活加油 ^ _ ^

这篇关于Azure 认知服务浅尝:徒然学会了抗拒热闹,却还来不及透悟真正的冷清;写个聊天机器人治愈自己吧的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/426872

相关文章

springboot家政服务管理平台 LW +PPT+源码+讲解

3系统的可行性研究及需求分析 3.1可行性研究 3.1.1技术可行性分析 经过大学四年的学习,已经掌握了JAVA、Mysql数据库等方面的编程技巧和方法,对于这些技术该有的软硬件配置也是齐全的,能够满足开发的需要。 本家政服务管理平台采用的是Mysql作为数据库,可以绝对地保证用户数据的安全;可以与Mysql数据库进行无缝连接。 所以,家政服务管理平台在技术上是可以实施的。 3.1

青龙面板2.9之Cdle傻妞机器人编译教程

看到有的朋友对傻妞机器人感兴趣,这里写一下傻妞机器人的编译教程。 第一步,这里以linux amd64为例,去官网下载安装go语言安装包: 第二步,输入下方指令 cd /usr/local && wget https://golang.google.cn/dl/go1.16.7.linux-amd64.tar.gz -O go1.16.7.linux-amd64.tar.gz

微服务中RPC的强类型检查与HTTP的弱类型对比

在微服务架构中,服务间的通信是一个至关重要的环节。其中,远程过程调用(RPC)和HTTP是两种最常见的通信方式。虽然它们都能实现服务间的数据交换,但在类型检查方面,RPC的强类型检查和HTTP的弱类型之间有着显著的差异。本文将深入探讨这两种通信方式在类型检查方面的优缺点,以及它们对微服务架构的影响。 一、RPC的强类型检查 RPC的强类型检查是其核心优势之一。在RPC通信中,客户端和服务端都使

中国341城市生态系统服务价值数据集(2000-2020年)

生态系统服务反映了人类直接或者间接从自然生态系统中获得的各种惠益,对支撑和维持人类生存和福祉起着重要基础作用。目前针对全国城市尺度的生态系统服务价值的长期评估还相对较少。我们在Xie等(2017)的静态生态系统服务当量因子表基础上,选取净初级生产力,降水量,生物迁移阻力,土壤侵蚀度和道路密度五个变量,对生态系统供给服务、调节服务、支持服务和文化服务共4大类和11小类的当量因子进行了时空调整,计算了

SpringCloud - 微服务

1、微服务介绍         参考: 微服务百度百科 1.1 概念         微服务(或称微服务架构)是一种云原生架构方法,在单个应用中包含众多松散耦合且可单独部署的小型组件或服务。 这些服务通常拥有自己的技术栈,包括数据库和数据管理模型;通过一个REST API、事件流和消息代理组合彼此通信;以及按照业务能力进行组织,具有通常称为有界上下文的服务分隔线。         微服务特

微服务(服务治理)

服务远程调用时存在的问题 注册中心原理 服务治理中的三个角色分别是什么? 服务提供者:暴露服务接口,供其它服务调用服务消费者:调用其它服务提供的接口注册中心:记录并监控微服务各实例状态,推送服务变更信息 消费者如何知道提供者的地址? 服务提供者会在启动时注册自己信息到注册中心,消费者可以从注册中心订阅和拉取服务信息 消费者如何得知服务状态变更? 服务提供者通过心

九分钟学会 Markdown

转自:http://dapengde.com/archives/17033 技多不压身。如果你愿意花九分钟学一个当前流行的软件技术的话,可以开始计时了。 00:00 是什么以及为什么 Markdown 是一种轻量级标记语言。好吧,我承认这不是人话。换个说法:Windows 里的记事本或办公软件 Word 你用过吧?类似的,Markdown 软件是用来在电脑里写文字的(作文、笔记、会

基于动力学的六自由度机器人阻抗恒力跟踪控制

1.整个代码的控制流程图如下: 2.正逆运动学计算 略 3.动力学模型 采用拉格朗日法计算机械臂的动力学模型,其输入的是机械臂的关节角度、角速度和角加速度;其中M、C、G本别是计算的惯性力、科式力和重力项,相关部分如下: 4.RBF神经网络自适应参数调节 采用RBF自适应调节阻抗控制器参数,末端每个方向单独进行参数的调整,其中rbf的输入的是力和位置,输出的是阻抗控制器的参数,rb

CloudStack管理员文档 - 服务方案

用户创建一个实例可以又很多个选项来设定该实例的特性和性能。CloudStack提供以下几种方式: 服务方案,由管理员定义,提供了CPU速度,CPU数量,内存大小,根磁盘的标签,以及其他选项磁盘方案,由管理员定义,为主存储提供了磁盘大小和IOPS的选项网络方案,由管理员定义, 计算和磁盘方案 服务方案是CPU,内存,磁盘等虚拟硬件特性的集合。管理员可以创建各种服务方案,终端用户在创建虚拟机的时

基于RAG的知识库AI代理机器人,问题思考

基于RAG的知识库AI代理机器人,问题思考 知识库内容分类 对于普通非qa问答格式的知识内容 在分段存储时,需要手动调整,保证每个分段的内容意思完整,不被分割,当然段落也不宜过长,保证内容表达的意思到不可分割为止就行 对于qa问答格式的知识内容 通常需要对问题增加格外索引,因为fastgpt的模式是将问题和回答,作为完整的文本作为向量化的坐标,当问题和回答的内容过长时,使用问题向量化匹配