# Swagger generated server
## Overview
This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the
[OpenAPI-Spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This
is an example of building a swagger-enabled Flask server.
This example uses the [Connexion](https://github.com/zalando/connexion) library on top of Flask.
## Requirements
Python 3.5.2+
## Usage
To run the server, please execute the following from the root directory:
```
pip3 install -r requirements.txt
python3 -m swagger_server
```
and open your browser to here:
```
http://localhost:8080/tianchi_yue/sentiment_analysis/1.0.0/ui/
```
Your Swagger definition lives here:
```
http://localhost:8080/tianchi_yue/sentiment_analysis/1.0.0/swagger.json
```
To launch the integration tests, use tox:
```
sudo pip install tox
tox
```
## Running with Docker
To run the server on a Docker container, please execute the following from the root directory:
```bash
# building the image
docker build -t swagger_server .
# starting up a container
docker run -p 8080:8080 swagger_server
```
#### 从swagger hub 下载后修改
- run.sh
- python -m swagger_server 运行程序
- shell 运行
- runserver.py
- 在pycharm 中运行
- swagger_server/swagger/swagger.yaml
- 注释掉host
- swagger_server/main.py
- app.run(port=7700, host='0.0.0.0', server='tornado')
- host 让外部访问, tornado 多线程运行
- 查看ui
- http://localhost:8080/tianchi_yue/sentiment_analysis/1.0.0/ui/
- api_test.py
- 测试api
post_data = {"question":[question]}
data = requests.post("http:",json=post_data)
data = data.json()
- src
- 后台算法
- nltk,spacy,textblob
- controller
- 添加算法,sys.path
- 函数名对应 定义的operationID
- 在服务器搭建server
- 内部线程安全
- nginx gunicorn
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
情感分析可视化项目后端API.zip (31个子文件)
SentimentAnalysisAPI-master
api_test.py 2KB
.travis.yml 349B
setup.py 762B
src
word_cloud.py 885B
__init__.py 143B
keyword_extraction.py 821B
.swagger-codegen
VERSION 6B
runserver.py 541B
tox.ini 143B
test-requirements.txt 90B
Dockerfile 246B
requirements.txt 66B
swagger_server
__init__.py 0B
util.py 3KB
controllers
__init__.py 0B
key_controller.py 1KB
__main__.py 370B
swagger
swagger.yaml 3KB
test
__init__.py 415B
test_key_controller.py 1KB
models
__init__.py 270B
keywords_result.py 2KB
ner_result.py 2KB
base_model_.py 2KB
term.py 2KB
encoder.py 608B
.gitignore 786B
run.sh 24B
.dockerignore 885B
git_push.sh 2KB
README.md 2KB
共 31 条
- 1
资源评论
乐韬科技
- 粉丝: 20
- 资源: 107
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功