当前位置:网站首页>Solve the technical problems in seq2seq + attention machine translation
Solve the technical problems in seq2seq + attention machine translation
2022-04-23 03:40:00 【Cooking code King】
1 Source code
First, the source code :https://github.com/keon/seq2seq
We usually use this machine translation model to learn the source code , But there will be many small technical problems .
2 python -m spacy download en Prompt that the server connection has failed all the time and the installation cannot be installed
The official description of the following command line is not available , There will be an error that the connection is not connected :
python -m spacy download de
python -m spacy download en
So , You need to use these two packages de_core_news_sm-2.3.0.tar.gz and en_core_web_sm-2.2.5.tar.gz, If you don't have a dial, you can click in and download it by yourself . Close test available .
3 Modify the code
The code needs to be modified in two places :
utils.py First few lines in :
import re
import spacy
from torchtext.legacy.data import Field, BucketIterator # add legacy!!!
from torchtext.legacy.datasets import Multi30k # add legacy!!!
Then the next few lines change to :
def load_dataset(batch_size):
spacy_de = spacy.load('de_core_news_sm') # The parameter here used to be de
spacy_en = spacy.load('en_core_web_md') # The parameter here used to be en
url = re.compile('(<url>.*</url>)')
……
4 pycharm/anaconda+torch+cuda+gpu Environmental Science
I can't match the reference of the environment This blog .
stay win10+anaconda After installation in the environment , stay pycharm Use in conda The virtual environment kernel can be used .
5 effect
版权声明
本文为[Cooking code King]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220601196721.html
边栏推荐
- Commonly used classes
- Visual programming -- how to customize the mouse cursor
- Initial experience of talent plan learning camp: communication + adhering to the only way to learn open source collaborative courses
- Photoshop installation under win10
- Basic knowledge of convolutional neural network
- Three types of cyclic structure
- Deep learning notes (II) -- principle and implementation of activation function
- 深度学习笔记(二)——激活函数原理与实现
- Learn about I / O flow and file operations
- Unity games and related interview questions
猜你喜欢
Visual programming -- how to customize the mouse cursor
Add the compiled and installed Mysql to the path environment variable
ROS series (I): rapid installation of ROS
ROS series (4): ROS communication mechanism series (4): topic communication practice
Opencv4 QR code recognition test
Install PaddlePaddle on ARM
Abstract classes, interfaces and common keywords
Design and implementation of redis (6): how redis achieves high availability
Common net HP UNIX system FTP server listfiles returns null solution.
2022 团体程序设计天梯赛 模拟赛 L2-3 浪漫侧影 (25 分)
随机推荐
Paddlepaddle model to onnx
The art of concurrent programming (3): an in-depth understanding of the principle of synchronized
Unity knowledge points (common core classes)
JS calculates the display date according to the time
MySQL zip installation tutorial
Punch in: 4.22 C language chapter - (1) first knowledge of C language - (11) pointer
The fourth operation
What if win10 doesn't have a local group policy?
標識符、關鍵字、數據類型
Add the compiled and installed Mysql to the path environment variable
Cmake qmake simple knowledge
PYMOL-note
常用的辅助类
The principle and solution of not allowing pasting in an English Network
Romantic silhouette of L2-3 of 2022 group programming ladder Simulation Competition (25 points)
Visual programming -- how to customize the mouse cursor
The super large image labels in remote sensing data set are cut into specified sizes and saved into coco data set - target detection
Installation and configuration of MinGW under win10
Three types of jump statements
Notes sur l'apprentissage profond (Ⅱ) - - Principe et mise en oeuvre de la fonction d'activation