summaryrefslogtreecommitdiff
path: root/python-dynet.spec
blob: 640d4b7debb075481491cc6d4ddafad67f33df5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
%global _empty_manifest_terminate_build 0
Name:		python-dyNET
Version:	2.1.2
Release:	1
Summary:	The Dynamic Neural Network Toolkit
License:	Apache 2.0
URL:		https://github.com/clab/dynet
Source0:	https://mirrors.nju.edu.cn/pypi/web/packages/a3/3b/b46bf4503c8f896b39169e1319adbfa485c8988db981aae537c7226b65c2/dyNET-2.1.2.tar.gz

Requires:	python3-cython
Requires:	python3-numpy

%description
[![Build Status (Travis CI)](https://travis-ci.org/clab/dynet.svg?branch=master)](https://travis-ci.org/clab/dynet)
[![Build Status (AppVeyor)](https://ci.appveyor.com/api/projects/status/github/clab/dynet?svg=true)](https://ci.appveyor.com/project/danielh/dynet-c3iuq)
[![Build Status (Docs)](https://readthedocs.org/projects/dynet/badge/?version=latest)](http://dynet.readthedocs.io/en/latest/)
[![PyPI version](https://badge.fury.io/py/dyNET.svg)](https://badge.fury.io/py/dyNET)
The Dynamic Neural Network Toolkit
- [General](#general)
- [Installation](#installation)
  - [C++](#c-installation)
  - [Python](#python-installation)
- [Getting Started](#getting-started)
- [Citing](#citing)
- [Releases and Contributing](#releases-and-contributing)
## General
DyNet is a neural network library developed by Carnegie Mellon University and many others. It is written in C++ (with bindings in Python) and is designed to be efficient when run on either CPU or GPU, and to work well with networks that have dynamic structures that change for every training instance. For example, these kinds of networks are particularly important in natural language processing tasks, and DyNet has been used to build state-of-the-art systems for [syntactic parsing](https://github.com/clab/lstm-parser), [machine translation](https://github.com/neubig/lamtram), [morphological inflection](https://github.com/mfaruqui/morph-trans), and many other application areas.
Read the [documentation](http://dynet.readthedocs.io/en/latest/) to get started, and feel free to contact the [dynet-users group](https://groups.google.com/forum/#!forum/dynet-users) group with any questions (if you want to receive email make sure to select "all email" when you sign up). We greatly appreciate any bug reports and contributions, which can be made by filing an issue or making a pull request through the [github page](http://github.com/clab/dynet).
You can also read more technical details in our [technical report](https://arxiv.org/abs/1701.03980).
## Getting started
You can find tutorials about using DyNet [here (C++)](http://dynet.readthedocs.io/en/latest/tutorial.html#c-tutorial) and [here (python)](http://dynet.readthedocs.io/en/latest/tutorial.html#python-tutorial), and [here (EMNLP 2016 tutorial)](https://github.com/clab/dynet_tutorial_examples).
One aspect that sets DyNet apart from other tookits is the **auto-batching** feature. See the [documentation](http://dynet.readthedocs.io/en/latest/minibatch.html) about batching.
The `example` folder contains a variety of examples in C++ and python.
## Installation
DyNet relies on a number of external programs/libraries including CMake and
Eigen. CMake can be installed from standard repositories.
For example on **Ubuntu Linux**:
    sudo apt-get install build-essential cmake
Or on **macOS**, first make sure the Apple Command Line Tools are installed, then
get CMake, and Mercurial with either homebrew or macports:
    xcode-select --install
    brew install cmake  # Using homebrew.
    sudo port install cmake # Using macports.
On **Windows**, see [documentation](http://dynet.readthedocs.io/en/latest/install.html#windows-support).
To compile DyNet you also need a [specific version of the Eigen
library](https://github.com/clab/dynet/releases/download/2.1/eigen-b2e267dc99d4.zip). **If you use any of the
released versions, you may get assertion failures or compile errors.**
You can get it easily using the following command:
    mkdir eigen
    cd eigen
    wget https://github.com/clab/dynet/releases/download/2.1/eigen-b2e267dc99d4.zip
    unzip eigen-b2e267dc99d4.zip
### C++ installation
You can install dynet for C++ with the following commands
    # Clone the github repository
    git clone https://github.com/clab/dynet.git
    cd dynet
    mkdir build
    cd build
    # Run CMake
    # -DENABLE_BOOST=ON in combination with -DENABLE_CPP_EXAMPLES=ON also
    # compiles the multiprocessing c++ examples
    cmake .. -DEIGEN3_INCLUDE_DIR=/path/to/eigen -DENABLE_CPP_EXAMPLES=ON
    # Compile using 2 processes
    make -j 2
    # Test with an example
    ./examples/train_xor
For more details refer to the [documentation](http://dynet.readthedocs.io/en/latest/install.html#building)
### Python installation
You can install DyNet for python by using the following command
    pip install git+https://github.com/clab/dynet#egg=dynet
For more details refer to the [documentation](http://dynet.readthedocs.io/en/latest/python.html#installing-dynet-for-python)
## Citing
If you use DyNet for research, please cite this report as follows:
    @article{dynet,
      title={DyNet: The Dynamic Neural Network Toolkit},
      author={Graham Neubig and Chris Dyer and Yoav Goldberg and Austin Matthews and Waleed Ammar and Antonios Anastasopoulos and Miguel Ballesteros and David Chiang and Daniel Clothiaux and Trevor Cohn and Kevin Duh and Manaal Faruqui and Cynthia Gan and Dan Garrette and Yangfeng Ji and Lingpeng Kong and Adhiguna Kuncoro and Gaurav Kumar and Chaitanya Malaviya and Paul Michel and Yusuke Oda and Matthew Richardson and Naomi Saphra and Swabha Swayamdipta and Pengcheng Yin},
      journal={arXiv preprint arXiv:1701.03980},
      year={2017}
    }
## Contributing
We welcome any contribution to DyNet! You can find the contributing guidelines [here](http://dynet.readthedocs.io/en/latest/contributing.html)

%package -n python3-dyNET
Summary:	The Dynamic Neural Network Toolkit
Provides:	python-dyNET
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:	python3-pip
BuildRequires:	python3-cffi
BuildRequires:	gcc
BuildRequires:	gdb
%description -n python3-dyNET
[![Build Status (Travis CI)](https://travis-ci.org/clab/dynet.svg?branch=master)](https://travis-ci.org/clab/dynet)
[![Build Status (AppVeyor)](https://ci.appveyor.com/api/projects/status/github/clab/dynet?svg=true)](https://ci.appveyor.com/project/danielh/dynet-c3iuq)
[![Build Status (Docs)](https://readthedocs.org/projects/dynet/badge/?version=latest)](http://dynet.readthedocs.io/en/latest/)
[![PyPI version](https://badge.fury.io/py/dyNET.svg)](https://badge.fury.io/py/dyNET)
The Dynamic Neural Network Toolkit
- [General](#general)
- [Installation](#installation)
  - [C++](#c-installation)
  - [Python](#python-installation)
- [Getting Started](#getting-started)
- [Citing](#citing)
- [Releases and Contributing](#releases-and-contributing)
## General
DyNet is a neural network library developed by Carnegie Mellon University and many others. It is written in C++ (with bindings in Python) and is designed to be efficient when run on either CPU or GPU, and to work well with networks that have dynamic structures that change for every training instance. For example, these kinds of networks are particularly important in natural language processing tasks, and DyNet has been used to build state-of-the-art systems for [syntactic parsing](https://github.com/clab/lstm-parser), [machine translation](https://github.com/neubig/lamtram), [morphological inflection](https://github.com/mfaruqui/morph-trans), and many other application areas.
Read the [documentation](http://dynet.readthedocs.io/en/latest/) to get started, and feel free to contact the [dynet-users group](https://groups.google.com/forum/#!forum/dynet-users) group with any questions (if you want to receive email make sure to select "all email" when you sign up). We greatly appreciate any bug reports and contributions, which can be made by filing an issue or making a pull request through the [github page](http://github.com/clab/dynet).
You can also read more technical details in our [technical report](https://arxiv.org/abs/1701.03980).
## Getting started
You can find tutorials about using DyNet [here (C++)](http://dynet.readthedocs.io/en/latest/tutorial.html#c-tutorial) and [here (python)](http://dynet.readthedocs.io/en/latest/tutorial.html#python-tutorial), and [here (EMNLP 2016 tutorial)](https://github.com/clab/dynet_tutorial_examples).
One aspect that sets DyNet apart from other tookits is the **auto-batching** feature. See the [documentation](http://dynet.readthedocs.io/en/latest/minibatch.html) about batching.
The `example` folder contains a variety of examples in C++ and python.
## Installation
DyNet relies on a number of external programs/libraries including CMake and
Eigen. CMake can be installed from standard repositories.
For example on **Ubuntu Linux**:
    sudo apt-get install build-essential cmake
Or on **macOS**, first make sure the Apple Command Line Tools are installed, then
get CMake, and Mercurial with either homebrew or macports:
    xcode-select --install
    brew install cmake  # Using homebrew.
    sudo port install cmake # Using macports.
On **Windows**, see [documentation](http://dynet.readthedocs.io/en/latest/install.html#windows-support).
To compile DyNet you also need a [specific version of the Eigen
library](https://github.com/clab/dynet/releases/download/2.1/eigen-b2e267dc99d4.zip). **If you use any of the
released versions, you may get assertion failures or compile errors.**
You can get it easily using the following command:
    mkdir eigen
    cd eigen
    wget https://github.com/clab/dynet/releases/download/2.1/eigen-b2e267dc99d4.zip
    unzip eigen-b2e267dc99d4.zip
### C++ installation
You can install dynet for C++ with the following commands
    # Clone the github repository
    git clone https://github.com/clab/dynet.git
    cd dynet
    mkdir build
    cd build
    # Run CMake
    # -DENABLE_BOOST=ON in combination with -DENABLE_CPP_EXAMPLES=ON also
    # compiles the multiprocessing c++ examples
    cmake .. -DEIGEN3_INCLUDE_DIR=/path/to/eigen -DENABLE_CPP_EXAMPLES=ON
    # Compile using 2 processes
    make -j 2
    # Test with an example
    ./examples/train_xor
For more details refer to the [documentation](http://dynet.readthedocs.io/en/latest/install.html#building)
### Python installation
You can install DyNet for python by using the following command
    pip install git+https://github.com/clab/dynet#egg=dynet
For more details refer to the [documentation](http://dynet.readthedocs.io/en/latest/python.html#installing-dynet-for-python)
## Citing
If you use DyNet for research, please cite this report as follows:
    @article{dynet,
      title={DyNet: The Dynamic Neural Network Toolkit},
      author={Graham Neubig and Chris Dyer and Yoav Goldberg and Austin Matthews and Waleed Ammar and Antonios Anastasopoulos and Miguel Ballesteros and David Chiang and Daniel Clothiaux and Trevor Cohn and Kevin Duh and Manaal Faruqui and Cynthia Gan and Dan Garrette and Yangfeng Ji and Lingpeng Kong and Adhiguna Kuncoro and Gaurav Kumar and Chaitanya Malaviya and Paul Michel and Yusuke Oda and Matthew Richardson and Naomi Saphra and Swabha Swayamdipta and Pengcheng Yin},
      journal={arXiv preprint arXiv:1701.03980},
      year={2017}
    }
## Contributing
We welcome any contribution to DyNet! You can find the contributing guidelines [here](http://dynet.readthedocs.io/en/latest/contributing.html)

%package help
Summary:	Development documents and examples for dyNET
Provides:	python3-dyNET-doc
%description help
[![Build Status (Travis CI)](https://travis-ci.org/clab/dynet.svg?branch=master)](https://travis-ci.org/clab/dynet)
[![Build Status (AppVeyor)](https://ci.appveyor.com/api/projects/status/github/clab/dynet?svg=true)](https://ci.appveyor.com/project/danielh/dynet-c3iuq)
[![Build Status (Docs)](https://readthedocs.org/projects/dynet/badge/?version=latest)](http://dynet.readthedocs.io/en/latest/)
[![PyPI version](https://badge.fury.io/py/dyNET.svg)](https://badge.fury.io/py/dyNET)
The Dynamic Neural Network Toolkit
- [General](#general)
- [Installation](#installation)
  - [C++](#c-installation)
  - [Python](#python-installation)
- [Getting Started](#getting-started)
- [Citing](#citing)
- [Releases and Contributing](#releases-and-contributing)
## General
DyNet is a neural network library developed by Carnegie Mellon University and many others. It is written in C++ (with bindings in Python) and is designed to be efficient when run on either CPU or GPU, and to work well with networks that have dynamic structures that change for every training instance. For example, these kinds of networks are particularly important in natural language processing tasks, and DyNet has been used to build state-of-the-art systems for [syntactic parsing](https://github.com/clab/lstm-parser), [machine translation](https://github.com/neubig/lamtram), [morphological inflection](https://github.com/mfaruqui/morph-trans), and many other application areas.
Read the [documentation](http://dynet.readthedocs.io/en/latest/) to get started, and feel free to contact the [dynet-users group](https://groups.google.com/forum/#!forum/dynet-users) group with any questions (if you want to receive email make sure to select "all email" when you sign up). We greatly appreciate any bug reports and contributions, which can be made by filing an issue or making a pull request through the [github page](http://github.com/clab/dynet).
You can also read more technical details in our [technical report](https://arxiv.org/abs/1701.03980).
## Getting started
You can find tutorials about using DyNet [here (C++)](http://dynet.readthedocs.io/en/latest/tutorial.html#c-tutorial) and [here (python)](http://dynet.readthedocs.io/en/latest/tutorial.html#python-tutorial), and [here (EMNLP 2016 tutorial)](https://github.com/clab/dynet_tutorial_examples).
One aspect that sets DyNet apart from other tookits is the **auto-batching** feature. See the [documentation](http://dynet.readthedocs.io/en/latest/minibatch.html) about batching.
The `example` folder contains a variety of examples in C++ and python.
## Installation
DyNet relies on a number of external programs/libraries including CMake and
Eigen. CMake can be installed from standard repositories.
For example on **Ubuntu Linux**:
    sudo apt-get install build-essential cmake
Or on **macOS**, first make sure the Apple Command Line Tools are installed, then
get CMake, and Mercurial with either homebrew or macports:
    xcode-select --install
    brew install cmake  # Using homebrew.
    sudo port install cmake # Using macports.
On **Windows**, see [documentation](http://dynet.readthedocs.io/en/latest/install.html#windows-support).
To compile DyNet you also need a [specific version of the Eigen
library](https://github.com/clab/dynet/releases/download/2.1/eigen-b2e267dc99d4.zip). **If you use any of the
released versions, you may get assertion failures or compile errors.**
You can get it easily using the following command:
    mkdir eigen
    cd eigen
    wget https://github.com/clab/dynet/releases/download/2.1/eigen-b2e267dc99d4.zip
    unzip eigen-b2e267dc99d4.zip
### C++ installation
You can install dynet for C++ with the following commands
    # Clone the github repository
    git clone https://github.com/clab/dynet.git
    cd dynet
    mkdir build
    cd build
    # Run CMake
    # -DENABLE_BOOST=ON in combination with -DENABLE_CPP_EXAMPLES=ON also
    # compiles the multiprocessing c++ examples
    cmake .. -DEIGEN3_INCLUDE_DIR=/path/to/eigen -DENABLE_CPP_EXAMPLES=ON
    # Compile using 2 processes
    make -j 2
    # Test with an example
    ./examples/train_xor
For more details refer to the [documentation](http://dynet.readthedocs.io/en/latest/install.html#building)
### Python installation
You can install DyNet for python by using the following command
    pip install git+https://github.com/clab/dynet#egg=dynet
For more details refer to the [documentation](http://dynet.readthedocs.io/en/latest/python.html#installing-dynet-for-python)
## Citing
If you use DyNet for research, please cite this report as follows:
    @article{dynet,
      title={DyNet: The Dynamic Neural Network Toolkit},
      author={Graham Neubig and Chris Dyer and Yoav Goldberg and Austin Matthews and Waleed Ammar and Antonios Anastasopoulos and Miguel Ballesteros and David Chiang and Daniel Clothiaux and Trevor Cohn and Kevin Duh and Manaal Faruqui and Cynthia Gan and Dan Garrette and Yangfeng Ji and Lingpeng Kong and Adhiguna Kuncoro and Gaurav Kumar and Chaitanya Malaviya and Paul Michel and Yusuke Oda and Matthew Richardson and Naomi Saphra and Swabha Swayamdipta and Pengcheng Yin},
      journal={arXiv preprint arXiv:1701.03980},
      year={2017}
    }
## Contributing
We welcome any contribution to DyNet! You can find the contributing guidelines [here](http://dynet.readthedocs.io/en/latest/contributing.html)

%prep
%autosetup -n dyNET-2.1.2

%build
%py3_build

%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
	find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
	find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
	find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
	find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
	find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .

%files -n python3-dyNET -f filelist.lst
%dir %{python3_sitearch}/*

%files help -f doclist.lst
%{_docdir}/*

%changelog
* Tue Apr 11 2023 Python_Bot <Python_Bot@openeuler.org> - 2.1.2-1
- Package Spec generated