/* Generated by Cython 3.1.1 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "depends": [
            "/Users/chanhyeok/nltkorenv/lib/python3.9/site-packages/numpy/core/include/numpy/arrayobject.h",
            "/Users/chanhyeok/nltkorenv/lib/python3.9/site-packages/numpy/core/include/numpy/arrayscalars.h",
            "/Users/chanhyeok/nltkorenv/lib/python3.9/site-packages/numpy/core/include/numpy/ndarrayobject.h",
            "/Users/chanhyeok/nltkorenv/lib/python3.9/site-packages/numpy/core/include/numpy/ndarraytypes.h",
            "/Users/chanhyeok/nltkorenv/lib/python3.9/site-packages/numpy/core/include/numpy/ufuncobject.h"
        ],
        "include_dirs": [
            ".",
            "/Users/chanhyeok/nltkorenv/lib/python3.9/site-packages/numpy/core/include"
        ],
        "name": "nltkor.tag.libs.network",
        "sources": [
            "nltkor/tag/libs/network.pyx"
        ]
    },
    "module_name": "nltkor.tag.libs.network"
}
END: Cython Metadata */

#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */
/* InitLimitedAPI */
#if defined(Py_LIMITED_API) && !defined(CYTHON_LIMITED_API)
  #define CYTHON_LIMITED_API 1
#endif

#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x03080000
    #error Cython requires Python 3.8+.
#else
#define __PYX_ABI_VERSION "3_1_1"
#define CYTHON_HEX_VERSION 0x030101F0
#define CYTHON_FUTURE_DIVISION 1
/* CModulePreamble */
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#define __PYX_COMMA ,
#ifndef HAVE_LONG_LONG
  #define HAVE_LONG_LONG
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
#if defined(GRAALVM_PYTHON)
  /* For very preliminary testing purposes. Most variables are set the same as PyPy.
     The existence of this section does not imply that anything works or is even tested */
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 1
  #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_TYPE_SPECS
  #define CYTHON_USE_TYPE_SPECS 0
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_ASSUME_SAFE_SIZE
  #define CYTHON_ASSUME_SAFE_SIZE 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_AM_SEND
  #define CYTHON_USE_AM_SEND 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 1
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
#elif defined(PYPY_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 1
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #ifndef CYTHON_ASSUME_SAFE_SIZE
    #define CYTHON_ASSUME_SAFE_SIZE 1
  #endif
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #if PY_VERSION_HEX < 0x03090000
    #undef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00)
  #endif
  #undef CYTHON_USE_AM_SEND
  #define CYTHON_USE_AM_SEND 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100)
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
#elif defined(CYTHON_LIMITED_API)
  #ifdef Py_LIMITED_API
    #undef __PYX_LIMITED_VERSION_HEX
    #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
  #endif
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 1
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #undef CYTHON_CLINE_IN_TRACEBACK
  #define CYTHON_CLINE_IN_TRACEBACK 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_TYPE_SPECS
  #define CYTHON_USE_TYPE_SPECS 1
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #endif
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  #endif
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_ASSUME_SAFE_SIZE
  #define CYTHON_ASSUME_SAFE_SIZE 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_MODULE_STATE
    #define CYTHON_USE_MODULE_STATE 0
  #endif
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 0
  #endif
  #ifndef CYTHON_USE_AM_SEND
    #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
  #endif
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #ifdef Py_GIL_DISABLED
    #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1
  #else
    #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #endif
  #if PY_VERSION_HEX < 0x030A0000
    #undef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #elif !defined(CYTHON_USE_TYPE_SLOTS)
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #ifndef CYTHON_USE_PYTYPE_LOOKUP
    #define CYTHON_USE_PYTYPE_LOOKUP 1
  #endif
  #ifndef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 0
  #elif !defined(CYTHON_USE_PYLIST_INTERNALS)
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2
    #undef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #elif !defined(CYTHON_USE_UNICODE_WRITER)
    #define CYTHON_USE_UNICODE_WRITER 1
  #endif
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
  #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_ASSUME_SAFE_SIZE
    #define CYTHON_ASSUME_SAFE_SIZE 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #ifndef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_FAST_GIL
    #define CYTHON_FAST_GIL 0
  #elif !defined(CYTHON_FAST_GIL)
    #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6)
  #endif
  #ifndef CYTHON_METH_FASTCALL
    #define CYTHON_METH_FASTCALL 1
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_MODULE_STATE
    #define CYTHON_USE_MODULE_STATE 0
  #endif
  #ifndef CYTHON_USE_SYS_MONITORING
    #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 1
  #endif
  #ifndef CYTHON_USE_AM_SEND
    #define CYTHON_USE_AM_SEND 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_USE_DICT_VERSIONS
    #define CYTHON_USE_DICT_VERSIONS 0
  #elif !defined(CYTHON_USE_DICT_VERSIONS)
    #define CYTHON_USE_DICT_VERSIONS  (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE)
  #endif
  #ifndef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK 1
  #endif
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
  #endif
  #ifndef CYTHON_USE_FREELISTS
    #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
  #endif
#endif
#ifndef CYTHON_FAST_PYCCALL
#define CYTHON_FAST_PYCCALL  CYTHON_FAST_PYCALL
#endif
#ifndef CYTHON_VECTORCALL
#if CYTHON_COMPILING_IN_LIMITED_API
#define CYTHON_VECTORCALL  (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
#else
#define CYTHON_VECTORCALL  (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1)
#endif
#endif
#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1)
#if CYTHON_USE_PYLONG_INTERNALS
  #undef SHIFT
  #undef BASE
  #undef MASK
  #ifdef SIZEOF_VOID_P
    enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
  #endif
#endif
#ifndef __has_attribute
  #define __has_attribute(x) 0
#endif
#ifndef __has_cpp_attribute
  #define __has_cpp_attribute(x) 0
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#ifndef CYTHON_UNUSED
  #if defined(__cplusplus)
    /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
     * but leads to warnings with -pedantic, since it is a C++17 feature */
    #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
      #if __has_cpp_attribute(maybe_unused)
        #define CYTHON_UNUSED [[maybe_unused]]
      #endif
    #endif
  #endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_UNUSED_VAR
#  if defined(__cplusplus)
     template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
#  else
#    define CYTHON_UNUSED_VAR(x) (void)(x)
#  endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
  #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_USE_CPP_STD_MOVE
  #if defined(__cplusplus) && (\
    __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
    #define CYTHON_USE_CPP_STD_MOVE 1
  #else
    #define CYTHON_USE_CPP_STD_MOVE 0
  #endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#ifdef _MSC_VER
    #ifndef _MSC_STDINT_H_
        #if _MSC_VER < 1300
            typedef unsigned char     uint8_t;
            typedef unsigned short    uint16_t;
            typedef unsigned int      uint32_t;
        #else
            typedef unsigned __int8   uint8_t;
            typedef unsigned __int16  uint16_t;
            typedef unsigned __int32  uint32_t;
        #endif
    #endif
    #if _MSC_VER < 1300
        #ifdef _WIN64
            typedef unsigned long long  __pyx_uintptr_t;
        #else
            typedef unsigned int        __pyx_uintptr_t;
        #endif
    #else
        #ifdef _WIN64
            typedef unsigned __int64    __pyx_uintptr_t;
        #else
            typedef unsigned __int32    __pyx_uintptr_t;
        #endif
    #endif
#else
    #include <stdint.h>
    typedef uintptr_t  __pyx_uintptr_t;
#endif
#ifndef CYTHON_FALLTHROUGH
  #if defined(__cplusplus)
    /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
     * but leads to warnings with -pedantic, since it is a C++17 feature */
    #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
      #if __has_cpp_attribute(fallthrough)
        #define CYTHON_FALLTHROUGH [[fallthrough]]
      #endif
    #endif
    #ifndef CYTHON_FALLTHROUGH
      #if __has_cpp_attribute(clang::fallthrough)
        #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
      #elif __has_cpp_attribute(gnu::fallthrough)
        #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
      #endif
    #endif
  #endif
  #ifndef CYTHON_FALLTHROUGH
    #if __has_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
    #else
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
  #if defined(__clang__) && defined(__apple_build_version__)
    #if __apple_build_version__ < 7000000
      #undef  CYTHON_FALLTHROUGH
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
#endif
#ifndef Py_UNREACHABLE
  #define Py_UNREACHABLE()  assert(0); abort()
#endif
#ifdef __cplusplus
  template <typename T>
  struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
  #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
#else
  #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
#endif
#if CYTHON_COMPILING_IN_PYPY == 1
  #define __PYX_NEED_TP_PRINT_SLOT  (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000)
#else
  #define __PYX_NEED_TP_PRINT_SLOT  (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000)
#endif
#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))

/* CInitCode */
#ifndef CYTHON_INLINE
  #if defined(__clang__)
    #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
  #elif defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif

/* PythonCompatibility */
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
#define __Pyx_DefaultClassType PyType_Type
#if CYTHON_COMPILING_IN_LIMITED_API
    #ifndef CO_OPTIMIZED
    static int CO_OPTIMIZED;
    #endif
    #ifndef CO_NEWLOCALS
    static int CO_NEWLOCALS;
    #endif
    #ifndef CO_VARARGS
    static int CO_VARARGS;
    #endif
    #ifndef CO_VARKEYWORDS
    static int CO_VARKEYWORDS;
    #endif
    #ifndef CO_ASYNC_GENERATOR
    static int CO_ASYNC_GENERATOR;
    #endif
    #ifndef CO_GENERATOR
    static int CO_GENERATOR;
    #endif
    #ifndef CO_COROUTINE
    static int CO_COROUTINE;
    #endif
#else
    #ifndef CO_COROUTINE
      #define CO_COROUTINE 0x80
    #endif
    #ifndef CO_ASYNC_GENERATOR
      #define CO_ASYNC_GENERATOR 0x200
    #endif
#endif
static int __Pyx_init_co_variables(void);
#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
  #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
#else
  #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
  #define __Pyx_Py_Is(x, y)  Py_Is(x, y)
#else
  #define __Pyx_Py_Is(x, y) ((x) == (y))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
  #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
#else
  #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
  #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
#else
  #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
  #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
#else
  #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
#endif
#define __Pyx_NoneAsNull(obj)  (__Pyx_Py_IsNone(obj) ? NULL : (obj))
#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
#else
  #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef Py_TPFLAGS_SEQUENCE
  #define Py_TPFLAGS_SEQUENCE 0
#endif
#ifndef Py_TPFLAGS_MAPPING
  #define Py_TPFLAGS_MAPPING 0
#endif
#ifndef METH_STACKLESS
  #define METH_STACKLESS 0
#endif
#ifndef METH_FASTCALL
  #ifndef METH_FASTCALL
     #define METH_FASTCALL 0x80
  #endif
  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
                                                          Py_ssize_t nargs, PyObject *kwnames);
#else
  #if PY_VERSION_HEX >= 0x030d00A4
  #  define __Pyx_PyCFunctionFast PyCFunctionFast
  #  define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
  #else
  #  define __Pyx_PyCFunctionFast _PyCFunctionFast
  #  define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
  #endif
#endif
#if CYTHON_METH_FASTCALL
  #define __Pyx_METH_FASTCALL METH_FASTCALL
  #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
  #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
#else
  #define __Pyx_METH_FASTCALL METH_VARARGS
  #define __Pyx_PyCFunction_FastCall PyCFunction
  #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
#endif
#if CYTHON_VECTORCALL
  #define __pyx_vectorcallfunc vectorcallfunc
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  PY_VECTORCALL_ARGUMENTS_OFFSET
  #define __Pyx_PyVectorcall_NARGS(n)  PyVectorcall_NARGS((size_t)(n))
#elif CYTHON_BACKPORT_VECTORCALL
  typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args,
                                            size_t nargsf, PyObject *kwnames);
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  ((size_t)1 << (8 * sizeof(size_t) - 1))
  #define __Pyx_PyVectorcall_NARGS(n)  ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET))
#else
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  0
  #define __Pyx_PyVectorcall_NARGS(n)  ((Py_ssize_t)(n))
#endif
#if PY_VERSION_HEX >= 0x030900B1
#define __Pyx_PyCFunction_CheckExact(func)  PyCFunction_CheckExact(func)
#else
#define __Pyx_PyCFunction_CheckExact(func)  PyCFunction_Check(func)
#endif
#define __Pyx_CyOrPyCFunction_Check(func)  PyCFunction_Check(func)
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func)  (((PyCFunctionObject*)(func))->m_ml->ml_meth)
#elif !CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func)  PyCFunction_GET_FUNCTION(func)
#endif
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FLAGS(func)  (((PyCFunctionObject*)(func))->m_ml->ml_flags)
static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
    return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
}
#endif
static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(void)) {
#if CYTHON_COMPILING_IN_LIMITED_API
    return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
#else
    return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
#endif
}
#define __Pyx_IsSameCFunction(func, cfunc)   __Pyx__IsSameCFunction(func, cfunc)
#if __PYX_LIMITED_VERSION_HEX < 0x03090000
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  ((void)m, PyType_FromSpecWithBases(s, b))
  typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
#else
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  PyType_FromModuleAndSpec(m, s, b)
  #define __Pyx_PyCMethod  PyCMethod
#endif
#ifndef METH_METHOD
  #define METH_METHOD 0x200
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
  #define PyObject_Free(p)     PyMem_Free(p)
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
#elif CYTHON_COMPILING_IN_GRAAL
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno))
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyThreadState_Current PyThreadState_Get()
#elif !CYTHON_FAST_THREAD_STATE
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x030d00A1
  #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#endif
#if CYTHON_USE_MODULE_STATE
static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op)
{
    void *result;
    result = PyModule_GetState(op);
    if (!result)
        Py_FatalError("Couldn't find the module state");
    return result;
}
#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
#else
#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
#endif
#define __Pyx_PyObject_GetSlot(obj, name, func_ctype)  __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype)
#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype)
#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
#if CYTHON_USE_TYPE_SLOTS
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((type)->name)
  #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype)
  #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL)
  #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype)
#else
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((func_ctype) PyType_GetSlot((type), Py_##name))
  #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\
    ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\
     (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\
     __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL)
  #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype)
  #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype)
#endif
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
#else
#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
#endif
#define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStrWithError(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
    PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
    if (res == NULL) PyErr_Clear();
    return res;
}
#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
#define __Pyx_PyDict_GetItemStrWithError  PyDict_GetItemWithError
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#else
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
#if CYTHON_COMPILING_IN_PYPY
    return PyDict_GetItem(dict, name);
#else
    PyDictEntry *ep;
    PyDictObject *mp = (PyDictObject*) dict;
    long hash = ((PyStringObject *) name)->ob_shash;
    assert(hash != -1);
    ep = (mp->ma_lookup)(mp, name, hash);
    if (ep == NULL) {
        return NULL;
    }
    return ep->me_value;
#endif
}
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#endif
#if CYTHON_USE_TYPE_SLOTS
  #define __Pyx_PyType_GetFlags(tp)   (((PyTypeObject *)tp)->tp_flags)
  #define __Pyx_PyType_HasFeature(type, feature)  ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
#else
  #define __Pyx_PyType_GetFlags(tp)   (PyType_GetFlags((PyTypeObject *)tp))
  #define __Pyx_PyType_HasFeature(type, feature)  PyType_HasFeature(type, feature)
#endif
#define __Pyx_PyObject_GetIterNextFunc(iterator)  __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc)
#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  {\
    PyTypeObject *type = Py_TYPE((PyObject*)obj);\
    assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
    PyObject_GC_Del(obj);\
    Py_DECREF(type);\
}
#else
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  PyObject_GC_Del(obj)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((void)u, 1114111U)
  #define __Pyx_PyUnicode_KIND(u)         ((void)u, (0))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)u)
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GetLength(u))
#else
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_READY(op)       (0)
  #else
    #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                                0 : _PyUnicode_Ready((PyObject *)(op)))
  #endif
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #define __Pyx_PyUnicode_KIND(u)         ((int)PyUnicode_KIND(u))
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
  #else
    #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
    #else
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
    #endif
  #endif
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #if !defined(PyUnicode_DecodeUnicodeEscape)
    #define PyUnicode_DecodeUnicodeEscape(s, size, errors)  PyUnicode_Decode(s, size, "unicode_escape", errors)
  #endif
  #if !defined(PyUnicode_Contains)
    #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
  #endif
  #if !defined(PyByteArray_Check)
    #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
  #endif
  #if !defined(PyObject_Format)
    #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
  #endif
#endif
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if CYTHON_COMPILING_IN_CPYTHON
  #define __Pyx_PySequence_ListKeepNew(obj)\
    (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
#else
  #define __Pyx_PySequence_ListKeepNew(obj)  PySequence_List(obj)
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        __Pyx_IS_TYPE(obj, &PySet_Type)
#endif
#if PY_VERSION_HEX >= 0x030900A4
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
#else
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
  #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
  #else
    #define __Pyx_PyList_GetItemRef(o, i) PySequence_GetItem(o, i)
  #endif
#else
  #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i))
#endif
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result)
#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
  *result = PyObject_GetItem(dict, key);
  if (*result == NULL) {
    if (PyErr_ExceptionMatches(PyExc_KeyError)) {
      PyErr_Clear();
      return 0;
    }
    return -1;
  }
  return 1;
}
#else
static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
  *result = PyDict_GetItemWithError(dict, key);
  if (*result == NULL) {
    return PyErr_Occurred() ? -1 : 0;
  }
  Py_INCREF(*result);
  return 1;
}
#endif
#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
  #define __Pyx_VISIT_CONST(obj)  Py_VISIT(obj)
#else
  #define __Pyx_VISIT_CONST(obj)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i)
  #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i)
#else
  #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
  #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i)
  #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
  #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i)
#endif
#if CYTHON_ASSUME_SAFE_SIZE
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
  #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o)
#else
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
  #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o)
#endif
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
  #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
#else
  static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
      PyObject *module = PyImport_AddModule(name);
      Py_XINCREF(module);
      return module;
  }
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
#endif
#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t
#define __Pyx_PyLong_AsHash_t   __Pyx_PyIndex_AsSsize_t
#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
    #define __Pyx_PySendResult PySendResult
#else
    typedef enum {
        PYGEN_RETURN = 0,
        PYGEN_ERROR = -1,
        PYGEN_NEXT = 1,
    } __Pyx_PySendResult;
#endif
#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
  typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
#else
  #define __Pyx_pyiter_sendfunc sendfunc
#endif
#if !CYTHON_USE_AM_SEND
#define __PYX_HAS_PY_AM_SEND 0
#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000
#define __PYX_HAS_PY_AM_SEND 1
#else
#define __PYX_HAS_PY_AM_SEND 2  // our own backported implementation
#endif
#if __PYX_HAS_PY_AM_SEND < 2
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
#else
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
        __Pyx_pyiter_sendfunc am_send;
    } __Pyx_PyAsyncMethodsStruct;
    #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
#endif
#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
    #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
#else
    #define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
#endif
#if PY_VERSION_HEX >= 0x03090000
#define __Pyx_PyInterpreterState_Get() PyInterpreterState_Get()
#else
#define __Pyx_PyInterpreterState_Get() PyThreadState_Get()->interp
#endif
#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
#ifdef __cplusplus
extern "C"
#endif
PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize);
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) {
    int value;
    PyObject *py_value = PyObject_GetAttrString(inspect, name);
    if (!py_value) return 0;
    value = (int) PyLong_AsLong(py_value);
    Py_DECREF(py_value);
    *write_to = value;
    return value != -1 || !PyErr_Occurred();
}
static int __Pyx_init_co_variables(void) {
    PyObject *inspect;
    int result;
    inspect = PyImport_ImportModule("inspect");
    result =
#if !defined(CO_OPTIMIZED)
        __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) &&
#endif
#if !defined(CO_NEWLOCALS)
        __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) &&
#endif
#if !defined(CO_VARARGS)
        __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) &&
#endif
#if !defined(CO_VARKEYWORDS)
        __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
#endif
#if !defined(CO_ASYNC_GENERATOR)
        __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
#endif
#if !defined(CO_GENERATOR)
        __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) &&
#endif
#if !defined(CO_COROUTINE)
        __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) &&
#endif
        1;
    Py_DECREF(inspect);
    return result ? 0 : -1;
}
#else
static int __Pyx_init_co_variables(void) {
    return 0;  // It's a limited API-only feature
}
#endif

/* MathInitCode */
#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
  #ifndef _USE_MATH_DEFINES
    #define _USE_MATH_DEFINES
  #endif
#endif
#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif

#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 0
#endif
#ifndef CYTHON_CLINE_IN_TRACEBACK
#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#endif
#if CYTHON_CLINE_IN_TRACEBACK
#define __PYX_MARK_ERR_POS(f_index, lineno)  { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; }
#else
#define __PYX_MARK_ERR_POS(f_index, lineno)  { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; }
#endif
#define __PYX_ERR(f_index, lineno, Ln_error) \
    { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }

#ifdef CYTHON_EXTERN_C
    #undef __PYX_EXTERN_C
    #define __PYX_EXTERN_C CYTHON_EXTERN_C
#elif defined(__PYX_EXTERN_C)
    #ifdef _MSC_VER
    #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
    #else
    #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
    #endif
#else
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#define __PYX_HAVE__nltkor__tag__libs__network
#define __PYX_HAVE_API__nltkor__tag__libs__network
/* Early includes */
#include <string.h>
#include <stdio.h>

    /* Using NumPy API declarations from "numpy/__init__.cython-30.pxd" */
    
#include "numpy/arrayobject.h"
#include "numpy/ndarrayobject.h"
#include "numpy/ndarraytypes.h"
#include "numpy/arrayscalars.h"
#include "numpy/ufuncobject.h"

    #if PY_MAJOR_VERSION >= 3
      #define __Pyx_PyFloat_FromString(obj)  PyFloat_FromString(obj)
    #else
      #define __Pyx_PyFloat_FromString(obj)  PyFloat_FromString(obj, NULL)
    #endif
    
#include <stddef.h>

    #if PY_MAJOR_VERSION <= 2
    #define PyDict_GetItemWithError _PyDict_GetItemWithError
    #endif
    

    #if PY_VERSION_HEX < 0x030d0000
    static CYTHON_INLINE int __Pyx_PyWeakref_GetRef(PyObject *ref, PyObject **pobj)
    {
        PyObject *obj = PyWeakref_GetObject(ref);
        if (obj == NULL) {
            // SystemError if ref is NULL
            *pobj = NULL;
            return -1;
        }
        if (obj == Py_None) {
            *pobj = NULL;
            return 0;
        }
        Py_INCREF(obj);
        *pobj = obj;
        return 1;
    }
    #else
    #define __Pyx_PyWeakref_GetRef PyWeakref_GetRef
    #endif
    
#include "pythread.h"

    #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030600) && !defined(PyContextVar_Get)
    #define PyContextVar_Get(var, d, v)         ((d) ?             ((void)(var), Py_INCREF(d), (v)[0] = (d), 0) :             ((v)[0] = NULL, 0)         )
    #endif
    
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
#define CYTHON_WITHOUT_ASSERTIONS
#endif

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
    return (size_t) i < (size_t) limit;
}
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER)
    #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
    #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
    #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
    #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
    #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
    #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
    #define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s)
#else
    #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AsString(s))
    #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s)
#endif
#define __Pyx_PyObject_AsWritableString(s)    ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s)    ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#define __Pyx_PyUnicode_FromOrdinal(o)       PyUnicode_FromOrdinal((int)o)
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef)
    return Py_NewRef(obj);
#else
    Py_INCREF(obj);
    return obj;
#endif
}
static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef)
    return Py_XNewRef(obj);
#else
    Py_XINCREF(obj);
    return obj;
#endif
}
static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b);
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x);
#define __Pyx_PySequence_Tuple(obj)\
    (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t);
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
#if CYTHON_ASSUME_SAFE_MACROS
#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x)
#else
#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x)
#endif
#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x))
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#if CYTHON_USE_PYLONG_INTERNALS
  #if PY_VERSION_HEX >= 0x030C00A7
  #ifndef _PyLong_SIGN_MASK
    #define _PyLong_SIGN_MASK 3
  #endif
  #ifndef _PyLong_NON_SIZE_BITS
    #define _PyLong_NON_SIZE_BITS 3
  #endif
  #define __Pyx_PyLong_Sign(x)  (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
  #define __Pyx_PyLong_IsNeg(x)  ((__Pyx_PyLong_Sign(x) & 2) != 0)
  #define __Pyx_PyLong_IsNonNeg(x)  (!__Pyx_PyLong_IsNeg(x))
  #define __Pyx_PyLong_IsZero(x)  (__Pyx_PyLong_Sign(x) & 1)
  #define __Pyx_PyLong_IsPos(x)  (__Pyx_PyLong_Sign(x) == 0)
  #define __Pyx_PyLong_CompactValueUnsigned(x)  (__Pyx_PyLong_Digits(x)[0])
  #define __Pyx_PyLong_DigitCount(x)  ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
  #define __Pyx_PyLong_SignedDigitCount(x)\
        ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
  #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
    #define __Pyx_PyLong_IsCompact(x)     PyUnstable_Long_IsCompact((PyLongObject*) x)
    #define __Pyx_PyLong_CompactValue(x)  PyUnstable_Long_CompactValue((PyLongObject*) x)
  #else
    #define __Pyx_PyLong_IsCompact(x)     (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
    #define __Pyx_PyLong_CompactValue(x)  ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
  #endif
  typedef Py_ssize_t  __Pyx_compact_pylong;
  typedef size_t  __Pyx_compact_upylong;
  #else
  #define __Pyx_PyLong_IsNeg(x)  (Py_SIZE(x) < 0)
  #define __Pyx_PyLong_IsNonNeg(x)  (Py_SIZE(x) >= 0)
  #define __Pyx_PyLong_IsZero(x)  (Py_SIZE(x) == 0)
  #define __Pyx_PyLong_IsPos(x)  (Py_SIZE(x) > 0)
  #define __Pyx_PyLong_CompactValueUnsigned(x)  ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
  #define __Pyx_PyLong_DigitCount(x)  __Pyx_sst_abs(Py_SIZE(x))
  #define __Pyx_PyLong_SignedDigitCount(x)  Py_SIZE(x)
  #define __Pyx_PyLong_IsCompact(x)  (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
  #define __Pyx_PyLong_CompactValue(x)\
        ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
  typedef sdigit  __Pyx_compact_pylong;
  typedef digit  __Pyx_compact_upylong;
  #endif
  #if PY_VERSION_HEX >= 0x030C00A5
  #define __Pyx_PyLong_Digits(x)  (((PyLongObject*)x)->long_value.ob_digit)
  #else
  #define __Pyx_PyLong_Digits(x)  (((PyLongObject*)x)->ob_digit)
  #endif
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL)
#else
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#endif


/* Test for GCC > 2.95 */
#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  #define likely(x)   __builtin_expect(!!(x), 1)
  #define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */
/* PretendToInitialize */
#ifdef __cplusplus
#include <type_traits>
template <typename T>
static void __Pyx_pretend_to_initialize(T* ptr) {
#if __cplusplus > 201103L
    if ((std::is_trivially_default_constructible<T>::value))
#endif
        *ptr = T();
    (void)ptr;
}
#else
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
#endif


#if !CYTHON_USE_MODULE_STATE
static PyObject *__pyx_m = NULL;
#endif
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * const __pyx_cfilenm = __FILE__;
static const char *__pyx_filename;

/* Header.proto */
#if !defined(CYTHON_CCOMPLEX)
  #if defined(__cplusplus)
    #define CYTHON_CCOMPLEX 1
  #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER))
    #define CYTHON_CCOMPLEX 1
  #else
    #define CYTHON_CCOMPLEX 0
  #endif
#endif
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #include <complex>
  #else
    #include <complex.h>
  #endif
#endif
#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
  #undef _Complex_I
  #define _Complex_I 1.0fj
#endif

/* #### Code section: filename_table ### */

static const char* const __pyx_f[] = {
  "nltkor/tag/libs/network.pyx",
  "nltkor/tag/libs/networkconv.pyx",
  "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd",
  "cpython/contextvars.pxd",
  "<stringsource>",
  "nltkor/tag/libs/networkdependencyconv.pyx",
  "cpython/type.pxd",
  "cpython/bool.pxd",
  "cpython/complex.pxd",
};
/* #### Code section: utility_code_proto_before_types ### */
/* Profile_config.proto */
#ifndef CYTHON_PROFILE
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
  #define CYTHON_PROFILE 0
#else
  #define CYTHON_PROFILE 1
#endif
#endif
#ifndef CYTHON_TRACE_NOGIL
  #define CYTHON_TRACE_NOGIL 0
#else
  #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
    #define CYTHON_TRACE 1
  #endif
#endif
#ifndef CYTHON_TRACE
  #define CYTHON_TRACE 0
#endif
#if CYTHON_PROFILE || CYTHON_TRACE
#if CYTHON_USE_SYS_MONITORING
    typedef enum {
        __Pyx_Monitoring_PY_START = 0,
        __Pyx_Monitoring_PY_RETURN,
        __Pyx_Monitoring_PY_UNWIND,
        __Pyx_Monitoring_LINE,
        __Pyx_Monitoring_RAISE,
        __Pyx_Monitoring_RERAISE,
        __Pyx_Monitoring_EXCEPTION_HANDLED,
        __Pyx_Monitoring_PY_RESUME,
        __Pyx_Monitoring_PY_YIELD,
        __Pyx_Monitoring_STOP_ITERATION,
    } __Pyx_Monitoring_Event_Index;
    static const unsigned char __Pyx_MonitoringEventTypes[] = {
        PY_MONITORING_EVENT_PY_START,
        PY_MONITORING_EVENT_PY_RETURN,
        PY_MONITORING_EVENT_PY_UNWIND,
        PY_MONITORING_EVENT_LINE,
        PY_MONITORING_EVENT_RAISE,
        PY_MONITORING_EVENT_RERAISE,
        PY_MONITORING_EVENT_EXCEPTION_HANDLED,
        PY_MONITORING_EVENT_PY_RESUME,
        PY_MONITORING_EVENT_PY_YIELD,
        PY_MONITORING_EVENT_STOP_ITERATION,
    };
    #define __Pyx_MonitoringEventTypes_CyFunc_count (sizeof(__Pyx_MonitoringEventTypes) - 3)
    #define __Pyx_MonitoringEventTypes_CyGen_count (sizeof(__Pyx_MonitoringEventTypes))
#endif
#endif

/* BufferFormatStructs.proto */
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
typedef struct {
  const char* name;
  const struct __Pyx_StructField_* fields;
  size_t size;
  size_t arraysize[8];
  int ndim;
  char typegroup;
  char is_unsigned;
  int flags;
} __Pyx_TypeInfo;
typedef struct __Pyx_StructField_ {
  const __Pyx_TypeInfo* type;
  const char* name;
  size_t offset;
} __Pyx_StructField;
typedef struct {
  const __Pyx_StructField* field;
  size_t parent_offset;
} __Pyx_BufFmt_StackElem;
typedef struct {
  __Pyx_StructField root;
  __Pyx_BufFmt_StackElem* head;
  size_t fmt_offset;
  size_t new_count, enc_count;
  size_t struct_alignment;
  int is_complex;
  char enc_type;
  char new_packmode;
  char enc_packmode;
  char is_valid_array;
} __Pyx_BufFmt_Context;

/* Atomics.proto */
#include <pythread.h>
#ifndef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 1
#endif
#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __pyx_atomic_int_type int
#define __pyx_nonatomic_int_type int
#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
                        (__STDC_VERSION__ >= 201112L) &&\
                        !defined(__STDC_NO_ATOMICS__))
    #include <stdatomic.h>
#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
                    (__cplusplus >= 201103L) ||\
                    (defined(_MSC_VER) && _MSC_VER >= 1700)))
    #include <atomic>
#endif
#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
                        (__STDC_VERSION__ >= 201112L) &&\
                        !defined(__STDC_NO_ATOMICS__) &&\
                       ATOMIC_INT_LOCK_FREE == 2)
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type atomic_int
    #define __pyx_atomic_ptr_type atomic_uintptr_t
    #define __pyx_nonatomic_ptr_type uintptr_t
    #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
    #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel)
    #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
    #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
    #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
    #define __pyx_atomic_load(value) atomic_load(value)
    #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed)
    #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire)
    #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
    #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
        #pragma message ("Using standard C atomics")
    #elif defined(__PYX_DEBUG_ATOMICS)
        #warning "Using standard C atomics"
    #endif
#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
                    (__cplusplus >= 201103L) ||\
\
                    (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
                    ATOMIC_INT_LOCK_FREE == 2)
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type std::atomic_int
    #define __pyx_atomic_ptr_type std::atomic_uintptr_t
    #define __pyx_nonatomic_ptr_type uintptr_t
    #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
    #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel)
    #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
    #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg)
    #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
    #define __pyx_atomic_load(value) std::atomic_load(value)
    #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed)
    #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire)
    #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
    #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
        #pragma message ("Using standard C++ atomics")
    #elif defined(__PYX_DEBUG_ATOMICS)
        #warning "Using standard C++ atomics"
    #endif
#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
                    (__GNUC_MINOR__ > 1 ||\
                    (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
    #define __pyx_atomic_ptr_type void*
    #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1)
    #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1)
    #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1)
    #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg)
    static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
        __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value)
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Using GNU atomics"
    #endif
#elif CYTHON_ATOMICS && defined(_MSC_VER)
    #include <intrin.h>
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type long
    #define __pyx_atomic_ptr_type void*
    #undef __pyx_nonatomic_int_type
    #define __pyx_nonatomic_int_type long
    #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer)
    #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1)
    #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1)
    #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1)
    #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg)
    static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
        __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0)
    #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value
    #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0)
    #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value)
    #ifdef __PYX_DEBUG_ATOMICS
        #pragma message ("Using MSVC atomics")
    #endif
#else
    #undef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 0
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Not using atomics"
    #endif
#endif
#if CYTHON_ATOMICS
    #define __pyx_add_acquisition_count(memview)\
             __pyx_atomic_incr_relaxed(__pyx_get_slice_count_pointer(memview))
    #define __pyx_sub_acquisition_count(memview)\
            __pyx_atomic_decr_acq_rel(__pyx_get_slice_count_pointer(memview))
#else
    #define __pyx_add_acquisition_count(memview)\
            __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
    #define __pyx_sub_acquisition_count(memview)\
            __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
#endif

/* IncludeStructmemberH.proto */
#include <structmember.h>

/* CriticalSections.proto */
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyCriticalSection void*
#define __Pyx_PyCriticalSection2 void*
#define __Pyx_PyCriticalSection_Begin1(cs, arg) (void)cs
#define __Pyx_PyCriticalSection_Begin2(cs, arg1, arg2) (void)cs
#define __Pyx_PyCriticalSection_End1(cs)
#define __Pyx_PyCriticalSection_End2(cs)
#else
#define __Pyx_PyCriticalSection PyCriticalSection
#define __Pyx_PyCriticalSection2 PyCriticalSection2
#define __Pyx_PyCriticalSection_Begin1 PyCriticalSection_Begin
#define __Pyx_PyCriticalSection_Begin2 PyCriticalSection2_Begin
#define __Pyx_PyCriticalSection_End1 PyCriticalSection_End
#define __Pyx_PyCriticalSection_End2 PyCriticalSection2_End
#endif
#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_BEGIN_CRITICAL_SECTION(o) {
#define __Pyx_END_CRITICAL_SECTION() }
#else
#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
#endif

/* #### Code section: numeric_typedefs ### */

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":730
 * # in Cython to enable them only on the right systems.
 * 
 * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
*/
typedef npy_int8 __pyx_t_5numpy_int8_t;

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":731
 * 
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t
*/
typedef npy_int16 __pyx_t_5numpy_int16_t;

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":732
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int64      int64_t
 * #ctypedef npy_int96      int96_t
*/
typedef npy_int32 __pyx_t_5numpy_int32_t;

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":733
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_int96      int96_t
 * #ctypedef npy_int128     int128_t
*/
typedef npy_int64 __pyx_t_5numpy_int64_t;

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":737
 * #ctypedef npy_int128     int128_t
 * 
 * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
*/
typedef npy_uint8 __pyx_t_5numpy_uint8_t;

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":738
 * 
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t
*/
typedef npy_uint16 __pyx_t_5numpy_uint16_t;

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":739
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint64     uint64_t
 * #ctypedef npy_uint96     uint96_t
*/
typedef npy_uint32 __pyx_t_5numpy_uint32_t;

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":740
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_uint96     uint96_t
 * #ctypedef npy_uint128    uint128_t
*/
typedef npy_uint64 __pyx_t_5numpy_uint64_t;

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":744
 * #ctypedef npy_uint128    uint128_t
 * 
 * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_float64    float64_t
 * #ctypedef npy_float80    float80_t
*/
typedef npy_float32 __pyx_t_5numpy_float32_t;

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":745
 * 
 * ctypedef npy_float32    float32_t
 * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_float80    float80_t
 * #ctypedef npy_float128   float128_t
*/
typedef npy_float64 __pyx_t_5numpy_float64_t;

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":754
 * # The int types are mapped a bit surprising --
 * # numpy.int corresponds to 'l' and numpy.long to 'q'
 * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longlong   longlong_t
 * 
*/
typedef npy_long __pyx_t_5numpy_int_t;

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":755
 * # numpy.int corresponds to 'l' and numpy.long to 'q'
 * ctypedef npy_long       int_t
 * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_ulong      uint_t
*/
typedef npy_longlong __pyx_t_5numpy_longlong_t;

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":757
 * ctypedef npy_longlong   longlong_t
 * 
 * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulonglong_t
 * 
*/
typedef npy_ulong __pyx_t_5numpy_uint_t;

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":758
 * 
 * ctypedef npy_ulong      uint_t
 * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_intp       intp_t
*/
typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":760
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uintp      uintp_t
 * 
*/
typedef npy_intp __pyx_t_5numpy_intp_t;

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":761
 * 
 * ctypedef npy_intp       intp_t
 * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_double     float_t
*/
typedef npy_uintp __pyx_t_5numpy_uintp_t;

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":763
 * ctypedef npy_uintp      uintp_t
 * 
 * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t
*/
typedef npy_double __pyx_t_5numpy_float_t;

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":764
 * 
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longdouble longdouble_t
 * 
*/
typedef npy_double __pyx_t_5numpy_double_t;

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":765
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_cfloat      cfloat_t
*/
typedef npy_longdouble __pyx_t_5numpy_longdouble_t;

/* "nltkor/tag/libs/network.pyx":20
 * 
 * #ctypedef float FLOAT_t
 * ctypedef np.float_t FLOAT_t             # <<<<<<<<<<<<<<
 * #ctypedef int INT_t
 * ctypedef np.int_t INT_t
*/
typedef __pyx_t_5numpy_float_t __pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t;

/* "nltkor/tag/libs/network.pyx":22
 * ctypedef np.float_t FLOAT_t
 * #ctypedef int INT_t
 * ctypedef np.int_t INT_t             # <<<<<<<<<<<<<<
 * ctypedef np.double_t DOUBLE_t
 * 
*/
typedef __pyx_t_5numpy_int_t __pyx_t_6nltkor_3tag_4libs_7network_INT_t;

/* "nltkor/tag/libs/network.pyx":23
 * #ctypedef int INT_t
 * ctypedef np.int_t INT_t
 * ctypedef np.double_t DOUBLE_t             # <<<<<<<<<<<<<<
 * 
 * # ----------------------------------------------------------------------
*/
typedef __pyx_t_5numpy_double_t __pyx_t_6nltkor_3tag_4libs_7network_DOUBLE_t;
/* #### Code section: complex_type_declarations ### */
/* Declarations.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
  #ifdef __cplusplus
    typedef ::std::complex< float > __pyx_t_float_complex;
  #else
    typedef float _Complex __pyx_t_float_complex;
  #endif
#else
    typedef struct { float real, imag; } __pyx_t_float_complex;
#endif
static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);

/* Declarations.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
  #ifdef __cplusplus
    typedef ::std::complex< double > __pyx_t_double_complex;
  #else
    typedef double _Complex __pyx_t_double_complex;
  #endif
#else
    typedef struct { double real, imag; } __pyx_t_double_complex;
#endif
static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);

/* #### Code section: type_declarations ### */

/*--- Type declarations ---*/
struct __pyx_obj_6nltkor_3tag_4libs_7network_Network;
struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork;
struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork;
struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr;
struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr;
struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr;
struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr;
struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr;
struct __pyx_opt_args_7cpython_11contextvars_get_value;
struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default;

/* "cpython/contextvars.pxd":116
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 * cdef inline object get_value(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the default value of the context variable,
*/
struct __pyx_opt_args_7cpython_11contextvars_get_value {
  int __pyx_n;
  PyObject *default_value;
};

/* "cpython/contextvars.pxd":134
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 * cdef inline object get_value_no_default(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the provided default value if no such value was found.
*/
struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default {
  int __pyx_n;
  PyObject *default_value;
};

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":767
 * ctypedef npy_longdouble longdouble_t
 * 
 * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
 * ctypedef npy_cdouble     cdouble_t
 * ctypedef npy_clongdouble clongdouble_t
*/
typedef npy_cfloat __pyx_t_5numpy_cfloat_t;

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":768
 * 
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
 * ctypedef npy_clongdouble clongdouble_t
 * 
*/
typedef npy_cdouble __pyx_t_5numpy_cdouble_t;

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":769
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t
 * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_cdouble     complex_t
*/
typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":771
 * ctypedef npy_clongdouble clongdouble_t
 * 
 * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
*/
typedef npy_cdouble __pyx_t_5numpy_complex_t;
struct __pyx_opt_args_6nltkor_3tag_4libs_7network_logsumexp;
struct __pyx_opt_args_6nltkor_3tag_4libs_7network_hardtanh;

/* "nltkor/tag/libs/network.pyx":28
 * # Math functions
 * 
 * cdef logsumexp(np.ndarray a, axis=None):             # <<<<<<<<<<<<<<
 *     """Compute the log of the sum of exponentials of input elements.
 *     like: scipy.misc.logsumexp
*/
struct __pyx_opt_args_6nltkor_3tag_4libs_7network_logsumexp {
  int __pyx_n;
  PyObject *axis;
};

/* "nltkor/tag/libs/network.pyx":53
 *     return np.log(np.sum(np.exp(a - a_max), axis=0)) + a_max
 * 
 * cdef hardtanh(np.ndarray weights, inplace=False):             # <<<<<<<<<<<<<<
 *     """
 *     Hard hyperbolic tangent.
*/
struct __pyx_opt_args_6nltkor_3tag_4libs_7network_hardtanh {
  int __pyx_n;
  PyObject *inplace;
};

/* "nltkor/tag/libs/network.pyx":79
 * # ----------------------------------------------------------------------
 * 
 * cdef class Network:             # <<<<<<<<<<<<<<
 * 
 *     # sizes and learning rates
*/
struct __pyx_obj_6nltkor_3tag_4libs_7network_Network {
  PyObject_HEAD
  int word_window_size;
  int input_size;
  int hidden_size;
  int output_size;
  float learning_rate;
  float learning_rate_features;
  float decay_factor;
  PyLongObject *use_learning_rate_decay;
  int features_per_token;
  PyArrayObject *sentence_lookup;
  PyArrayObject *padding_left;
  PyArrayObject *padding_right;
  PyArrayObject *pre_padding;
  PyArrayObject *pos_padding;
  PyArrayObject *hidden_weights;
  PyArrayObject *output_weights;
  PyArrayObject *hidden_bias;
  PyArrayObject *output_bias;
  PyArrayObject *input_values;
  PyArrayObject *hidden_values;
  PyArrayObject *layer2_values;
  PyObject *feature_tables;
  float learning_rate_trans;
  PyArrayObject *transitions;
  float answer_score;
  PyArrayObject *net_gradients;
  PyArrayObject *trans_gradients;
  PyArrayObject *input_sent_values;
  PyArrayObject *hidden_sent_values;
  PyArrayObject *layer2_sent_values;
  float error;
  float accuracy;
  float float_errors;
  float sentence_accuracy;
  int num_tokens;
  int skips;
  PyObject *network_filename;
  PyObject *network_text_filename;
  PyObject *validation_sentences;
  PyObject *validation_tags;
};


/* "nltkor/tag/libs/networkconv.pyx":11
 * cimport numpy as np
 * 
 * cdef class ConvolutionalNetwork(Network):             # <<<<<<<<<<<<<<
 * 
 *     # transition and distance feature tables
*/
struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork {
  struct __pyx_obj_6nltkor_3tag_4libs_7network_Network __pyx_base;
  struct __pyx_vtabstruct_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_vtab;
  PyArrayObject *target_dist_table;
  PyArrayObject *pred_dist_table;
  PyArrayObject *target_dist_weights;
  PyArrayObject *pred_dist_weights;
  int target_dist_offset;
  int pred_dist_offset;
  PyArrayObject *target_dist_lookup;
  PyArrayObject *pred_dist_lookup;
  PyArrayObject *target_convolution_lookup;
  PyArrayObject *pred_convolution_lookup;
  PyArrayObject *target_dist_deltas;
  PyArrayObject *pred_dist_deltas;
  int hidden2_size;
  PyArrayObject *hidden2_weights;
  PyArrayObject *hidden2_bias;
  PyArrayObject *hidden2_values;
  PyArrayObject *hidden2_before_activation;
  PyArrayObject *hidden_before_activation;
  PyArrayObject *convolution_lookup;
  PyArrayObject *max_indices;
  int num_targets;
  PyLongObject *only_classify;
  int half_window;
  PyArrayObject *hidden_gradients;
  PyArrayObject *hidden2_gradients;
  PyArrayObject *input_deltas;
  int num_sentences;
  PyObject *validation_predicates;
  PyObject *validation_arguments;
};


/* "nltkor/tag/libs/networkdependencyconv.pyx":11
 * cimport numpy as np
 * 
 * cdef class ConvolutionalDependencyNetwork(ConvolutionalNetwork):             # <<<<<<<<<<<<<<
 * 
 *     # the weights of all possible dependency among tokens
*/
struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork {
  struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork __pyx_base;
  PyArrayObject *dependency_weights;
  PyObject *validation_heads;
};


/* "nltkor/tag/libs/network.pyx":133
 *         """
 *         # sum the number of features in all tables
 *         cdef int input_size = sum(table.shape[1] for table in feature_tables)             # <<<<<<<<<<<<<<
 *         input_size *= word_window
 * 
*/
struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_table;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "nltkor/tag/libs/network.pyx":617
 *         last_accuracy = 0
 *         last_error = np.Infinity
 *         self.num_tokens = sum(len(sent) for sent in sentences)             # <<<<<<<<<<<<<<
 * 
 *         if self.validation_sentences is None:
*/
struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_sent;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
};


/* "nltkor/tag/libs/network.pyx":702
 * 
 *         # self.num_tokens stores number of tokens in training sentences
 *         num_tokens = sum(len(sent) for sent in self.validation_sentences)             # <<<<<<<<<<<<<<
 *         self.accuracy = float(hits) / num_tokens
 * 
*/
struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_sent;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
};


/* "nltkor/tag/libs/networkconv.pyx":56
 *         """Creates a new convolutional neural network."""
 *         # sum the number of features in all tables except for distance
 *         cdef int input_size = sum(table.shape[1] for table in feature_tables)             # <<<<<<<<<<<<<<
 *         input_size *= word_window
 * 
*/
struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_table;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "nltkor/tag/libs/networkconv.pyx":288
 *         """
 *         self.num_sentences = len(sentences)
 *         self.num_tokens = sum(len(sent) for sent in sentences)             # <<<<<<<<<<<<<<
 *         self.only_classify = arguments is not None
 * 
*/
struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_sent;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
};



/* "nltkor/tag/libs/networkconv.pyx":11
 * cimport numpy as np
 * 
 * cdef class ConvolutionalNetwork(Network):             # <<<<<<<<<<<<<<
 * 
 *     # transition and distance feature tables
*/

struct __pyx_vtabstruct_6nltkor_3tag_4libs_7network_ConvolutionalNetwork {
  PyArrayObject *(*argument_distances)(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *, PyObject *, PyObject *);
};
static struct __pyx_vtabstruct_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_vtabptr_6nltkor_3tag_4libs_7network_ConvolutionalNetwork;


/* "nltkor/tag/libs/networkdependencyconv.pyx":11
 * cimport numpy as np
 * 
 * cdef class ConvolutionalDependencyNetwork(ConvolutionalNetwork):             # <<<<<<<<<<<<<<
 * 
 *     # the weights of all possible dependency among tokens
*/

struct __pyx_vtabstruct_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork {
  struct __pyx_vtabstruct_6nltkor_3tag_4libs_7network_ConvolutionalNetwork __pyx_base;
};
static struct __pyx_vtabstruct_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_vtabptr_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork;
/* #### Code section: utility_code_proto ### */

/* --- Runtime support code (head) --- */
/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, Py_ssize_t);
    void (*DECREF)(void*, PyObject*, Py_ssize_t);
    void (*GOTREF)(void*, PyObject*, Py_ssize_t);
    void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
    void* (*SetupContext)(const char*, Py_ssize_t, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          if (acquire_gil) {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
              PyGILState_Release(__pyx_gilstate_save);\
          } else {\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
          }
  #define __Pyx_RefNannyFinishContextNogil() {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __Pyx_RefNannyFinishContext();\
              PyGILState_Release(__pyx_gilstate_save);\
          }
  #define __Pyx_RefNannyFinishContextNogil() {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __Pyx_RefNannyFinishContext();\
              PyGILState_Release(__pyx_gilstate_save);\
          }
  #define __Pyx_RefNannyFinishContext()\
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  #define __Pyx_XINCREF(r)  do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContextNogil()
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif
#define __Pyx_Py_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; Py_XDECREF(tmp);\
    } while (0)
#define __Pyx_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_XDECREF(tmp);\
    } while (0)
#define __Pyx_DECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_DECREF(tmp);\
    } while (0)
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

/* PyErrExceptionMatches.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
#else
#define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
#endif

/* PyThreadStateGet.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
#if PY_VERSION_HEX >= 0x030C00A6
#define __Pyx_PyErr_Occurred()  (__pyx_tstate->current_exception != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
#else
#define __Pyx_PyErr_Occurred()  (__pyx_tstate->curexc_type != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  (__pyx_tstate->curexc_type)
#endif
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#define __Pyx_PyErr_Occurred()  (PyErr_Occurred() != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  PyErr_Occurred()
#endif

/* PyErrFetchRestore.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
#define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
#else
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#endif
#else
#define __Pyx_PyErr_Clear() PyErr_Clear()
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
#endif

/* PyObjectGetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

/* PyObjectGetAttrStrNoError.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);

/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);

/* GetTopmostException.proto */
#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
#endif

/* SaveResetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
#else
#define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
#define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
#endif

/* GetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#if !CYTHON_VECTORCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
    __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs);
#endif
#define __Pyx_BUILD_ASSERT_EXPR(cond)\
    (sizeof(char [1 - 2*!(cond)]) - 1)
#ifndef Py_MEMBER_SIZE
#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
#endif
#if !CYTHON_VECTORCALL
#if PY_VERSION_HEX >= 0x03080000
  #include "frameobject.h"
  #define __Pxy_PyFrame_Initialize_Offsets()
  #define __Pyx_PyFrame_GetLocalsplus(frame)  ((frame)->f_localsplus)
#else
  static size_t __pyx_pyframe_localsplus_offset = 0;
  #include "frameobject.h"
  #define __Pxy_PyFrame_Initialize_Offsets()\
    ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
     (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
  #define __Pyx_PyFrame_GetLocalsplus(frame)\
    (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
#endif
#endif
#endif

/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif

/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

/* PyObjectFastCall.proto */
#define __Pyx_PyObject_FastCall(func, args, nargs)  __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs);

/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);

/* Profile.proto */
#if CYTHON_TRACE
  #undef CYTHON_PROFILE_REUSE_FRAME
#endif
#if CYTHON_USE_MODULE_STATE
  #undef CYTHON_PROFILE_REUSE_CODEOBJ
  #define CYTHON_PROFILE_REUSE_CODEOBJ 0
  #undef CYTHON_PROFILE_REUSE_FRAME
#endif
#ifndef CYTHON_PROFILE_REUSE_CODEOBJ
  #define CYTHON_PROFILE_REUSE_CODEOBJ 1
#endif
#ifndef CYTHON_PROFILE_REUSE_FRAME
  #define CYTHON_PROFILE_REUSE_FRAME 0
#endif
#if CYTHON_USE_SYS_MONITORING && (CYTHON_PROFILE || CYTHON_TRACE)
  #define __PYX_MONITORING_ABI_SUFFIX  "_mon"
#else
  #define __PYX_MONITORING_ABI_SUFFIX
#endif
#if CYTHON_PROFILE || CYTHON_TRACE
#if CYTHON_USE_SYS_MONITORING
  typedef uint64_t __pyx_monitoring_version_type;
  #define __Pyx_TraceDeclarationsFunc\
      PyObject *__pyx_frame_code = NULL;\
      PyMonitoringState __pyx_pymonitoring_state[__Pyx_MonitoringEventTypes_CyFunc_count];\
      int __pyx_exception_already_reported = 0;\
      const int __pyx_sys_monitoring_disabled_in_parallel = 0; CYTHON_UNUSED_VAR(__pyx_sys_monitoring_disabled_in_parallel);
  #define __Pyx_TraceDeclarationsGen\
      PyObject *__pyx_frame_code = Py_NewRef(__pyx_generator->gi_code);\
      PyMonitoringState* __pyx_pymonitoring_state = __pyx_generator->__pyx_pymonitoring_state;\
      __pyx_monitoring_version_type __pyx_pymonitoring_version = __pyx_generator->__pyx_pymonitoring_version;\
      int __pyx_exception_already_reported = 0;\
      const int __pyx_sys_monitoring_disabled_in_parallel = 0; CYTHON_UNUSED_VAR(__pyx_sys_monitoring_disabled_in_parallel);
  #define __Pyx_IsTracing(event_id)  ((!__pyx_sys_monitoring_disabled_in_parallel) && (__pyx_pymonitoring_state[event_id]).active)
  #define __Pyx_TraceFrameInit(codeobj)\
      if (codeobj) __pyx_frame_code = codeobj;
  #define __Pyx_TurnOffSysMonitoringInParallel\
    const int __pyx_sys_monitoring_disabled_in_parallel = 1;\
    CYTHON_UNUSED_VAR(__pyx_sys_monitoring_disabled_in_parallel);
  CYTHON_UNUSED static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno);
  CYTHON_UNUSED static int __Pyx__TraceStartFunc(PyMonitoringState *state_array, PyObject *code_obj, int offset, int skip_event);
  CYTHON_UNUSED static int __Pyx__TraceStartGen(PyMonitoringState *state_array, __pyx_monitoring_version_type *version, PyObject *code_obj, int offset);
  CYTHON_UNUSED static int __Pyx__TraceResumeGen(PyMonitoringState *state_array, __pyx_monitoring_version_type *version, PyObject *code_obj, int offset);
  CYTHON_UNUSED static void __Pyx__TraceException(PyMonitoringState *monitoring_state, PyObject *code_obj, int offset, int reraised);
  #define __Pyx_PyMonitoring_ExitScope(nogil)\
    if (nogil) {\
        (void) __pyx_exception_already_reported;\
        if (CYTHON_TRACE_NOGIL) {\
            PyGILState_STATE state = PyGILState_Ensure();\
            PyMonitoring_ExitScope();\
            Py_XDECREF(__pyx_frame_code);\
            PyGILState_Release(state);\
        }\
    } else {\
        PyMonitoring_ExitScope();\
        Py_XDECREF(__pyx_frame_code);\
    }
  #define __Pyx_TraceStartFunc(funcname, srcfile, firstlineno, offset, nogil, skip_event, goto_error)\
  if ((0) ); else {\
      int ret = 0;\
      memset(__pyx_pymonitoring_state, 0, sizeof(__pyx_pymonitoring_state));\
      if (nogil) {\
          if (CYTHON_TRACE_NOGIL) {\
              PyGILState_STATE state = PyGILState_Ensure();\
              if (!__Pyx_PyThreadState_Current->tracing) {\
                  if (likely(__pyx_frame_code)) Py_INCREF(__pyx_frame_code);\
                  else __pyx_frame_code = (PyObject*) __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);\
                  if (unlikely(!__pyx_frame_code)) goto_error;\
                  ret = __Pyx__TraceStartFunc(__pyx_pymonitoring_state, __pyx_frame_code, offset, skip_event);\
              }\
              PyGILState_Release(state);\
          }\
      } else {\
          if (!__Pyx_PyThreadState_Current->tracing) {\
              if (likely(__pyx_frame_code)) Py_INCREF(__pyx_frame_code);\
              else __pyx_frame_code = (PyObject*) __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);\
              if (unlikely(!__pyx_frame_code)) goto_error;\
              ret = __Pyx__TraceStartFunc(__pyx_pymonitoring_state, __pyx_frame_code, offset, skip_event);\
          }\
      }\
      if (unlikely(ret == -1)) goto_error;\
  }
  #define __Pyx_TraceStartGen(funcname, srcfile, firstlineno, offset, nogil, skip_event, goto_error)\
  if ((0) ); else {\
      int ret = __Pyx__TraceStartGen(__pyx_pymonitoring_state, &__pyx_pymonitoring_version, __pyx_frame_code, offset);\
      if (unlikely(ret == -1)) goto_error;\
  }
  #define __Pyx_TraceResumeGen(funcname, srcfile, firstlineno, offset, goto_error)\
  if ((0) ); else {\
      int ret = __Pyx__TraceResumeGen(__pyx_pymonitoring_state, &__pyx_pymonitoring_version, __pyx_frame_code, offset);\
      if (unlikely(ret == -1)) goto_error;\
  }
  #define __Pyx_TraceYield(result, offset, goto_error)\
  if (!__Pyx_IsTracing(__Pyx_Monitoring_PY_YIELD)); else {\
      int ret = PyMonitoring_FirePyYieldEvent(&__pyx_pymonitoring_state[__Pyx_Monitoring_PY_RETURN], __pyx_frame_code, offset, result);\
      PyMonitoring_ExitScope();\
      if (unlikely(ret == -1)) goto_error;\
  }
  #define __Pyx_TraceException(offset, reraised, fresh)\
  if (!__Pyx_IsTracing((reraised) ? __Pyx_Monitoring_RERAISE : __Pyx_Monitoring_RAISE)); else {\
      if (fresh || reraised || !__pyx_exception_already_reported) {\
          __Pyx__TraceException(&__pyx_pymonitoring_state[(reraised) ? __Pyx_Monitoring_RERAISE : __Pyx_Monitoring_RAISE], __pyx_frame_code, offset, reraised);\
      }\
      __pyx_exception_already_reported = 1;\
  }
  #define __Pyx_TraceExceptionDone()  __pyx_exception_already_reported = 0
  #define __Pyx_TraceExceptionHandled(offset)\
  if (!__Pyx_IsTracing(__Pyx_Monitoring_EXCEPTION_HANDLED)); else {\
      (void) PyMonitoring_FireExceptionHandledEvent(&__pyx_pymonitoring_state[__Pyx_Monitoring_EXCEPTION_HANDLED], __pyx_frame_code, offset);\
      __pyx_exception_already_reported = 0;\
  }
  #define __Pyx_TraceReturnValue(result, offset, nogil, goto_error)\
  if (!__Pyx_IsTracing(__Pyx_Monitoring_PY_RETURN)); else {\
      int ret = 0;\
      if (nogil) {\
          if (CYTHON_TRACE_NOGIL) {\
              PyGILState_STATE state = PyGILState_Ensure();\
              ret = PyMonitoring_FirePyReturnEvent(&__pyx_pymonitoring_state[__Pyx_Monitoring_PY_RETURN], __pyx_frame_code, offset, result);\
              PyGILState_Release(state);\
          }\
      } else {\
          ret = PyMonitoring_FirePyReturnEvent(&__pyx_pymonitoring_state[__Pyx_Monitoring_PY_RETURN], __pyx_frame_code, offset, result);\
      }\
      if (unlikely(ret == -1)) goto_error;\
  }
  #define __Pyx_TraceReturnCValue(cresult, convert_function, offset, nogil, goto_error)\
  if (!__Pyx_IsTracing(__Pyx_Monitoring_PY_RETURN)); else {\
      int ret = 0;\
      if (nogil) {\
          if (CYTHON_TRACE_NOGIL) {\
              PyGILState_STATE state = PyGILState_Ensure();\
              PyObject *pyvalue = convert_function(cresult);\
              if (unlikely(!pyvalue)) {\
                  PyErr_Clear();\
                  pyvalue = Py_None; Py_INCREF(Py_None);\
              }\
              ret = PyMonitoring_FirePyReturnEvent(&__pyx_pymonitoring_state[__Pyx_Monitoring_PY_RETURN], __pyx_frame_code, offset, pyvalue);\
              Py_DECREF(pyvalue);\
              PyGILState_Release(state);\
          }\
      } else {\
          PyObject *pyvalue = convert_function(cresult);\
          if (unlikely(!pyvalue)) {\
              PyErr_Clear();\
              pyvalue = Py_None; Py_INCREF(Py_None);\
          }\
          ret = PyMonitoring_FirePyReturnEvent(&__pyx_pymonitoring_state[__Pyx_Monitoring_PY_RETURN], __pyx_frame_code, offset, pyvalue);\
          Py_DECREF(pyvalue);\
      }\
      if (unlikely(ret == -1)) goto_error;\
  }
  #define __Pyx_TraceExceptionUnwind(offset, nogil)\
  if (!__Pyx_IsTracing(__Pyx_Monitoring_PY_UNWIND)); else {\
      if (nogil) {\
          if (CYTHON_TRACE_NOGIL) {\
              PyGILState_STATE state = PyGILState_Ensure();\
              (void) PyMonitoring_FirePyUnwindEvent(&__pyx_pymonitoring_state[__Pyx_Monitoring_PY_UNWIND], __pyx_frame_code, offset);\
              PyGILState_Release(state);\
          }\
      } else {\
          (void) PyMonitoring_FirePyUnwindEvent(&__pyx_pymonitoring_state[__Pyx_Monitoring_PY_UNWIND], __pyx_frame_code, offset);\
      }\
  }
  #if CYTHON_TRACE
  CYTHON_UNUSED static int __Pyx__TraceLine(PyMonitoringState *monitoring_state, PyObject *code_obj, int line, int offset);
  #define __Pyx_TraceLine(line, offset, nogil, goto_error)\
  if (!__Pyx_IsTracing(__Pyx_Monitoring_LINE)); else {\
      int ret = 0;\
      if (nogil) {\
          if (CYTHON_TRACE_NOGIL) {\
              PyGILState_STATE state = PyGILState_Ensure();\
              ret = __Pyx__TraceLine(&__pyx_pymonitoring_state[__Pyx_Monitoring_LINE], __pyx_frame_code, line, offset);\
              PyGILState_Release(state);\
          }\
      } else {\
          ret = __Pyx__TraceLine(&__pyx_pymonitoring_state[__Pyx_Monitoring_LINE], __pyx_frame_code, line, offset);\
      }\
      if (unlikely(ret == -1)) goto_error;\
  }
  #endif
#else
  #include "compile.h"
  #include "frameobject.h"
  #include "traceback.h"
#if PY_VERSION_HEX >= 0x030b00a6 && !defined(PYPY_VERSION)
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
  #if CYTHON_PROFILE_REUSE_FRAME
    #define CYTHON_FRAME_MODIFIER static
    #define CYTHON_FRAME_DEL(frame)
  #else
    #define CYTHON_FRAME_MODIFIER
    #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
  #endif
  #if CYTHON_PROFILE_REUSE_CODEOBJ
    #define CYTHON_CODEOBJ_MODIFIER static
  #else
    #define CYTHON_CODEOBJ_MODIFIER
  #endif
  #define __Pyx_TraceDeclarationsFunc\
      CYTHON_CODEOBJ_MODIFIER PyCodeObject *__pyx_frame_code = NULL;\
      CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
      int __Pyx_use_tracing = 0;
  #define __Pyx_TraceDeclarationsGen\
      PyObject *__pyx_frame_code = __pyx_generator->gi_code;\
      CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
      int __Pyx_use_tracing = 0;
  #define __Pyx_TraceFrameInit(codeobj)\
      if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
  #define __Pyx_PyMonitoring_ExitScope(nogil)  {}
  #define __Pyx_TraceException(offset, reraised, fresh)  {}
  #define __Pyx_TraceExceptionHandled(offset)  {}
  #define __Pyx_TraceExceptionDone()  {}
  #define __Pyx_TurnOffSysMonitoringInParallel {} // Only needed for freethreading
#if PY_VERSION_HEX >= 0x030b00a2
  #if PY_VERSION_HEX >= 0x030C00b1
  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
     ((!(check_tracing) || !(tstate)->tracing) &&\
         (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
  #else
  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
     (unlikely((tstate)->cframe->use_tracing) &&\
         (!(check_tracing) || !(tstate)->tracing) &&\
         (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
  #endif
  #define __Pyx_EnterTracing(tstate)  PyThreadState_EnterTracing(tstate)
  #define __Pyx_LeaveTracing(tstate)  PyThreadState_LeaveTracing(tstate)
#elif PY_VERSION_HEX >= 0x030a00b1
  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
     (unlikely((tstate)->cframe->use_tracing) &&\
         (!(check_tracing) || !(tstate)->tracing) &&\
         (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
  #define __Pyx_EnterTracing(tstate)\
      do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0)
  #define __Pyx_LeaveTracing(tstate)\
      do {\
          tstate->tracing--;\
          tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
                                 || tstate->c_profilefunc != NULL);\
      } while (0)
#else
  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
     (unlikely((tstate)->use_tracing) &&\
         (!(check_tracing) || !(tstate)->tracing) &&\
         (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
  #define __Pyx_EnterTracing(tstate)\
      do { tstate->tracing++; tstate->use_tracing = 0; } while (0)
  #define __Pyx_LeaveTracing(tstate)\
      do {\
          tstate->tracing--;\
          tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
                                         || tstate->c_profilefunc != NULL);\
      } while (0)
#endif
  #define __Pyx_TraceStartFunc(funcname, srcfile, firstlineno, offset, nogil, skip_event, goto_error)\
  if (nogil) {\
      if (CYTHON_TRACE_NOGIL) {\
          PyThreadState *tstate;\
          PyGILState_STATE state = PyGILState_Ensure();\
          tstate = __Pyx_PyThreadState_Current;\
          if (__Pyx_IsTracing(tstate, 1, 1)) {\
              __Pyx_use_tracing = __Pyx_TraceSetupAndCall((PyCodeObject**)&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno, skip_event);\
          }\
          PyGILState_Release(state);\
          if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
      }\
  } else {\
      PyThreadState* tstate = PyThreadState_GET();\
      if (__Pyx_IsTracing(tstate, 1, 1)) {\
          __Pyx_use_tracing = __Pyx_TraceSetupAndCall((PyCodeObject**)&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno, skip_event);\
          if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
      }\
  }
  #define __Pyx_TraceStartGen __Pyx_TraceStartFunc
  #define __Pyx_TraceYield(result, offset, goto_error)\
  if (likely(!__Pyx_use_tracing)); else {\
      PyThreadState* tstate = __Pyx_PyThreadState_Current;\
      if (__Pyx_IsTracing(tstate, 0, 0)) {\
          __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result, 0);\
      }\
      if ((1)); else goto_error;\
  }
  #define __Pyx_TraceResumeGen(funcname, srcfile, firstlineno, offset, goto_error)\
      __Pyx_TraceStartFunc(funcname, srcfile, firstlineno, offset, 0, 0, goto_error)
  CYTHON_UNUSED static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result, int delete_frame) {
      PyObject *type, *value, *traceback;
      __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
      __Pyx_EnterTracing(tstate);
      if (CYTHON_TRACE && tstate->c_tracefunc)
          tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
      if (tstate->c_profilefunc)
          tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
      if (delete_frame) {
          CYTHON_FRAME_DEL(frame);
      }
      __Pyx_LeaveTracing(tstate);
      __Pyx_ErrRestoreInState(tstate, type, value, traceback);
  }
  #define __Pyx_TraceReturnValue(result, offset, nogil, goto_error)\
  if (likely(!__Pyx_use_tracing)); else {\
      if (nogil) {\
          if (CYTHON_TRACE_NOGIL) {\
              PyThreadState *tstate;\
              PyGILState_STATE state = PyGILState_Ensure();\
              tstate = __Pyx_PyThreadState_Current;\
              if (__Pyx_IsTracing(tstate, 0, 0)) {\
                  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result, 1);\
              }\
              PyGILState_Release(state);\
          }\
      } else {\
          PyThreadState* tstate = __Pyx_PyThreadState_Current;\
          if (__Pyx_IsTracing(tstate, 0, 0)) {\
              __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result, 1);\
          }\
      }\
      if ((1)); else goto_error;\
  }
  #define __Pyx_TraceReturnCValue(cresult, convert_function, offset, nogil, goto_error)\
  if (likely(!__Pyx_use_tracing)); else {\
      if (nogil) {\
          if (CYTHON_TRACE_NOGIL) {\
              PyThreadState *tstate;\
              PyGILState_STATE state = PyGILState_Ensure();\
              tstate = __Pyx_PyThreadState_Current;\
              if (__Pyx_IsTracing(tstate, 0, 0)) {\
                  PyObject *pyvalue = convert_function(cresult);\
                  if (unlikely(!pyvalue)) goto_error;\
                  __Pyx_call_return_trace_func(tstate, __pyx_frame, pyvalue, 1);\
                  Py_DECREF(pyvalue);\
              }\
              PyGILState_Release(state);\
          }\
      } else {\
          PyThreadState* tstate = __Pyx_PyThreadState_Current;\
          if (__Pyx_IsTracing(tstate, 0, 0)) {\
              PyObject *pyvalue = convert_function(cresult);\
              if (unlikely(!pyvalue)) goto_error;\
              __Pyx_call_return_trace_func(tstate, __pyx_frame, pyvalue, 1);\
              Py_DECREF(pyvalue);\
          }\
      }\
  }
  #define __Pyx_TraceExceptionUnwind(offset, nogil)\
  if (likely(!__Pyx_use_tracing)); else {\
      if (nogil) {\
          if (CYTHON_TRACE_NOGIL) {\
              PyThreadState *tstate;\
              PyGILState_STATE state = PyGILState_Ensure();\
              tstate = __Pyx_PyThreadState_Current;\
              if (__Pyx_IsTracing(tstate, 0, 0)) {\
                  __Pyx_call_return_trace_func(tstate, __pyx_frame, Py_None, 1);\
              }\
              PyGILState_Release(state);\
          }\
      } else {\
          PyThreadState* tstate = __Pyx_PyThreadState_Current;\
          if (__Pyx_IsTracing(tstate, 0, 0)) {\
              __Pyx_call_return_trace_func(tstate, __pyx_frame, Py_None, 1);\
          }\
      }\
  }
  static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno, int skip_event);
#if CYTHON_TRACE
  CYTHON_UNUSED static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int line);
  #define __Pyx_TraceLine(line, offset, nogil, goto_error)\
  if (likely(!__Pyx_use_tracing)); else {\
      int ret = 0;\
      if (nogil) {\
          if (CYTHON_TRACE_NOGIL) {\
              PyThreadState *tstate;\
              PyGILState_STATE state = __Pyx_PyGILState_Ensure();\
              tstate = __Pyx_PyThreadState_Current;\
              if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
                  ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, line);\
              }\
              __Pyx_PyGILState_Release(state);\
          }\
      } else {\
          PyThreadState* tstate = __Pyx_PyThreadState_Current;\
          if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
              ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, line);\
          }\
      }\
      if (unlikely(ret)) goto_error;\
  }
#endif
#endif
#else
  #define __Pyx_TraceDeclarationsFunc
  #define __Pyx_TraceDeclarationsGen
  #define __Pyx_TraceExceptionDone()  {}
  #define __Pyx_TraceFrameInit(codeobj)  {}
  #define __Pyx_TurnOffSysMonitoringInParallel {}
  #define __Pyx_PyMonitoring_ExitScope(nogil)  {}
  #define __Pyx_TraceException(offset, reraised, fresh)  {}
  #define __Pyx_TraceExceptionUnwind(offset, nogil)  {}
  #define __Pyx_TraceExceptionHandled(offset)  {}
  #define __Pyx_TraceStartFunc(funcname, srcfile, firstlineno, offset, nogil, skip_event, goto_error)   if ((1)); else goto_error;
  #define __Pyx_TraceStartGen __Pyx_TraceStartFunc
  #define __Pyx_TraceResumeGen(funcname, srcfile, firstlineno, offset, goto_error)   if ((1)); else goto_error;
  #define __Pyx_TraceYield(result, offset, goto_error)   if ((1)); else goto_error;
  #define __Pyx_TraceReturnValue(result, offset, nogil, goto_error)\
      if ((1)); else goto_error;
  #define __Pyx_TraceReturnCValue(cresult, convert_function, offset, nogil, goto_error)\
      if ((1)); else { (void) convert_function; goto_error }
#endif
#if !CYTHON_TRACE
  #define __Pyx_TraceLine(line, offset, nogil, goto_error)   if ((1)); else goto_error;
#endif

/* PyObjectFastCallMethod.proto */
#if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000
#define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL)
#else
static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf);
#endif

/* ExtTypeTest.proto */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);

/* PyDictVersioning.proto */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
#define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
#define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
    (version_var) = __PYX_GET_DICT_VERSION(dict);\
    (cache_var) = (value);
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
        (VAR) = __pyx_dict_cached_value;\
    } else {\
        (VAR) = __pyx_dict_cached_value = (LOOKUP);\
        __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
    }\
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
#else
#define __PYX_GET_DICT_VERSION(dict)  (0)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
#endif

/* GetModuleGlobalName.proto */
#if CYTHON_USE_DICT_VERSIONS
#define __Pyx_GetModuleGlobalName(var, name)  do {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_mstate_global->__pyx_d))) ?\
        (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
        __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
} while(0)
#define __Pyx_GetModuleGlobalNameUncached(var, name)  do {\
    PY_UINT64_T __pyx_dict_version;\
    PyObject *__pyx_dict_cached_value;\
    (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
} while(0)
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
#else
#define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
#define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
#endif

/* PyObjectVectorCallKwBuilder.proto */
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n);
#if CYTHON_VECTORCALL
#if PY_VERSION_HEX >= 0x03090000
#define __Pyx_Object_Vectorcall_CallFromBuilder PyObject_Vectorcall
#else
#define __Pyx_Object_Vectorcall_CallFromBuilder _PyObject_Vectorcall
#endif
#define __Pyx_MakeVectorcallBuilderKwds(n) PyTuple_New(n)
static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n);
static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n);
#else
#define __Pyx_Object_Vectorcall_CallFromBuilder __Pyx_PyObject_FastCallDict
#define __Pyx_MakeVectorcallBuilderKwds(n) __Pyx_PyDict_NewPresized(n)
#define __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n) PyDict_SetItem(builder, key, value)
#define __Pyx_VectorcallBuilder_AddArgStr(key, value, builder, args, n) PyDict_SetItemString(builder, key, value)
#endif

/* PyObjectVectorCallMethodKwBuilder.proto */
#if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000
#define __Pyx_Object_VectorcallMethod_CallFromBuilder PyObject_VectorcallMethod
#else
static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames);
#endif

/* IsLittleEndian.proto */
static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);

/* BufferFormatCheck.proto */
static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
                              __Pyx_BufFmt_StackElem* stack,
                              const __Pyx_TypeInfo* type);

/* BufferGetAndValidate.proto */
#define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\
    ((obj == Py_None || obj == NULL) ?\
    (__Pyx_ZeroBuffer(buf), 0) :\
    __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
static int  __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
  const __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
static void __Pyx_ZeroBuffer(Py_buffer* buf);
static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };

/* TupleAndListFromArray.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
#endif
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
#endif

/* IncludeStringH.proto */
#include <string.h>

/* BytesEquals.proto */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);

/* UnicodeEquals.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);

/* fastcall.proto */
#if CYTHON_AVOID_BORROWED_REFS
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i)
#elif CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i))
#else
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
#endif
#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
#define __Pyx_KwValues_VARARGS(args, nargs) NULL
#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
#if CYTHON_METH_FASTCALL
    #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i])
    #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds)
    #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
    static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
    CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
  #else
    #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
  #endif
#else
    #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS
    #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
    #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
    #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
    #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
#endif
#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
#if CYTHON_METH_FASTCALL || (CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start)
#else
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
#endif

/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);

/* ParseKeywords.proto */
static CYTHON_INLINE int __Pyx_ParseKeywords(
    PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[],
    PyObject *kwds2, PyObject *values[],
    Py_ssize_t num_pos_args, Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs
);

/* CallCFunction.proto */
#define __Pyx_CallCFunction(cfunc, self, args)\
    ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args)
#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\
    ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs)
#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\
    ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs)
#define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\
    ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames)

/* UnpackUnboundCMethod.proto */
typedef struct {
    PyObject *type;
    PyObject **method_name;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
    __pyx_atomic_int_type initialized;
#endif
    PyCFunction func;
    PyObject *method;
    int flag;
} __Pyx_CachedCFunction;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) {
#if !CYTHON_ATOMICS
    return 1;
#else
    __pyx_nonatomic_int_type expected = 0;
    if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) {
        return 0;
    }
    return expected;
#endif
}
static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) {
#if CYTHON_ATOMICS
    __pyx_atomic_store(&cfunc->initialized, 2);
#endif
}
#else
#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2
#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc)
#endif

/* CallUnboundCMethod2.proto */
CYTHON_UNUSED
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
#else
#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2)  __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
#endif

/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);

/* RaiseUnboundLocalError.proto */
static void __Pyx_RaiseUnboundLocalError(const char *varname);

/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck);

/* pep479.proto */
static void __Pyx_Generator_Replace_StopIteration(int in_async_gen);

/* PyFloatBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyFloat_TrueDivideCObj(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyFloat_TrueDivideCObj(op1, op2, floatval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceTrueDivide(op1, op2) : PyNumber_TrueDivide(op1, op2))
#endif

/* RaiseUnexpectedTypeError.proto */
static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);

/* RejectKeywords.proto */
static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds);

/* ListCompAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len)) {
        Py_INCREF(x);
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
        L->ob_item[len] = x;
        #else
        PyList_SET_ITEM(list, len, x);
        #endif
        __Pyx_SET_SIZE(list, len + 1);
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
#endif

/* PyObject_Unicode.proto */
#define __Pyx_PyObject_Unicode(obj)\
    (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))

/* BuildPyUnicode.proto */
static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, const char* chars, int clength,
                                                int prepend_sign, char padding_char);

/* COrdinalToPyUnicode.proto */
static CYTHON_INLINE int __Pyx_CheckUnicodeValue(int value);
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(int value, Py_ssize_t width, char padding_char);

/* GCCDiagnostics.proto */
#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
#define __Pyx_HAS_GCC_DIAGNOSTIC
#endif

/* IncludeStdlibH.proto */
#include <stdlib.h>

/* CIntToPyUnicode.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char);

/* PyObjectFormatAndDecref.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f);
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f);

/* JoinPyUnicode.proto */
static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char);

/* ArgTypeTest.proto */
#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
    ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\
        __Pyx__ArgTypeTest(obj, type, name, exact))
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);

/* PyLongBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

/* ObjectGetItem.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key);
#else
#define __Pyx_PyObject_GetItem(obj, key)  PyObject_GetItem(obj, key)
#endif

/* DivInt[long].proto */
static CYTHON_INLINE long __Pyx_div_long(long, long, int b_is_constant);

/* SliceObject.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
        PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
        int has_cstart, int has_cstop, int wraparound);

/* SetItemInt.proto */
#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
               __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
                                               int is_list, int wraparound, int boundscheck);

/* PyLongBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static CYTHON_INLINE PyObject* __Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyLong_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
#endif

/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

/* IterFinish.proto */
static CYTHON_INLINE int __Pyx_IterFinish(void);

/* UnpackItemEndCheck.proto */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);

/* BufferFallbackError.proto */
static void __Pyx_RaiseBufferFallbackError(void);

/* PyLongCompare.proto */
static CYTHON_INLINE int __Pyx_PyLong_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);

/* PyFloatBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyFloat_AddCObj(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyFloat_AddCObj(op1, op2, floatval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

/* PyLongBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static CYTHON_INLINE PyObject* __Pyx_PyLong_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyLong_AddCObj(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

/* PyObjectFormat.proto */
#if CYTHON_USE_UNICODE_WRITER
static PyObject* __Pyx_PyObject_Format(PyObject* s, PyObject* f);
#else
#define __Pyx_PyObject_Format(s, f) PyObject_Format(s, f)
#endif

/* pybytes_as_double.proto */
static double __Pyx_SlowPyString_AsDouble(PyObject *obj);
static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length);
static CYTHON_INLINE double __Pyx_PyBytes_AsDouble(PyObject *obj) {
    char* as_c_string;
    Py_ssize_t size;
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
    as_c_string = PyBytes_AS_STRING(obj);
    size = PyBytes_GET_SIZE(obj);
#else
    if (PyBytes_AsStringAndSize(obj, &as_c_string, &size) < 0) {
        return (double)-1;
    }
#endif
    return __Pyx__PyBytes_AsDouble(obj, as_c_string, size);
}
static CYTHON_INLINE double __Pyx_PyByteArray_AsDouble(PyObject *obj) {
    char* as_c_string;
    Py_ssize_t size;
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
    as_c_string = PyByteArray_AS_STRING(obj);
    size = PyByteArray_GET_SIZE(obj);
#else
    as_c_string = PyByteArray_AsString(obj);
    if (as_c_string == NULL) {
        return (double)-1;
    }
    size = PyByteArray_Size(obj);
#endif
    return __Pyx__PyBytes_AsDouble(obj, as_c_string, size);
}

/* pyunicode_as_double.proto */
#if !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS
static const char* __Pyx__PyUnicode_AsDouble_Copy(const void* data, const int kind, char* buffer, Py_ssize_t start, Py_ssize_t end) {
    int last_was_punctuation;
    Py_ssize_t i;
    last_was_punctuation = 1;
    for (i=start; i <= end; i++) {
        Py_UCS4 chr = PyUnicode_READ(kind, data, i);
        int is_punctuation = (chr == '_') | (chr == '.');
        *buffer = (char)chr;
        buffer += (chr != '_');
        if (unlikely(chr > 127)) goto parse_failure;
        if (unlikely(last_was_punctuation & is_punctuation)) goto parse_failure;
        last_was_punctuation = is_punctuation;
    }
    if (unlikely(last_was_punctuation)) goto parse_failure;
    *buffer = '\0';
    return buffer;
parse_failure:
    return NULL;
}
static double __Pyx__PyUnicode_AsDouble_inf_nan(const void* data, int kind, Py_ssize_t start, Py_ssize_t length) {
    int matches = 1;
    Py_UCS4 chr;
    Py_UCS4 sign = PyUnicode_READ(kind, data, start);
    int is_signed = (sign == '-') | (sign == '+');
    start += is_signed;
    length -= is_signed;
    switch (PyUnicode_READ(kind, data, start)) {
        #ifdef Py_NAN
        case 'n':
        case 'N':
            if (unlikely(length != 3)) goto parse_failure;
            chr = PyUnicode_READ(kind, data, start+1);
            matches &= (chr == 'a') | (chr == 'A');
            chr = PyUnicode_READ(kind, data, start+2);
            matches &= (chr == 'n') | (chr == 'N');
            if (unlikely(!matches)) goto parse_failure;
            return (sign == '-') ? -Py_NAN : Py_NAN;
        #endif
        case 'i':
        case 'I':
            if (unlikely(length < 3)) goto parse_failure;
            chr = PyUnicode_READ(kind, data, start+1);
            matches &= (chr == 'n') | (chr == 'N');
            chr = PyUnicode_READ(kind, data, start+2);
            matches &= (chr == 'f') | (chr == 'F');
            if (likely(length == 3 && matches))
                return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
            if (unlikely(length != 8)) goto parse_failure;
            chr = PyUnicode_READ(kind, data, start+3);
            matches &= (chr == 'i') | (chr == 'I');
            chr = PyUnicode_READ(kind, data, start+4);
            matches &= (chr == 'n') | (chr == 'N');
            chr = PyUnicode_READ(kind, data, start+5);
            matches &= (chr == 'i') | (chr == 'I');
            chr = PyUnicode_READ(kind, data, start+6);
            matches &= (chr == 't') | (chr == 'T');
            chr = PyUnicode_READ(kind, data, start+7);
            matches &= (chr == 'y') | (chr == 'Y');
            if (unlikely(!matches)) goto parse_failure;
            return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
        case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
            break;
        default:
            goto parse_failure;
    }
    return 0.0;
parse_failure:
    return -1.0;
}
static double __Pyx_PyUnicode_AsDouble_WithSpaces(PyObject *obj) {
    double value;
    const char *last;
    char *end;
    Py_ssize_t start, length = PyUnicode_GET_LENGTH(obj);
    const int kind = PyUnicode_KIND(obj);
    const void* data = PyUnicode_DATA(obj);
    start = 0;
    while (Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, start)))
        start++;
    while (start < length - 1 && Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, length - 1)))
        length--;
    length -= start;
    if (unlikely(length <= 0)) goto fallback;
    value = __Pyx__PyUnicode_AsDouble_inf_nan(data, kind, start, length);
    if (unlikely(value == -1.0)) goto fallback;
    if (value != 0.0) return value;
    if (length < 40) {
        char number[40];
        last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length);
        if (unlikely(!last)) goto fallback;
        value = PyOS_string_to_double(number, &end, NULL);
    } else {
        char *number = (char*) PyMem_Malloc((length + 1) * sizeof(char));
        if (unlikely(!number)) goto fallback;
        last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length);
        if (unlikely(!last)) {
            PyMem_Free(number);
            goto fallback;
        }
        value = PyOS_string_to_double(number, &end, NULL);
        PyMem_Free(number);
    }
    if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) {
        return value;
    }
fallback:
    return __Pyx_SlowPyString_AsDouble(obj);
}
#endif
static CYTHON_INLINE double __Pyx_PyUnicode_AsDouble(PyObject *obj) {
#if !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS
    if (unlikely(__Pyx_PyUnicode_READY(obj) == -1))
        return (double)-1;
    if (likely(PyUnicode_IS_ASCII(obj))) {
        const char *s;
        Py_ssize_t length;
        s = PyUnicode_AsUTF8AndSize(obj, &length);
        return __Pyx__PyBytes_AsDouble(obj, s, length);
    }
    return __Pyx_PyUnicode_AsDouble_WithSpaces(obj);
#else
    return __Pyx_SlowPyString_AsDouble(obj);
#endif
}

/* pynumber_float.proto */
static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj);
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : __Pyx__PyNumber_Float(x))

/* BufferIndexError.proto */
static void __Pyx_RaiseBufferIndexError(int axis);

#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
/* DictGetItem.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
#define __Pyx_PyObject_Dict_GetItem(obj, name)\
    (likely(PyDict_CheckExact(obj)) ?\
     __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
#else
#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#define __Pyx_PyObject_Dict_GetItem(obj, name)  PyObject_GetItem(obj, name)
#endif

/* PySequenceContains.proto */
static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
    int result = PySequence_Contains(seq, item);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

/* GetAttr3.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);

/* PyObjectDelAttr.proto */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
#define __Pyx_PyObject_DelAttr(o, n) PyObject_SetAttr(o, n, NULL)
#else
#define __Pyx_PyObject_DelAttr(o, n) PyObject_DelAttr(o, n)
#endif

/* PyObjectSetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   __Pyx_PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

/* CIntToPyUnicode.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char, char format_char);

/* PyLongBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static CYTHON_INLINE PyObject* __Pyx_PyLong_TrueDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyLong_TrueDivideObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceTrueDivide(op1, op2) : PyNumber_TrueDivide(op1, op2))
#endif

/* PyLongBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static CYTHON_INLINE PyObject* __Pyx_PyLong_FloorDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyLong_FloorDivideObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceFloorDivide(op1, op2) : PyNumber_FloorDivide(op1, op2))
#endif

/* IterNextPlain.proto */
static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator);
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void);
#endif

/* IterNext.proto */
#define __Pyx_PyIter_Next(obj) __Pyx_PyIter_Next2(obj, NULL)
static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject *, PyObject *);

/* ListAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
        Py_INCREF(x);
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
        L->ob_item[len] = x;
        #else
        PyList_SET_ITEM(list, len, x);
        #endif
        __Pyx_SET_SIZE(list, len + 1);
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

/* PyLongCompare.proto */
static CYTHON_INLINE int __Pyx_PyLong_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace);

/* pyobject_as_double.proto */
static double __Pyx__PyObject_AsDouble(PyObject* obj);
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyObject_AsDouble(obj)\
(likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) :\
 likely(PyLong_CheckExact(obj)) ?\
 PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
#else
#define __Pyx_PyObject_AsDouble(obj)\
((likely(PyFloat_CheckExact(obj))) ?  __Pyx_PyFloat_AS_DOUBLE(obj) :\
 likely(PyLong_CheckExact(obj)) ?\
 PyLong_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
#endif

/* PyObjectCallNoArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);

/* pyfrozenset_new.proto */
static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it);

/* PySetContains.proto */
static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq);

/* PyObjectCall2Args.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);

/* CallUnboundCMethod1.proto */
CYTHON_UNUSED
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
#else
#define __Pyx_CallUnboundCMethod1(cfunc, self, arg)  __Pyx__CallUnboundCMethod1(cfunc, self, arg)
#endif

/* Import.proto */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);

/* ImportFrom.proto */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);

/* HasAttr.proto */
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_HasAttr(o, n)  PyObject_HasAttrWithError(o, n)
#else
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
#endif

/* CallTypeTraverse.proto */
#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000)
#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0
#else
static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg);
#endif

/* FixUpExtensionType.proto */
static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);

/* PyObjectGetMethod.proto */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);

/* PyObjectCallMethod0.proto */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);

/* ValidateBasesTuple.proto */
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases);
#endif

/* PyType_Ready.proto */
CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);

/* LimitedApiGetTypeDict.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp);
#endif

/* DelItemOnTypeDict.proto */
static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k);
#define __Pyx_DelItemOnTypeDict(tp, k) __Pyx__DelItemOnTypeDict((PyTypeObject*)tp, k)

/* SetItemOnTypeDict.proto */
static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v);
#define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v)

/* SetupReduce.proto */
static int __Pyx_setup_reduce(PyObject* type_obj);

/* SetVTable.proto */
static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable);

/* GetVTable.proto */
static void* __Pyx_GetVtable(PyTypeObject *type);

/* MergeVTables.proto */
static int __Pyx_MergeVtables(PyTypeObject *type);

/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto_3_1_1
#define __PYX_HAVE_RT_ImportType_proto_3_1_1
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
#include <stdalign.h>
#endif
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
#define __PYX_GET_STRUCT_ALIGNMENT_3_1_1(s) alignof(s)
#else
#define __PYX_GET_STRUCT_ALIGNMENT_3_1_1(s) sizeof(void*)
#endif
enum __Pyx_ImportType_CheckSize_3_1_1 {
   __Pyx_ImportType_CheckSize_Error_3_1_1 = 0,
   __Pyx_ImportType_CheckSize_Warn_3_1_1 = 1,
   __Pyx_ImportType_CheckSize_Ignore_3_1_1 = 2
};
static PyTypeObject *__Pyx_ImportType_3_1_1(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_1_1 check_size);
#endif

/* ImportDottedModule.proto */
static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple);
static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple);

/* FetchSharedCythonModule.proto */
static PyObject *__Pyx_FetchSharedCythonABIModule(void);

/* dict_setdefault.proto */
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, int is_safe_type);

/* FetchCommonType.proto */
static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases);

/* PyMethodNew.proto */
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);

/* PyVectorcallFastCallDict.proto */
#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL)
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
#endif

/* CythonFunctionShared.proto */
#define __Pyx_CyFunction_USED
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CYFUNCTION_COROUTINE     0x08
#define __Pyx_CyFunction_GetClosure(f)\
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_CyFunction_GetClassObj(f)\
      (((__pyx_CyFunctionObject *) (f))->func_classobj)
#else
  #define __Pyx_CyFunction_GetClassObj(f)\
      ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
#endif
#define __Pyx_CyFunction_SetClassObj(f, classobj)\
    __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj))
#define __Pyx_CyFunction_Defaults(type, f)\
    ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
    ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject_HEAD
    PyObject *func;
#elif PY_VERSION_HEX < 0x030900B1
    PyCFunctionObject func;
#else
    PyCMethodObject func;
#endif
#if CYTHON_BACKPORT_VECTORCALL ||\
        (CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL)
    __pyx_vectorcallfunc func_vectorcall;
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *func_weakreflist;
#endif
    PyObject *func_dict;
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    PyObject *func_classobj;
#endif
    PyObject *defaults;
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
    PyObject *func_is_coroutine;
} __pyx_CyFunctionObject;
#undef __Pyx_CyOrPyCFunction_Check
#define __Pyx_CyFunction_Check(obj)  __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType)
#define __Pyx_CyOrPyCFunction_Check(obj)  __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type)
#define __Pyx_CyFunction_CheckExact(obj)  __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType)
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void));
#undef __Pyx_IsSameCFunction
#define __Pyx_IsSameCFunction(func, cfunc)   __Pyx__IsSameCyOrCFunction(func, cfunc)
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *closure,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func,
                                                         PyTypeObject *defaults_type);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
                                                            PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
                                                             PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
                                                              PyObject *dict);
static int __pyx_CyFunction_init(PyObject *module);
#if CYTHON_METH_FASTCALL
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall)
#else
#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
#endif
#endif

/* CythonFunction.proto */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *closure,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);

/* ClassMethod.proto */
#if !CYTHON_COMPILING_IN_LIMITED_API
#include "descrobject.h"
#endif
CYTHON_UNUSED static PyObject* __Pyx_Method_ClassMethod(PyObject *method);

/* GetNameInClass.proto */
#define __Pyx_GetNameInClass(var, nmspace, name)  (var) = __Pyx__GetNameInClass(nmspace, name)
static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name);

/* CLineInTraceback.proto */
#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
#else
#define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
#endif

/* CodeObjectCache.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
typedef PyObject __Pyx_CachedCodeObjectType;
#else
typedef PyCodeObject __Pyx_CachedCodeObjectType;
#endif
typedef struct {
    __Pyx_CachedCodeObjectType* code_object;
    int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_int_type accessor_count;
  #endif
};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object);

/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename);

/* BufferStructDeclare.proto */
typedef struct {
  Py_ssize_t shape, strides, suboffsets;
} __Pyx_Buf_DimInfo;
typedef struct {
  size_t refcount;
  Py_buffer pybuffer;
} __Pyx_Buffer;
typedef struct {
  __Pyx_Buffer *rcbuffer;
  char *data;
  __Pyx_Buf_DimInfo diminfo[8];
} __Pyx_LocalBuf_ND;

/* RealImag.proto */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #define __Pyx_CREAL(z) ((z).real())
    #define __Pyx_CIMAG(z) ((z).imag())
  #else
    #define __Pyx_CREAL(z) (__real__(z))
    #define __Pyx_CIMAG(z) (__imag__(z))
  #endif
#else
    #define __Pyx_CREAL(z) ((z).real)
    #define __Pyx_CIMAG(z) ((z).imag)
#endif
#if defined(__cplusplus) && CYTHON_CCOMPLEX\
        && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
    #define __Pyx_SET_CREAL(z,x) ((z).real(x))
    #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
#else
    #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
    #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
#endif

/* Arithmetic.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
    #define __Pyx_c_eq_float(a, b)   ((a)==(b))
    #define __Pyx_c_sum_float(a, b)  ((a)+(b))
    #define __Pyx_c_diff_float(a, b) ((a)-(b))
    #define __Pyx_c_prod_float(a, b) ((a)*(b))
    #define __Pyx_c_quot_float(a, b) ((a)/(b))
    #define __Pyx_c_neg_float(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
    #define __Pyx_c_conj_float(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_abs_float(z)     (::std::abs(z))
        #define __Pyx_c_pow_float(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zero_float(z) ((z)==0)
    #define __Pyx_c_conj_float(z)    (conjf(z))
    #if 1
        #define __Pyx_c_abs_float(z)     (cabsf(z))
        #define __Pyx_c_pow_float(a, b)  (cpowf(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
    static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
    #if 1
        static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
    #endif
#endif

/* Arithmetic.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
    #define __Pyx_c_eq_double(a, b)   ((a)==(b))
    #define __Pyx_c_sum_double(a, b)  ((a)+(b))
    #define __Pyx_c_diff_double(a, b) ((a)-(b))
    #define __Pyx_c_prod_double(a, b) ((a)*(b))
    #define __Pyx_c_quot_double(a, b) ((a)/(b))
    #define __Pyx_c_neg_double(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
    #define __Pyx_c_conj_double(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_abs_double(z)     (::std::abs(z))
        #define __Pyx_c_pow_double(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zero_double(z) ((z)==0)
    #define __Pyx_c_conj_double(z)    (conj(z))
    #if 1
        #define __Pyx_c_abs_double(z)     (cabs(z))
        #define __Pyx_c_pow_double(a, b)  (cpow(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
    static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
    #endif
#endif

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value);

/* CIntFromPy.proto */
static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_npy_long(npy_long value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_Py_intptr_t(Py_intptr_t value);

/* CIntFromPy.proto */
static CYTHON_INLINE Py_intptr_t __Pyx_PyLong_As_Py_intptr_t(PyObject *);

/* FormatTypeName.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
typedef PyObject *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%U"
#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_PyType_GetFullyQualifiedName PyType_GetFullyQualifiedName
#else
static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp);
#endif
#else  // !LIMITED_API
typedef const char *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%.200s"
#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name)
#define __Pyx_DECREF_TypeName(obj)
#endif

/* FastTypeChecks.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
#else
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) {
    return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2);
}
#endif
#define __Pyx_PyErr_ExceptionMatches2(err1, err2)  __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
#ifdef PyExceptionInstance_Check
  #define __Pyx_PyBaseException_Check(obj) PyExceptionInstance_Check(obj)
#else
  #define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException)
#endif

/* SwapException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSwap(type, value, tb)  __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* PyObjectCallMethod1.proto */
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);

/* ReturnWithStopIteration.proto */
static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext);

/* CoroutineBase.proto */
struct __pyx_CoroutineObject;
typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_ExcInfoStruct  _PyErr_StackItem
#else
typedef struct {
    PyObject *exc_type;
    PyObject *exc_value;
    PyObject *exc_traceback;
} __Pyx_ExcInfoStruct;
#endif
typedef struct __pyx_CoroutineObject {
    PyObject_HEAD
    __pyx_coroutine_body_t body;
    PyObject *closure;
    __Pyx_ExcInfoStruct gi_exc_state;
    PyObject *gi_weakreflist;
    PyObject *classobj;
    PyObject *yieldfrom;
    __Pyx_pyiter_sendfunc yieldfrom_am_send;
    PyObject *gi_name;
    PyObject *gi_qualname;
    PyObject *gi_modulename;
    PyObject *gi_code;
    PyObject *gi_frame;
#if CYTHON_USE_SYS_MONITORING && (CYTHON_PROFILE || CYTHON_TRACE)
    PyMonitoringState __pyx_pymonitoring_state[__Pyx_MonitoringEventTypes_CyGen_count];
    uint64_t __pyx_pymonitoring_version;
#endif
    int resume_label;
    char is_running;
} __pyx_CoroutineObject;
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
    PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
    PyObject *name, PyObject *qualname, PyObject *module_name);
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name);
static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self);
static int __Pyx_Coroutine_clear(PyObject *self);
static __Pyx_PySendResult __Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval);
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
static __Pyx_PySendResult __Pyx_Coroutine_Close(PyObject *self, PyObject **retval);
static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_Coroutine_SwapException(self)
#define __Pyx_Coroutine_ResetAndClearException(self)  __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
#else
#define __Pyx_Coroutine_SwapException(self) {\
    __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
    __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
    }
#define __Pyx_Coroutine_ResetAndClearException(self) {\
    __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
    (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
    }
#endif
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
#else
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
#endif
static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);
static char __Pyx_Coroutine_test_and_set_is_running(__pyx_CoroutineObject *gen);
static void __Pyx_Coroutine_unset_is_running(__pyx_CoroutineObject *gen);
static char __Pyx_Coroutine_get_is_running(__pyx_CoroutineObject *gen);
static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure);
#if __PYX_HAS_PY_AM_SEND == 2
static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send);
#endif

/* Generator.proto */
#define __Pyx_Generator_USED
#define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_GeneratorType)
#define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
    __Pyx__Coroutine_New(__pyx_mstate_global->__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
static PyObject *__Pyx_Generator_Next(PyObject *self);
static int __pyx_Generator_init(PyObject *module);
static CYTHON_INLINE PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self);

/* GetRuntimeVersion.proto */
static unsigned long __Pyx_get_runtime_version(void);

/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);

/* MultiPhaseInitModuleState.proto */
#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
static PyObject *__Pyx_State_FindModule(void*);
static int __Pyx_State_AddModule(PyObject* module, void*);
static int __Pyx_State_RemoveModule(void*);
#elif CYTHON_USE_MODULE_STATE
#define __Pyx_State_FindModule PyState_FindModule
#define __Pyx_State_AddModule PyState_AddModule
#define __Pyx_State_RemoveModule PyState_RemoveModule
#endif

/* #### Code section: module_declarations ### */
/* CythonABIVersion.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
    #if CYTHON_METH_FASTCALL
        #define __PYX_FASTCALL_ABI_SUFFIX  "_fastcall"
    #else
        #define __PYX_FASTCALL_ABI_SUFFIX
    #endif
    #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_FASTCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
#else
    #define __PYX_LIMITED_ABI_SUFFIX
#endif
#if __PYX_HAS_PY_AM_SEND == 1
    #define __PYX_AM_SEND_ABI_SUFFIX
#elif __PYX_HAS_PY_AM_SEND == 2
    #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport"
#else
    #define __PYX_AM_SEND_ABI_SUFFIX "noamsend"
#endif
#ifndef __PYX_MONITORING_ABI_SUFFIX
    #define __PYX_MONITORING_ABI_SUFFIX
#endif
#if CYTHON_USE_TP_FINALIZE
    #define __PYX_TP_FINALIZE_ABI_SUFFIX
#else
    #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize"
#endif
#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED)
    #define __PYX_FREELISTS_ABI_SUFFIX
#else
    #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists"
#endif
#define CYTHON_ABI  __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."

static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self); /* proto*/
#if !CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self); /* proto*/
#endif
#if !CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self); /* proto*/
#endif
static PyArrayObject *__pyx_f_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_argument_distances(CYTHON_UNUSED struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_positions, PyObject *__pyx_v_argument); /* proto*/

/* Module declarations from "libc.string" */

/* Module declarations from "libc.stdio" */

/* Module declarations from "__builtin__" */

/* Module declarations from "cpython.type" */

/* Module declarations from "cpython.version" */

/* Module declarations from "cpython.exc" */

/* Module declarations from "cpython.module" */

/* Module declarations from "cpython.mem" */

/* Module declarations from "cpython.tuple" */

/* Module declarations from "cpython.list" */

/* Module declarations from "cpython.sequence" */

/* Module declarations from "cpython.mapping" */

/* Module declarations from "cpython.iterator" */

/* Module declarations from "cpython.number" */

/* Module declarations from "__builtin__" */

/* Module declarations from "cpython.bool" */

/* Module declarations from "cpython.long" */

/* Module declarations from "cpython.float" */

/* Module declarations from "cython" */

/* Module declarations from "__builtin__" */

/* Module declarations from "cpython.complex" */

/* Module declarations from "libc.stddef" */

/* Module declarations from "cpython.unicode" */

/* Module declarations from "cpython.pyport" */

/* Module declarations from "cpython.dict" */

/* Module declarations from "cpython.instance" */

/* Module declarations from "cpython.function" */

/* Module declarations from "cpython.method" */

/* Module declarations from "cpython.weakref" */

/* Module declarations from "cpython.getargs" */

/* Module declarations from "cpython.pythread" */

/* Module declarations from "cpython.pystate" */

/* Module declarations from "cpython.set" */

/* Module declarations from "cpython.buffer" */

/* Module declarations from "cpython.bytes" */

/* Module declarations from "cpython.pycapsule" */

/* Module declarations from "cpython.contextvars" */

/* Module declarations from "cpython" */

/* Module declarations from "cpython.object" */

/* Module declarations from "cpython.ref" */

/* Module declarations from "numpy" */

/* Module declarations from "numpy" */

/* Module declarations from "nltkor.tag.libs.network" */
static PyObject *__pyx_f_6nltkor_3tag_4libs_7network_logsumexp(PyArrayObject *, struct __pyx_opt_args_6nltkor_3tag_4libs_7network_logsumexp *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_6nltkor_3tag_4libs_7network_hardtanh(PyArrayObject *, struct __pyx_opt_args_6nltkor_3tag_4libs_7network_hardtanh *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_6nltkor_3tag_4libs_7network_hardtanhd(PyArrayObject *); /*proto*/
static PyObject *__pyx_f_6nltkor_3tag_4libs_7network___pyx_unpickle_Network__set_state(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *, PyObject *); /*proto*/
static PyObject *__pyx_f_6nltkor_3tag_4libs_7network___pyx_unpickle_ConvolutionalNetwork__set_state(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *, PyObject *); /*proto*/
static PyObject *__pyx_f_6nltkor_3tag_4libs_7network___pyx_unpickle_ConvolutionalDependencyNetwork__set_state(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *, PyObject *); /*proto*/
/* #### Code section: typeinfo ### */
static const __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t = { "FLOAT_t", NULL, sizeof(__pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t), { 0 }, 0, 'R', 0, 0 };
static const __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_DOUBLE_t = { "DOUBLE_t", NULL, sizeof(__pyx_t_6nltkor_3tag_4libs_7network_DOUBLE_t), { 0 }, 0, 'R', 0, 0 };
static const __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_INT_t = { "INT_t", NULL, sizeof(__pyx_t_6nltkor_3tag_4libs_7network_INT_t), { 0 }, 0, __PYX_IS_UNSIGNED(__pyx_t_6nltkor_3tag_4libs_7network_INT_t) ? 'U' : 'I', __PYX_IS_UNSIGNED(__pyx_t_6nltkor_3tag_4libs_7network_INT_t), 0 };
/* #### Code section: before_global_var ### */
#define __Pyx_MODULE_NAME "nltkor.tag.libs.network"
extern int __pyx_module_is_main_nltkor__tag__libs__network;
int __pyx_module_is_main_nltkor__tag__libs__network = 0;

/* Implementation of "nltkor.tag.libs.network" */
/* #### Code section: global_var ### */
static PyObject *__pyx_builtin_sum;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_xrange;
static PyObject *__pyx_builtin_zip;
static PyObject *__pyx_builtin_FloatingPointError;
static PyObject *__pyx_builtin_super;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_ImportError;
/* #### Code section: string_decls ### */
static const char __pyx_k_[] = ", ";
static const char __pyx_k_1[] = "\2301";
static const char __pyx_k_A[] = "\230A";
static const char __pyx_k_Q[] = "\250Q";
static const char __pyx_k_T[] = "T";
static const char __pyx_k_a[] = "a";
static const char __pyx_k_d[] = "d";
static const char __pyx_k_f[] = "f";
static const char __pyx_k_i[] = "i";
static const char __pyx_k_j[] = "j";
static const char __pyx_k_t[] = "t";
static const char __pyx_k_x[] = "x";
static const char __pyx_k_4q[] = "\210\001\330\014\023\2204\220q";
static const char __pyx_k__2[] = "\n";
static const char __pyx_k__3[] = "   ";
static const char __pyx_k__4[] = "    ";
static const char __pyx_k__5[] = ".";
static const char __pyx_k__6[] = "?";
static const char __pyx_k__7[] = "\240\021";
static const char __pyx_k__8[] = "\250\001";
static const char __pyx_k__9[] = "\300\021";
static const char __pyx_k_gc[] = "gc";
static const char __pyx_k_nn[] = "nn";
static const char __pyx_k_np[] = "np";
static const char __pyx_k_1_2[] = "\2501";
static const char __pyx_k_2_6[] = "\200\001\330\0042\260!\2606\270\021";
static const char __pyx_k_AV1[] = "\200\001\330\004<\270A\270V\3001";
static const char __pyx_k_A_2[] = "\260A";
static const char __pyx_k_A_3[] = "\250A";
static const char __pyx_k_A_4[] = "\300A";
static const char __pyx_k_A_5[] = "\220A";
static const char __pyx_k_Q_2[] = "\240Q";
static const char __pyx_k_Q_3[] = "\220Q";
static const char __pyx_k_Q_4[] = "\230Q";
static const char __pyx_k_QfA[] = "\200\001\330\004%\240Q\240f\250A";
static const char __pyx_k__10[] = "\250!";
static const char __pyx_k__11[] = "\270!";
static const char __pyx_k__12[] = "\230\001";
static const char __pyx_k__13[] = "\260\001";
static const char __pyx_k__14[] = "\260!";
static const char __pyx_k__15[] = "\260\021";
static const char __pyx_k__16[] = "\270\001";
static const char __pyx_k_a_2[] = "\220a";
static const char __pyx_k_a_3[] = "\250a";
static const char __pyx_k_add[] = "add";
static const char __pyx_k_cls[] = "cls";
static const char __pyx_k_del[] = "__del__";
static const char __pyx_k_dot[] = "dot";
static const char __pyx_k_end[] = "end";
static const char __pyx_k_exp[] = "exp";
static const char __pyx_k_get[] = "__get__";
static const char __pyx_k_log[] = "log";
static const char __pyx_k_max[] = "max";
static const char __pyx_k_net[] = "net";
static const char __pyx_k_new[] = "__new__";
static const char __pyx_k_num[] = "num";
static const char __pyx_k_pop[] = "pop";
static const char __pyx_k_set[] = "__set__";
static const char __pyx_k_sum[] = "sum";
static const char __pyx_k_tag[] = "tag";
static const char __pyx_k_zip[] = "zip";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_axis[] = "axis";
static const char __pyx_k_clip[] = "clip";
static const char __pyx_k_copy[] = "copy";
static const char __pyx_k_data[] = "data";
static const char __pyx_k_desc[] = "desc";
static const char __pyx_k_dict[] = "__dict__";
static const char __pyx_k_func[] = "__func__";
static const char __pyx_k_head[] = "head";
static const char __pyx_k_high[] = "high";
static const char __pyx_k_hits[] = "hits";
static const char __pyx_k_inds[] = "inds";
static const char __pyx_k_info[] = "info";
static const char __pyx_k_init[] = "__init__";
static const char __pyx_k_less[] = "less";
static const char __pyx_k_load[] = "load";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_mode[] = "mode";
static const char __pyx_k_name[] = "__name__";
static const char __pyx_k_next[] = "next";
static const char __pyx_k_root[] = "root";
static const char __pyx_k_save[] = "save";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_send[] = "send";
static const char __pyx_k_sent[] = "sent";
static const char __pyx_k_spec[] = "__spec__";
static const char __pyx_k_sqrt[] = "sqrt";
static const char __pyx_k_tags[] = "tags";
static const char __pyx_k_take[] = "take";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_tile[] = "tile";
static const char __pyx_k_9_q_A[] = "\320\0049\270\021\360\022\000\t\r\320\014'\240q\330\010\014\320\014\034\230A";
static const char __pyx_k_A_t_q[] = "\200A\360\014\000\t\020\210t\320\023'\240q\330\010\n\210&\220\001\220\024\320\025*\250!";
static const char __pyx_k_J_A_q[] = "\320\004J\310!\360\020\000\t\r\320\014$\240A\330\010\014\320\014\037\230q\330\010\014\320\014 \240\001";
static const char __pyx_k_array[] = "array";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_cycle[] = "cycle";
static const char __pyx_k_debug[] = "debug";
static const char __pyx_k_delta[] = "delta";
static const char __pyx_k_dtype[] = "dtype";
static const char __pyx_k_empty[] = "empty";
static const char __pyx_k_epoch[] = "epoch";
static const char __pyx_k_error[] = "error";
static const char __pyx_k_graph[] = "graph";
static const char __pyx_k_heads[] = "heads";
static const char __pyx_k_index[] = "index";
static const char __pyx_k_label[] = "label";
static const char __pyx_k_numpy[] = "numpy";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_ravel[] = "ravel";
static const char __pyx_k_savez[] = "savez";
static const char __pyx_k_shape[] = "shape";
static const char __pyx_k_shift[] = "shift";
static const char __pyx_k_start[] = "start";
static const char __pyx_k_state[] = "state";
static const char __pyx_k_super[] = "super";
static const char __pyx_k_table[] = "table";
static const char __pyx_k_throw[] = "throw";
static const char __pyx_k_token[] = "token";
static const char __pyx_k_train[] = "train";
static const char __pyx_k_trans[] = "trans";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_where[] = "where";
static const char __pyx_k_zeros[] = "zeros";
static const char __pyx_k_A_IT_a[] = "\200A\360\010\000\t\r\210I\220T\230\027\240\002\240$\240a";
static const char __pyx_k_Logger[] = "Logger";
static const char __pyx_k_answer[] = "answer";
static const char __pyx_k_arange[] = "arange";
static const char __pyx_k_argmax[] = "argmax";
static const char __pyx_k_astype[] = "astype";
static const char __pyx_k_counts[] = "counts";
static const char __pyx_k_cycles[] = "cycles";
static const char __pyx_k_dCdf_2[] = "dCdf_2";
static const char __pyx_k_dCdf_3[] = "dCdf_3";
static const char __pyx_k_deltas[] = "deltas";
static const char __pyx_k_dict_2[] = "_dict";
static const char __pyx_k_enable[] = "enable";
static const char __pyx_k_epochs[] = "epochs";
static const char __pyx_k_factor[] = "factor";
static const char __pyx_k_i_args[] = "i_args";
static const char __pyx_k_ind_to[] = "ind_to";
static const char __pyx_k_labels[] = "labels";
static const char __pyx_k_logadd[] = "logadd";
static const char __pyx_k_logger[] = "logger";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_output[] = "output";
static const char __pyx_k_pickle[] = "pickle";
static const char __pyx_k_random[] = "random";
static const char __pyx_k_reduce[] = "__reduce__";
static const char __pyx_k_scores[] = "scores";
static const char __pyx_k_target[] = "target";
static const char __pyx_k_update[] = "update";
static const char __pyx_k_vertex[] = "vertex";
static const char __pyx_k_vstack[] = "vstack";
static const char __pyx_k_window[] = "window";
static const char __pyx_k_A12_A_q[] = "\320\004<\270A\33012\360\020\000\t\r\320\014$\240A\330\010\014\320\014\037\230q";
static const char __pyx_k_A_t_q_2[] = "\200A\360\014\000\t\020\210t\320\023'\240q\340\010\n\210&\220\001\220\024\320\025*\250!";
static const char __pyx_k_Network[] = "Network";
static const char __pyx_k_disable[] = "disable";
static const char __pyx_k_element[] = "element";
static const char __pyx_k_exp_sum[] = "exp_sum";
static const char __pyx_k_flatten[] = "flatten";
static const char __pyx_k_float64[] = "float64";
static const char __pyx_k_genexpr[] = "genexpr";
static const char __pyx_k_greater[] = "greater";
static const char __pyx_k_inplace[] = "inplace";
static const char __pyx_k_logging[] = "logging";
static const char __pyx_k_logprob[] = "logprob";
static const char __pyx_k_net_tag[] = "net_tag";
static const char __pyx_k_outside[] = "outside";
static const char __pyx_k_r_r_s_q[] = "\210\001\330\014\020\320\020 \240\001\330\014\020\220\017\230r\240\026\240r\250\024\320-?\270s\300%\300q\310\001";
static const char __pyx_k_reshape[] = "reshape";
static const char __pyx_k_shuffle[] = "shuffle";
static const char __pyx_k_uniform[] = "uniform";
static const char __pyx_k_visited[] = "visited";
static const char __pyx_k_viterbi[] = "_viterbi";
static const char __pyx_k_weights[] = "weights";
static const char __pyx_k_Accuracy[] = "   Accuracy: ";
static const char __pyx_k_Infinity[] = "Infinity";
static const char __pyx_k_add_note[] = "add_note";
static const char __pyx_k_argument[] = "argument";
static const char __pyx_k_bincount[] = "bincount";
static const char __pyx_k_dCd_tanh[] = "dCd_tanh";
static const char __pyx_k_diagonal[] = "diagonal";
static const char __pyx_k_features[] = "features";
static const char __pyx_k_filename[] = "filename";
static const char __pyx_k_getstate[] = "__getstate__";
static const char __pyx_k_gold_tag[] = "gold_tag";
static const char __pyx_k_hardtanh[] = "hardtanh";
static const char __pyx_k_ind_from[] = "ind_from";
static const char __pyx_k_last_tag[] = "last_tag";
static const char __pyx_k_logprobs[] = "logprobs";
static const char __pyx_k_new_data[] = "new_data";
static const char __pyx_k_new_head[] = "new_head";
static const char __pyx_k_num_dims[] = "num_dims";
static const char __pyx_k_old_head[] = "old_head";
static const char __pyx_k_pos_dist[] = "pos_dist";
static const char __pyx_k_pre_dist[] = "pre_dist";
static const char __pyx_k_pyx_type[] = "__pyx_type";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_rollaxis[] = "rollaxis";
static const char __pyx_k_sentence[] = "sentence";
static const char __pyx_k_set_name[] = "__set_name__";
static const char __pyx_k_setstate[] = "__setstate__";
static const char __pyx_k_training[] = "training";
static const char __pyx_k_validate[] = "_validate";
static const char __pyx_k_w_deltas[] = "w_deltas";
static const char __pyx_k_A_1A_t9AQ[] = "\200A\360\016\000\t\022\220\024\220^\2401\240A\340\010\017\210t\2209\230A\230Q";
static const char __pyx_k_A_IQ_IQ_A[] = "\200A\360\n\000\t\r\210I\220Q\330\010\014\210I\220Q\330\010\014\320\014\034\230A";
static const char __pyx_k_arguments[] = "arguments";
static const char __pyx_k_enumerate[] = "enumerate";
static const char __pyx_k_getLogger[] = "getLogger";
static const char __pyx_k_get_state[] = "get_state";
static const char __pyx_k_gold_head[] = "gold_head";
static const char __pyx_k_gold_tags[] = "gold_tags";
static const char __pyx_k_gradients[] = "gradients";
static const char __pyx_k_hardtanhd[] = "hardtanhd";
static const char __pyx_k_head_to_v[] = "head_to_v";
static const char __pyx_k_isenabled[] = "isenabled";
static const char __pyx_k_logsumexp[] = "logsumexp";
static const char __pyx_k_new_shape[] = "new_shape";
static const char __pyx_k_num_items[] = "num_items";
static const char __pyx_k_positions[] = "positions";
static const char __pyx_k_pred_tags[] = "pred_tags";
static const char __pyx_k_predicate[] = "predicate";
static const char __pyx_k_pyx_state[] = "__pyx_state";
static const char __pyx_k_r_r_s_q_2[] = "\210\001\330\014\020\320\020!\240\021\330\014\020\220\017\230r\240\026\240r\250\024\320-?\270s\300%\300q\310\001";
static const char __pyx_k_reachable[] = "reachable";
static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
static const char __pyx_k_sent_args[] = "sent_args";
static const char __pyx_k_sent_tags[] = "sent_tags";
static const char __pyx_k_sentences[] = "sentences";
static const char __pyx_k_set_state[] = "set_state";
static const char __pyx_k_sumlogadd[] = "sumlogadd";
static const char __pyx_k_window_to[] = "window_to";
static const char __pyx_k_all_scores[] = "all_scores";
static const char __pyx_k_confidence[] = "confidence";
static const char __pyx_k_correction[] = "correction";
static const char __pyx_k_create_new[] = "create_new";
static const char __pyx_k_cycle_inds[] = "cycle_inds";
static const char __pyx_k_embeddings[] = "embeddings";
static const char __pyx_k_empty_like[] = "empty_like";
static const char __pyx_k_exp_scores[] = "exp_scores";
static const char __pyx_k_input_data[] = "input_data";
static const char __pyx_k_input_size[] = "input_size";
static const char __pyx_k_last_error[] = "last_error";
static const char __pyx_k_last_token[] = "last_token";
static const char __pyx_k_net_scores[] = "net_scores";
static const char __pyx_k_num_tokens[] = "num_tokens";
static const char __pyx_k_other_args[] = "other_args";
static const char __pyx_k_output_dim[] = "output_dim";
static const char __pyx_k_pos_deltas[] = "pos_deltas";
static const char __pyx_k_pre_deltas[] = "pre_deltas";
static const char __pyx_k_pred_dists[] = "pred_dists";
static const char __pyx_k_predicates[] = "predicates";
static const char __pyx_k_pyx_result[] = "__pyx_result";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_sent_preds[] = "sent_preds";
static const char __pyx_k_start_from[] = "start_from";
static const char __pyx_k_table_dims[] = "table_dims";
static const char __pyx_k_tag_scores[] = "tag_scores";
static const char __pyx_k_zeros_like[] = "zeros_like";
static const char __pyx_k_ImportError[] = "ImportError";
static const char __pyx_k_Output_size[] = "\nOutput size: ";
static const char __pyx_k_PickleError[] = "PickleError";
static const char __pyx_k_Saved_model[] = "Saved model";
static const char __pyx_k_best_scores[] = "best_scores";
static const char __pyx_k_concatenate[] = "concatenate";
static const char __pyx_k_cycle_score[] = "cycle_score";
static const char __pyx_k_dCd_hidden2[] = "dCd_hidden2";
static const char __pyx_k_description[] = "description";
static const char __pyx_k_dist_deltas[] = "dist_deltas";
static const char __pyx_k_find_cycles[] = "_find_cycles";
static const char __pyx_k_grad_matrix[] = "grad_matrix";
static const char __pyx_k_gradients_t[] = "gradients_t";
static const char __pyx_k_half_window[] = "half_window";
static const char __pyx_k_hidden_bias[] = "hidden_bias";
static const char __pyx_k_hidden_size[] = "hidden_size";
static const char __pyx_k_last_values[] = "last_values";
static const char __pyx_k_logical_and[] = "logical_and";
static const char __pyx_k_logical_not[] = "logical_not";
static const char __pyx_k_max_indices[] = "max_indices";
static const char __pyx_k_next_vertex[] = "next_vertex";
static const char __pyx_k_num_targets[] = "num_targets";
static const char __pyx_k_output_bias[] = "output_bias";
static const char __pyx_k_output_size[] = "output_size";
static const char __pyx_k_path_scores[] = "path_scores";
static const char __pyx_k_pos_padding[] = "pos_padding";
static const char __pyx_k_pre_padding[] = "pre_padding";
static const char __pyx_k_pred_answer[] = "pred_answer";
static const char __pyx_k_train_epoch[] = "_train_epoch";
static const char __pyx_k_transitions[] = "transitions";
static const char __pyx_k_unreachable[] = "unreachable";
static const char __pyx_k_window_from[] = "window_from";
static const char __pyx_k_word_window[] = "word_window";
static const char __pyx_k_A_78_A_Q_q_A[] = "\200A\360\006\00078\360\014\000\t\r\320\014$\240A\330\010\014\320\014%\240Q\330\010\014\320\014\037\230q\330\010\014\320\014$\240A";
static const char __pyx_k_A_r_az_a_s_6[] = "\200A\360\016\000\t\020\210r\220\025\220a\220z\240\035\250a\330\010\017\210s\320\022\"\240!\2406\250\021";
static const char __pyx_k_A_waq_1_IQ_q[] = "\200A\360\020\000\t\021\220\004\320\024'\240w\250a\250q\360\006\000\t\022\220\024\220]\240!\2401\340\010\014\210I\220Q\340\014\020\320\020 \240\001\240\027\250\001\340\010\017\210q";
static const char __pyx_k_Network_save[] = "Network.save";
static const char __pyx_k_allow_pickle[] = "allow_pickle";
static const char __pyx_k_decay_factor[] = "decay_factor";
static const char __pyx_k_epochs_Error[] = " epochs   Error: ";
static const char __pyx_k_exponentials[] = "exponentials";
static const char __pyx_k_hidden1_bias[] = "hidden1_bias";
static const char __pyx_k_hidden1_size[] = "hidden1_size";
static const char __pyx_k_hidden2_bias[] = "hidden2_bias";
static const char __pyx_k_hidden2_size[] = "hidden2_size";
static const char __pyx_k_initializing[] = "_initializing";
static const char __pyx_k_input_deltas[] = "input_deltas";
static const char __pyx_k_input_values[] = "input_values";
static const char __pyx_k_is_coroutine[] = "_is_coroutine";
static const char __pyx_k_neuron_maxes[] = "neuron_maxes";
static const char __pyx_k_new_head_ind[] = "new_head_ind";
static const char __pyx_k_num_vertices[] = "num_vertices";
static const char __pyx_k_output_range[] = "output_range";
static const char __pyx_k_outside_inds[] = "outside_inds";
static const char __pyx_k_padding_left[] = "padding_left";
static const char __pyx_k_previous_tag[] = "previous_tag";
static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
static const char __pyx_k_random_state[] = "random_state";
static const char __pyx_k_sentence_hit[] = "sentence_hit";
static const char __pyx_k_shuffle_data[] = "_shuffle_data";
static const char __pyx_k_stringsource[] = "<stringsource>";
static const char __pyx_k_table_deltas[] = "table_deltas";
static const char __pyx_k_tag_sentence[] = "_tag_sentence";
static const char __pyx_k_target_dists[] = "target_dists";
static const char __pyx_k_token_scores[] = "token_scores";
static const char __pyx_k_top_accuracy[] = "top_accuracy";
static const char __pyx_k_use_setstate[] = "use_setstate";
static const char __pyx_k_Network_train[] = "Network.train";
static const char __pyx_k_allow_repeats[] = "allow_repeats";
static const char __pyx_k_average_error[] = "_average_error";
static const char __pyx_k_backpropagate[] = "_backpropagate";
static const char __pyx_k_class_getitem[] = "__class_getitem__";
static const char __pyx_k_count_nonzero[] = "count_nonzero";
static const char __pyx_k_delta_softmax[] = "delta_softmax";
static const char __pyx_k_dist_features[] = "dist_features";
static const char __pyx_k_fill_diagonal[] = "fill_diagonal";
static const char __pyx_k_hidden_deltas[] = "hidden_deltas";
static const char __pyx_k_last_accuracy[] = "last_accuracy";
static const char __pyx_k_num_distances[] = "num_distances";
static const char __pyx_k_num_sentences[] = "num_sentences";
static const char __pyx_k_only_classify[] = "only_classify";
static const char __pyx_k_output_deltas[] = "output_deltas";
static const char __pyx_k_padding_right[] = "padding_right";
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
static const char __pyx_k_sentence_hits[] = "sentence_hits";
static const char __pyx_k_token_indices[] = "token_indices";
static const char __pyx_k_transitions_t[] = "transitions_t";
static const char __pyx_k_A_7q_Zwa_t_L8H[] = "\200A\330$7\260q\330()\360\032\000\t\r\320\014\035\230Z\240w\250a\330\010\017\210t\220>\240\021\240*\250L\3208H\310\001\330\"*\250)\260>\300\021";
static const char __pyx_k_A_r_az_a_S_q_q[] = "\200A\360\016\000\t\020\210r\220\025\220a\220z\240\035\250a\330\010\r\210S\320\020 \240\001\240\026\240q\340\010\017\210q";
static const char __pyx_k_Kq_2_s_83a_q_1[] = "\200\001\340\004\032\230\"\230K\240q\250\001\330\004\013\2102\210\\\230\021\230%\230s\240)\2508\2603\260a\330\004\007\200q\210\010\220\001\340\004\013\2101";
static const char __pyx_k_Token_accuracy[] = "   Token accuracy: ";
static const char __pyx_k_adjust_weights[] = "_adjust_weights";
static const char __pyx_k_column_numbers[] = "column_numbers";
static const char __pyx_k_contract_cycle[] = "_contract_cycle";
static const char __pyx_k_dist_pred_from[] = "dist_pred_from";
static const char __pyx_k_feature_tables[] = "feature_tables";
static const char __pyx_k_hidden2_values[] = "hidden2_values";
static const char __pyx_k_hidden_weights[] = "hidden_weights";
static const char __pyx_k_load_from_file[] = "_load_from_file";
static const char __pyx_k_log_sum_scores[] = "log_sum_scores";
static const char __pyx_k_output_weights[] = "output_weights";
static const char __pyx_k_path_backtrack[] = "path_backtrack";
static const char __pyx_k_pred_arguments[] = "pred_arguments";
static const char __pyx_k_predicate_tags[] = "predicate_tags";
static const char __pyx_k_reset_counters[] = "_reset_counters";
static const char __pyx_k_tag_sentence_2[] = "tag_sentence";
static const char __pyx_k_1_7_Q_31Ja_1_G1[] = "\320\0041\260\034\270]\310!\360\n\000\t\014\2107\220#\220Q\330\014\020\320\0203\2601\260J\270a\340\014\020\320\0201\260\021\260*\270G\3001";
static const char __pyx_k_A_1_e1A_q_q_q_q[] = "\200A\360\n\000\t\022\220\027\230\n\240!\2401\330\010\016\210e\2201\220A\340#$\330#'\240q\330#'\240q\330#'\240q\330#'\240q";
static const char __pyx_k_A_6_A_4_1_4_8_1[] = "\320\004A\300\021\360\022\000\t\014\2106\220\023\220A\330\014\023\2204\320\027:\270!\2701\340\014\023\2204\320\0278\270\001\270\032\3001";
static const char __pyx_k_adjust_features[] = "_adjust_features";
static const char __pyx_k_argument_blocks[] = "argument_blocks";
static const char __pyx_k_calculate_delta[] = "_calculate_delta";
static const char __pyx_k_conflicting_tag[] = "conflicting_tag";
static const char __pyx_k_convolution_max[] = "convolution_max";
static const char __pyx_k_dist_table_dims[] = "dist_table_dims";
static const char __pyx_k_hidden1_weights[] = "hidden1_weights";
static const char __pyx_k_hidden2_weights[] = "hidden2_weights";
static const char __pyx_k_input_gradients[] = "input_gradients";
static const char __pyx_k_load_parameters[] = "_load_parameters";
static const char __pyx_k_padded_sentence[] = "padded_sentence";
static const char __pyx_k_pred_dist_table[] = "pred_dist_table";
static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
static const char __pyx_k_validation_tags[] = "validation_tags";
static const char __pyx_k_Input_layer_size[] = "\nInput layer size: ";
static const char __pyx_k_Network__viterbi[] = "Network._viterbi";
static const char __pyx_k_Word_window_size[] = "\nWord window size: ";
static const char __pyx_k_desired_accuracy[] = "desired_accuracy";
static const char __pyx_k_dist_target_from[] = "dist_target_from";
static const char __pyx_k_hidden_gradients[] = "hidden_gradients";
static const char __pyx_k_highest_prob_arg[] = "highest_prob_arg";
static const char __pyx_k_incoming_weights[] = "incoming_weights";
static const char __pyx_k_load_from_file_2[] = "load_from_file";
static const char __pyx_k_network_filename[] = "network_filename";
static const char __pyx_k_outgoing_weights[] = "outgoing_weights";
static const char __pyx_k_pred_dist_deltas[] = "pred_dist_deltas";
static const char __pyx_k_pred_dist_lookup[] = "pred_dist_lookup";
static const char __pyx_k_pred_dist_offset[] = "pred_dist_offset";
static const char __pyx_k_pred_dist_values[] = "pred_dist_values";
static const char __pyx_k_predicate_answer[] = "predicate_answer";
static const char __pyx_k_word_window_size[] = "word_window_size";
static const char __pyx_k_A_1_e1A_0_0_0_0_0[] = "\200A\360\n\000\t\022\220\027\230\n\240!\2401\330\010\016\210e\2201\220A\360\006\000-.\330,0\260\001\330,0\260\001\330,0\260\001\330,0\260\001\330,0\260\001";
static const char __pyx_k_A_4q_4_5QfA_4_0_q[] = "\200A\340\010\013\2104\210q\330\014\023\2204\320\0275\260Q\260f\270A\340\014\023\2204\320\0270\260\001\260\026\260q";
static const char __pyx_k_Hidden_layer_size[] = "\nHidden layer size: ";
static const char __pyx_k_Network__validate[] = "Network._validate";
static const char __pyx_k_Sentence_accuracy[] = "   Sentence accuracy: ";
static const char __pyx_k_conflicting_probs[] = "conflicting_probs";
static const char __pyx_k_hidden2_gradients[] = "hidden2_gradients";
static const char __pyx_k_max_incoming_inds[] = "max_incoming_inds";
static const char __pyx_k_max_outgoing_inds[] = "max_outgoing_inds";
static const char __pyx_k_num_dist_features[] = "num_dist_features";
static const char __pyx_k_pre_tagging_setup[] = "_pre_tagging_setup";
static const char __pyx_k_pred_dist_indices[] = "pred_dist_indices";
static const char __pyx_k_pred_dist_weights[] = "pred_dist_weights";
static const char __pyx_k_target_dist_table[] = "target_dist_table";
static const char __pyx_k_FloatingPointError[] = "FloatingPointError";
static const char __pyx_k_Network_create_new[] = "Network.create_new";
static const char __pyx_k_argument_distances[] = "argument_distances";
static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_convolution_lookup[] = "convolution_lookup";
static const char __pyx_k_convolution_values[] = "convolution_values";
static const char __pyx_k_correct_path_score[] = "correct_path_score";
static const char __pyx_k_create_pred_lookup[] = "_create_pred_lookup";
static const char __pyx_k_generate_save_dict[] = "_generate_save_dict";
static const char __pyx_k_grad_times_softmax[] = "grad_times_softmax";
static const char __pyx_k_hidden_bias_deltas[] = "hidden_bias_deltas";
static const char __pyx_k_output_bias_deltas[] = "output_bias_deltas";
static const char __pyx_k_print_epoch_report[] = "_print_epoch_report";
static const char __pyx_k_reachable_vertices[] = "reachable_vertices";
static const char __pyx_k_target_dist_deltas[] = "target_dist_deltas";
static const char __pyx_k_target_dist_lookup[] = "target_dist_lookup";
static const char __pyx_k_target_dist_offset[] = "target_dist_offset";
static const char __pyx_k_target_dist_values[] = "target_dist_values";
static const char __pyx_k_vertices_in_cycles[] = "vertices_in_cycles";
static const char __pyx_k_Feature_table_sizes[] = "\nFeature table sizes: ";
static const char __pyx_k_Network_description[] = "Network.description";
static const char __pyx_k_NotImplementedError[] = "NotImplementedError";
static const char __pyx_k_calculate_gradients[] = "_calculate_gradients";
static const char __pyx_k_pred_dist_gradients[] = "pred_dist_gradients";
static const char __pyx_k_set_validation_data[] = "set_validation_data";
static const char __pyx_k_target_dist_indices[] = "target_dist_indices";
static const char __pyx_k_target_dist_weights[] = "target_dist_weights";
static const char __pyx_k_ConvolutionalNetwork[] = "ConvolutionalNetwork";
static const char __pyx_k_Network__train_epoch[] = "Network._train_epoch";
static const char __pyx_k_Network_tag_sentence[] = "Network.tag_sentence";
static const char __pyx_k_calculate_all_scores[] = "_calculate_all_scores";
static const char __pyx_k_create_target_lookup[] = "_create_target_lookup";
static const char __pyx_k_find_cycle_recursive[] = "_find_cycle_recursive";
static const char __pyx_k_max_incoming_weights[] = "max_incoming_weights";
static const char __pyx_k_max_outgoing_weights[] = "max_outgoing_weights";
static const char __pyx_k_prev_score_and_trans[] = "prev_score_and_trans";
static const char __pyx_k_pyx_unpickle_Network[] = "__pyx_unpickle_Network";
static const char __pyx_k_q_a_b_Qa_82Q_Q_q_q_1[] = "\320\000*\250!\360\n\000\005\010\200q\330\010\016\210a\340\010\016\210b\220\005\220Q\220a\330\004\023\2208\2302\230Q\330\004\022\220(\230#\230Q\330\004\007\200q\320\010\030\230\001\330\004\007\200q\320\010\030\230\001\340\004\013\2101";
static const char __pyx_k_sentence_convolution[] = "_sentence_convolution";
static const char __pyx_k_train_locals_genexpr[] = "train.<locals>.genexpr";
static const char __pyx_k_validation_arguments[] = "validation_arguments";
static const char __pyx_k_validation_sentences[] = "validation_sentences";
static const char __pyx_k_vertex_leaving_cycle[] = "vertex_leaving_cycle";
static const char __pyx_k_Network__tag_sentence[] = "Network._tag_sentence";
static const char __pyx_k_target_dist_gradients[] = "target_dist_gradients";
static const char __pyx_k_validation_predicates[] = "validation_predicates";
static const char __pyx_k_C1_r_1A_1A_WA_gZq_gXQa[] = "\320\004C\3001\360\014\000\t\030\220r\230\027\240\n\250!\330\010\n\210'\220\030\230\021\230!\330\010\n\210'\220\032\2301\230A\330\010\n\210'\220\030\230\021\230!\330\010\n\210'\220\032\2301\230A\330\010\n\210'\220\030\230\021\230!\330\010\013\210:\220W\230A\330\014\016\210g\220Z\230q\240\001\330\014\016\210g\220X\230Q\230a";
static const char __pyx_k_Convolution_layer_size[] = "\nConvolution layer size: ";
static const char __pyx_k_Network__backpropagate[] = "Network._backpropagate";
static const char __pyx_k_Network_load_from_file[] = "Network.load_from_file";
static const char __pyx_k_calculate_input_deltas[] = "_calculate_input_deltas";
static const char __pyx_k_create_sentence_lookup[] = "_create_sentence_lookup";
static const char __pyx_k_epochs_between_reports[] = "epochs_between_reports";
static const char __pyx_k_Network___reduce_cython[] = "Network.__reduce_cython__";
static const char __pyx_k_calculate_gradients_sll[] = "_calculate_gradients_sll";
static const char __pyx_k_calculate_gradients_wll[] = "_calculate_gradients_wll";
static const char __pyx_k_decrease_learning_rates[] = "decrease_learning_rates";
static const char __pyx_k_dist_features_per_token[] = "dist_features_per_token";
static const char __pyx_k_nltkor_tag_libs_network[] = "nltkor.tag.libs.network";
static const char __pyx_k_pred_convolution_lookup[] = "pred_convolution_lookup";
static const char __pyx_k_set_learning_rate_decay[] = "set_learning_rate_decay";
static const char __pyx_k_validate_locals_genexpr[] = "_validate.<locals>.genexpr";
static const char __pyx_k_A_IU_RuA_Rxq_81A_L_BgQ_q[] = "\200A\360\010\000\t\025\220I\230U\240!\360\010\000\t\016\210R\210u\220A\220[\240\010\250\001\250\021\330\010\021\220\021\220'\230\030\240\021\240!\360\006\000\t\016\210R\210x\220q\230\013\2408\2501\250A\330\010\021\220\021\220'\230\030\240\021\240!\360\006\000\t\022\220\021\220\"\220L\240\001\240\023\240B\240g\250Q\340\010\017\210q";
static const char __pyx_k_Network__calculate_delta[] = "Network._calculate_delta";
static const char __pyx_k_Network__load_parameters[] = "Network._load_parameters";
static const char __pyx_k_Second_hidden_layer_size[] = " \nSecond hidden layer size: ";
static const char __pyx_k_hidden_before_activation[] = "hidden_before_activation";
static const char __pyx_k_input_size_with_distance[] = "input_size_with_distance";
static const char __pyx_k_vertex_leaving_cycle_ind[] = "vertex_leaving_cycle_ind";
static const char __pyx_k_ConvolutionalNetwork_save[] = "ConvolutionalNetwork.save";
static const char __pyx_k_Network___setstate_cython[] = "Network.__setstate_cython__";
static const char __pyx_k_create_convolution_lookup[] = "_create_convolution_lookup";
static const char __pyx_k_create_new_locals_genexpr[] = "create_new.<locals>.genexpr";
static const char __pyx_k_hidden2_before_activation[] = "hidden2_before_activation";
static const char __pyx_k_hk_A_1_A_A_B_xq_7_6a7Nn_1[] = "\200\001\360\006\000\005\010\200\220h\230k\250\033\260A\330\010\r\210^\2301\330\010\016\320\016!\360\000\000\"\023\360\000\000\023A\024\360\000\000A\024B\024\330\004\023\320\023'\240x\250q\260\001\330\004\007\200|\2207\230!\330\0106\260a\3207N\310n\320\\]\330\004\013\2101";
static const char __pyx_k_target_convolution_lookup[] = "target_convolution_lookup";
static const char __pyx_k_A_IQ_IQ_A_r_1A_F_s_a_N_6_Q[] = "\200A\360\010\000\t\r\210I\220Q\330\010\014\210I\220Q\330\010\014\320\014\034\230A\360\n\000\t\030\220r\230\027\240\n\250!\330\010\n\210'\220\030\230\021\230!\330\010\n\210'\220\032\2301\230A\330\010\n\210'\220\030\230\021\230!\340\010\014\210F\220-\230s\240!\240;\250a\330\014\r\330\020\024\220N\240!\2406\250\021\330\023\024\340\020\024\320\024%\240Q";
static const char __pyx_k_ConvolutionalNetwork_train[] = "ConvolutionalNetwork.train";
static const char __pyx_k_find_maximum_spanning_tree[] = "_find_maximum_spanning_tree";
static const char __pyx_k_hk_A_1_b_b_d_d_e_7_1_7_N_1[] = "\200\001\360\006\000\005\010\200\220h\230k\250\033\260A\330\010\r\210^\2301\330\010\016\320\016!\360\000\000\"b\013\360\000\000b\013d\013\360\000\000d\013e\013\330\004\023\2207\230(\240!\2401\330\004\007\200|\2207\230!\330\010)\250\021\250*\260N\300!\330\004\013\2101";
static const char __pyx_k_input_and_pred_dist_values[] = "input_and_pred_dist_values";
static const char __pyx_k_A_1_RvRs_d_q_4_3fD0Fa_4_F_B[] = "\200A\360\010\000\t\014\2101\360\006\000\r\021\320\020%\240R\240v\250R\250s\260!\260;\270d\300!\360\006\000\t\r\320\014'\240q\250\n\260!\340\010\013\2104\320\017#\2403\240f\250D\3200F\300a\330\010\013\2104\320\017!\240\023\240F\250$\320.B\300!";
static const char __pyx_k_Network__print_epoch_report[] = "Network._print_epoch_report";
static const char __pyx_k_Network_set_validation_data[] = "Network.set_validation_data";
static const char __pyx_k_Training_for_up_to_d_epochs[] = "Training for up to %d epochs";
static const char __pyx_k_nltkor_tag_libs_network_pyx[] = "nltkor/tag/libs/network.pyx";
static const char __pyx_k_calculate_gradients_classify[] = "_calculate_gradients_classify";
static const char __pyx_k_ConvolutionalNetwork__viterbi[] = "ConvolutionalNetwork._viterbi";
static const char __pyx_k_hk_A_1_e_e_g_g_h_1_7_Abbppq_1[] = "\200\001\360\006\000\005\010\200\220h\230k\250\033\260A\330\010\r\210^\2301\330\010\016\320\016!\360\000\000\"e\024\360\000\000e\024g\024\360\000\000g\024h\024\330\004\023\320\0231\260\030\270\021\270!\330\004\007\200|\2207\230!\330\010@\300\001\320Ab\320bp\320pq\330\004\013\2101";
static const char __pyx_k_A_A_N_l_WA_T_F_m3a_a_z_D_N_6_Q[] = "\200A\360\006\000\t\r\320\014\034\230A\330\010\014\210N\230!\230;\240l\260&\270\001\330\010\013\210:\220W\230A\330\014\025\220T\230\021\230!\340\014\030\230\001\340\010\014\210F\220,\230m\2503\250a\250{\270,\300a\330\014\017\210z\230\027\240\001\330\020\034\230D\240\001\240\021\360\006\000\r\016\330\020\024\220N\240!\2406\250\034\260[\300\001\330\023\024\340\020\024\320\024%\240Q";
static const char __pyx_k_A_Qc_6_d_t1_d_q_q_t_l_m4_TQR_q[] = "\200A\360\010\000\t\026\220Q\220c\230\021\230!\2306\240\021\240$\240d\250%\250t\2601\330\010\026\220d\230%\230q\240\001\340\010\017\210q\360\014\000\005\010\200t\320\013\036\230l\250$\250m\2704\270~\310T\320QR\340\010\017\210q";
static const char __pyx_k_A_t1_A_T_4q_a_D_Q_T_D_t_3_t1_A[] = "\200A\360\014\000\t\013\210&\220\001\220\024\320\025(\250\017\260t\2701\330\021 \240\004\240A\330\021\035\230T\240\036\250|\2704\270q\330\021\"\240$\240a\330\021\034\230D\240\r\250\\\270\024\270Q\330\021\035\230T\240\036\250}\270D\300\001\330\021\037\230t\320#3\260<\270t\3001\330\021 \240\004\240A";
static const char __pyx_k_ConvolutionalDependencyNetwork[] = "ConvolutionalDependencyNetwork";
static const char __pyx_k_ConvolutionalNetwork__validate[] = "ConvolutionalNetwork._validate";
static const char __pyx_k_Kq_L8H_STTXXddtt_A_A_E_E_Q_Q_Z[] = "\200\001\330\004\020\220\014\230K\240q\250\004\250L\3208H\310\013\320ST\320TX\320Xd\320dt\320t\360\000\000@\002A\002\360\000\000A\002E\002\360\000\000E\002Q\002\360\000\000Q\002Z\002\360\000\000Z\002e\002\360\000\000e\002f\002\360\000\000f\002j\002\360\000\000j\002v\002\360\000\000v\002H\003\360\000\000H\003S\003\360\000\000S\003T\003\360\000\000T\003X\003\360\000\000X\003d\003\360\000\000d\003z\003\360\000\000z\003E\004\360\000\000E\004F\004\360\000\000F\004J\004\360\000\000J\004V\004\360\000\000V\004f\004\360\000\000f\004q\004\360\000\000q\004r\004\360\000\000r\004v\004\360\000\000v\004B\005\360\000\000B\005Q\005\360\000\000Q\005\\\005\360\000\000\\\005]\005\360\000\000]\005a\005\360\000\000a\005m\005\360\000\000m\005C\006\360\000\000C\006N\006\360\000\000N\006O\006\360\000\000O\006S\006\360\000\000S\006_\006\360\000\000_\006n\006\360\000\000n\006y\006\360\000\000y\006z\006\360\000\000z\006~\006\360\000\000~\006J\007\360\000\000J\007[\007\360\000\000[\007f\007\360\000\000f\007g\007\360\000\000g\007l\007\360\000\000l\007x\007\360\000\000x\007J\010\360\000\000J\010U\010\360\000\000U\010V\010\360\000\000V\010[\010\360\000\000[\010g\010\360\000\000g\010|\010\360\000\000|\010G\t\360\000\000G\tH\t\360\000\000H\tM\t\360\000\000M\tY\t\360\000\000Y\tg\t\360\000\000g\tr\t\360\000\000r\ts\t\360\000\000s\tx\t\360\000\000x\tD\n\360\000\000D\nT\n\360\000\000T\n_\n\360\000\000_\n`\n\360\000\000`\ne\n\360\000\000e\nq\n\360\000\000q\nG\013\360\000\000G\013R\013\360\000\000R\013S\013\360\000\000S\013X\013\360\000\000X\013d\013\360\000\000d\013u\013\360\000\000u\013@\014\360\000\000@\014A\014\360\000\000A\014F\014\360\000\000F\014R\014\360\000\000R\014c\014\360\000\000c\014n\014\360\000\000n\014o\014\360\000\000o\014t\014\360\000\000t\014@\r\360\000\000@\rZ\r\360\000\000Z\re\r\360\000\000e\rf\r\360\000\000f\rk\r\360\000\000k\rw\r\360\000\000w\rN\016\360\000\000N\016Y\016\360\000\000Y\016Z\016\360\000\000Z\016_\016\360\000\000_\016k\016\360\000\000k\016|\016\360\000\000|\016G\017""\360\000\000G\017H\017\360\000\000H\017M\017\360\000\000M\017Y\017\360\000\000Y\017m\017\360\000\000m\017x\017\360\000\000x\017y\017\360\000\000y\017~\017\360\000\000~\017J\020\360\000\000J\020c\020\360\000\000c\020n\020\360\000\000n\020o\020\360\000\000o\020t\020\360\000\000t\020@\021\360\000\000@\021N\021\360\000\000N\021Y\021\360\000\000Y\021Z\021\360\000\000Z\021_\021\360\000\000_\021k\021\360\000\000k\021z\021\360\000\000z\021E\022\360\000\000E\022F\022\360\000\000F\022K\022\360\000\000K\022W\022\360\000\000W\022f\022\360\000\000f\022q\022\360\000\000q\022r\022\360\000\000r\022w\022\360\000\000w\022C\023\360\000\000C\023U\023\360\000\000U\023`\023\360\000\000`\023a\023\360\000\000a\023f\023\360\000\000f\023r\023\360\000\000r\023B\024\360\000\000B\024M\024\360\000\000M\024N\024\360\000\000N\024S\024\360\000\000S\024_\024\360\000\000_\024p\024\360\000\000p\024{\024\360\000\000{\024|\024\360\000\000|\024A\025\360\000\000A\025M\025\360\000\000M\025\\\025\360\000\000\\\025g\025\360\000\000g\025h\025\360\000\000h\025m\025\360\000\000m\025y\025\360\000\000y\025H\026\360\000\000H\026S\026\360\000\000S\026T\026\360\000\000T\026Y\026\360\000\000Y\026e\026\360\000\000e\026z\026\360\000\000z\026E\027\360\000\000E\027F\027\360\000\000F\027K\027\360\000\000K\027W\027\360\000\000W\027j\027\360\000\000j\027u\027\360\000\000u\027v\027\360\000\000v\027{\027\360\000\000{\027G\030\360\000\000G\030P\030\360\000\000P\030[\030\360\000\000[\030\\\030\360\000\000\\\030a\030\360\000\000a\030m\030\360\000\000m\030@\031\360\000\000@\031K\031\360\000\000K\031L\031\360\000\000L\031Q\031\360\000\000Q\031]\031\360\000\000]\031l\031\360\000\000l\031w\031\360\000\000w\031x\031\360\000\000x\031}\031\360\000\000}\031I\032\360\000\000I\032d\032\360\000\000d\032o\032\360\000\000o\032p\032\360\000\000p\032u\032\360\000\000u\032A\033\360\000\000A\033Y\033\360\000\000Y\033d\033\360\000\000d\033e\033\360\000\000e\033j\033\360\000\000j\033v\033\360\000\000v\033I\034\360\000\000I\034T\034\360\000\000T""\034U\034\360\000\000U\034Z\034\360\000\000Z\034f\034\360\000\000f\034z\034\360\000\000z\034E\035\360\000\000E\035F\035\360\000\000F\035G\035\330\004\007\200s\210!\210=\230\002\230#\230T\240\027\250\001\250\036\260q\330\010\024\220I\230W\240A\240[\260\001\260\021";
static const char __pyx_k_T_D_t3H_O___ggkk_A_A_V_V_Z_Z_i[] = "\200\001\360\010\000\005\016\210T\220\033\230D\240\017\250t\3203H\310\004\310O\320[_\320_g\320gk\320k|\360\000\000}\001A\002\360\000\000A\002V\002\360\000\000V\002Z\002\360\000\000Z\002i\002\360\000\000i\002m\002\360\000\000m\002{\002\360\000\000{\002\002\360\000\000\002[\003\360\000\000[\003_\003\360\000\000_\003n\003\360\000\000n\003r\003\360\000\000r\003F\004\360\000\000F\004J\004\360\000\000J\004Y\004\360\000\000Y\004]\004\360\000\000]\004n\004\360\000\000n\004r\004\360\000\000r\004D\005\360\000\000D\005H\005\360\000\000H\005c\005\360\000\000c\005g\005\360\000\000g\005u\005\360\000\000u\005y\005\360\000\000y\005L\006\360\000\000L\006P\006\360\000\000P\006e\006\360\000\000e\006i\006\360\000\000i\006w\006\360\000\000w\006{\006\360\000\000{\006K\007\360\000\000K\007O\007\360\000\000O\007`\007\360\000\000`\007d\007\360\000\000d\007s\007\360\000\000s\007w\007\360\000\000w\007K\010\360\000\000K\010O\010\360\000\000O\010\\\010\360\000\000\\\010`\010\360\000\000`\010o\010\360\000\000o\010s\010\360\000\000s\010H\t\360\000\000H\tL\t\360\000\000L\t\\\t\360\000\000\\\t`\t\360\000\000`\tp\t\360\000\000p\tt\t\360\000\000t\tM\n\360\000\000M\nQ\n\360\000\000Q\ng\n\360\000\000g\nk\n\360\000\000k\ny\n\360\000\000y\n}\n\360\000\000}\nM\013\360\000\000M\013Q\013\360\000\000Q\013d\013\360\000\000d\013h\013\360\000\000h\013@\014\360\000\000@\014D\014\360\000\000D\014T\014\360\000\000T\014X\014\360\000\000X\014f\014\360\000\000f\014j\014\360\000\000j\014w\014\360\000\000w\014{\014\360\000\000{\014K\r\360\000\000K\rO\r\360\000\000O\r]\r\360\000\000]\ra\r\360\000\000a\ro\r\360\000\000o\rs\r\360\000\000s\rD\016\360\000\000D\016H\016\360\000\000H\016W\016\360\000\000W\016[\016\360\000\000[\016k\016\360\000\000k\016o\016\360\000\000o\016}\016\360\000\000}\016A\017\360\000\000A\017O\017\360\000\000O\017S\017\360\000\000S\017m\017\360\000\000m\017q\017\360\000\000q\017D\020\360\000\000D\020H\020\360\000\000H\020[\020\360\000\000[\020_\020\360\000\000_\020r\020\360\000\000r\020v\020\360""\000\000v\020H\021\360\000\000H\021L\021\360\000\000L\021`\021\360\000\000`\021d\021\360\000\000d\021x\021\360\000\000x\021|\021\360\000\000|\021N\022\360\000\000N\022R\022\360\000\000R\022Z\022\360\000\000Z\022^\022\360\000\000^\022z\022\360\000\000z\022~\022\360\000\000~\022S\023\360\000\000S\023W\023\360\000\000W\023l\023\360\000\000l\023p\023\360\000\000p\023E\024\360\000\000E\024I\024\360\000\000I\024]\024\360\000\000]\024a\024\360\000\000a\024w\024\360\000\000w\024{\024\360\000\000{\024M\025\360\000\000M\025Q\025\360\000\000Q\025_\025\360\000\000_\025c\025\360\000\000c\025}\025\360\000\000}\025A\026\360\000\000A\026X\026\360\000\000X\026\\\026\360\000\000\\\026t\026\360\000\000t\026x\026\360\000\000x\026O\027\360\000\000O\027S\027\360\000\000S\027e\027\360\000\000e\027i\027\360\000\000i\027j\027\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220A\330\010\022\220!\330\010\027\220q\340\010\027\220t\320\033/\250w\260e\2703\270d\320BR\320RY\320Y^\320^a\320ae\360\000\000f\001A\002\360\000\000A\002H\002\360\000\000H\002M\002\360\000\000M\002P\002\360\000\000P\002T\002\360\000\000T\002b\002\360\000\000b\002i\002\360\000\000i\002n\002\360\000\000n\002q\002\360\000\000q\002u\002\360\000\000u\002H\003\360\000\000H\003O\003\360\000\000O\003T\003\360\000\000T\003W\003\360\000\000W\003[\003\360\000\000[\003k\003\360\000\000k\003r\003\360\000\000r\003w\003\360\000\000w\003z\003\360\000\000z\003~\003\360\000\000~\003O\004\360\000\000O\004V\004\360\000\000V\004[\004\360\000\000[\004^\004\360\000\000^\004b\004\360\000\000b\004|\004\360\000\000|\004C\005\360\000\000C\005H\005\360\000\000H\005K\005\360\000\000K\005O\005\360\000\000O\005\\\005\360\000\000\\\005c\005\360\000\000c\005h\005\360\000\000h\005k\005\360\000\000k\005o\005\360\000\000o\005A\006\360\000\000A\006H\006\360\000\000H\006M\006\360\000\000M\006P\006\360\000\000P\006T\006\360\000\000T\006h\006\360\000\000h\006o\006\360\000\000o\006t\006\360\000\000t\006w\006\360\000\000w\006{\006\360\000\000{\006J""\007\360\000\000J\007Q\007\360\000\000Q\007V\007\360\000\000V\007Y\007\360\000\000Y\007]\007\360\000\000]\007m\007\360\000\000m\007t\007\360\000\000t\007y\007\360\000\000y\007|\007\360\000\000|\007@\010\360\000\000@\010N\010\360\000\000N\010U\010\360\000\000U\010Z\010\360\000\000Z\010]\010\360\000\000]\010a\010\360\000\000a\010t\010\360\000\000t\010{\010\360\000\000{\010@\t\360\000\000@\tC\t\360\000\000C\tG\t\360\000\000G\tU\t\360\000\000U\t\\\t\360\000\000\\\ta\t\360\000\000a\td\t\360\000\000d\th\t\360\000\000h\t|\t\360\000\000|\tC\n\360\000\000C\nH\n\360\000\000H\nK\n\360\000\000K\nO\n\360\000\000O\n^\n\360\000\000^\ne\n\360\000\000e\nj\n\360\000\000j\nm\n\360\000\000m\nq\n\360\000\000q\n~\n\360\000\000~\nE\013\360\000\000E\013J\013\360\000\000J\013M\013\360\000\000M\013Q\013\360\000\000Q\013`\013\360\000\000`\013g\013\360\000\000g\013l\013\360\000\000l\013o\013\360\000\000o\013s\013\360\000\000s\013E\014\360\000\000E\014L\014\360\000\000L\014Q\014\360\000\000Q\014T\014\360\000\000T\014X\014\360\000\000X\014o\014\360\000\000o\014v\014\360\000\000v\014{\014\360\000\000{\014~\014\360\000\000~\014B\r\360\000\000B\rQ\r\360\000\000Q\rX\r\360\000\000X\r]\r\360\000\000]\r`\r\360\000\000`\rd\r\360\000\000d\rq\r\360\000\000q\rx\r\360\000\000x\r}\r\360\000\000}\r@\016\360\000\000@\016D\016\360\000\000D\016T\016\360\000\000T\016[\016\360\000\000[\016`\016\360\000\000`\016c\016\360\000\000c\016g\016\360\000\000g\016u\016\360\000\000u\016|\016\360\000\000|\016A\017\360\000\000A\017D\017\360\000\000D\017H\017\360\000\000H\017W\017\360\000\000W\017^\017\360\000\000^\017c\017\360\000\000c\017f\017\360\000\000f\017j\017\360\000\000j\017w\017\360\000\000w\017~\017\360\000\000~\017C\020\360\000\000C\020F\020\360\000\000F\020J\020\360\000\000J\020W\020\360\000\000W\020^\020\360\000\000^\020c\020\360\000\000c\020f\020\360\000\000f\020j\020\360\000\000j\020C\021\360\000\000C\021J\021\360\000\000J\021O\021\360\000\000O\021R\021\360\000\000R\021V\021\360\000\000V\021h\021\360\000\000h""\021o\021\360\000\000o\021t\021\360\000\000t\021w\021\360\000\000w\021{\021\360\000\000{\021M\022\360\000\000M\022T\022\360\000\000T\022Y\022\360\000\000Y\022\\\022\360\000\000\\\022`\022\360\000\000`\022q\022\360\000\000q\022x\022\360\000\000x\022}\022\360\000\000}\022@\023\360\000\000@\023D\023\360\000\000D\023W\023\360\000\000W\023^\023\360\000\000^\023c\023\360\000\000c\023f\023\360\000\000f\023j\023\360\000\000j\023{\023\360\000\000{\023B\024\360\000\000B\024G\024\360\000\000G\024J\024\360\000\000J\024N\024\360\000\000N\024i\024\360\000\000i\024p\024\360\000\000p\024u\024\360\000\000u\024x\024\360\000\000x\024|\024\360\000\000|\024P\025\360\000\000P\025W\025\360\000\000W\025\\\025\360\000\000\\\025_\025\360\000\000_\025c\025\360\000\000c\025w\025\360\000\000w\025~\025\360\000\000~\025C\026\360\000\000C\026F\026\360\000\000F\026J\026\360\000\000J\026]\026\360\000\000]\026d\026\360\000\000d\026i\026\360\000\000i\026l\026\360\000\000l\026p\026\360\000\000p\026E\027\360\000\000E\027L\027\360\000\000L\027Q\027\360\000\000Q\027T\027\360\000\000T\027X\027\360\000\000X\027i\027\360\000\000i\027p\027\360\000\000p\027u\027\360\000\000u\027x\027\360\000\000x\027|\027\360\000\000|\027I\030\360\000\000I\030P\030\360\000\000P\030U\030\360\000\000U\030X\030\360\000\000X\030\\\030\360\000\000\\\030u\030\360\000\000u\030|\030\360\000\000|\030A\031\360\000\000A\031D\031\360\000\000D\031H\031\360\000\000H\031^\031\360\000\000^\031e\031\360\000\000e\031j\031\360\000\000j\031m\031\360\000\000m\031q\031\360\000\000q\031H\032\360\000\000H\032O\032\360\000\000O\032T\032\360\000\000T\032W\032\360\000\000W\032[\032\360\000\000[\032q\032\360\000\000q\032x\032\360\000\000x\032}\032\360\000\000}\032@\033\360\000\000@\033D\033\360\000\000D\033U\033\360\000\000U\033\\\033\360\000\000\\\033]\033\330\004\007\200q\330\010\017\320\0175\260T\270\021\270'\300\033\310G\320ST\340\010\017\320\0175\260T\270\021\270'\300\033\310A";
static const char __pyx_k_pyx_unpickle_ConvolutionalDepe[] = "__pyx_unpickle_ConvolutionalDependencyNetwork";
static const char __pyx_k_pyx_unpickle_ConvolutionalNetw[] = "__pyx_unpickle_ConvolutionalNetwork";
static const char __pyx_k_pyx_unpickle_Network__set_stat[] = "__pyx_unpickle_Network__set_state";
static const char __pyx_k_6a_6_3a_a_5_q_1_RvRs_d_b_b_1Kt1[] = "\320\0046\260a\360\030\000\t\"\240\022\2406\250\022\2503\250a\250{\270$\270a\340\010\023\2205\230\007\230q\330\010\013\2101\330\014\020\320\020%\240R\240v\250R\250s\260!\260;\270d\300!\340\014\020\320\020&\240b\250\006\250b\260\003\2601\260K\270t\3001\340\014\020\320\020&\240b\250\006\250b\260\003\2601\260K\270t\3001\340\010\014\320\014$\240A\240Q\360\006\000\t\r\210E\220\025\220a\220s\230!\2301\330\014\031\230\024\320\035-\250Q\250b\260\002\260\"\260D\3208J\310(\320RS\360\006\000\r\021\320\020!\240\024\240_\260D\270\001\270\034\300R\300t\3101\330\014\020\320\020!\240\030\250\021\250$\320.F\300d\310!\330\014\025\220T\230\037\250\004\250A\250T\3201A\300\022\3004\300q\330\014\022\220!\2205\230\001\340\014\017\210q\330\020\024\320\024&\240a\240u\250A\330\020\024\320\024'\240q\250\005\250T\260\021\330\020\024\320\024'\240q\250\005\250T\260\021\340\010\013\2101\330\014\017\210t\320\023,\250A\250V\2601\330\020\024\220O\2401\240A\340\010\017\210q";
static const char __pyx_k_A_1_A_5_q_q_C_IQa_XT_A_PQQR__AQ[] = "\200A\360\006\000!<\2701\330)<\270A\360\032\000\t\022\220\021\330\010\023\2205\230\007\230q\330\010\014\320\014\037\230q\240\n\250!\360\006\000\t\r\210C\210}\230I\240Q\240a\330\014\035\230X\240T\250\024\320-A\300\037\320PQ\320QR\330\014\035\230_\250A\250Q\340\014\033\2304\320\0375\260Q\260j\300\013\320K[\320[\\\330\014\032\230$\230i\240q\250\016\260a\340\014\017\210q\330\020\034\230D\240\001\240\021\330\020\023\2204\320\027,\250A\250[\270\001\330\024\030\230\017\240q\330\024\030\320\0300\260\001\260\032\270;\300a\330\024\030\320\030(\250\001\250\033\260A\330\024\030\320\030)\250\021\250*\260A\340\014\017\210q\330\020\023\2204\220q\330\024\032\320\032-\250Q\250a\340\020\035\230T\320!7\260q\270\001\330\020\035\230S\240\001\240\032\2502\250Q\330\020\031\230\022\2304\230q\240\002\240$\240a\240r\250\024\250Q\250j\270\001\270\021\330\020\035\230T\240\036\250r\260\021\330\020\037\230}\250A\340\014\022\220'\230\021\230!\340\010\017\210q";
static const char __pyx_k_A_4_1_b_r_Q_Q_a_F_Cq_4q_a_R_1_U[] = "\200A\360\024\000\t\014\2104\320\017!\240\022\2401\330\014\036\230b\240\007\240r\250\024\250Q\330)*\330)-\250Q\340\014\036\230a\340\010\014\320\014\"\240\"\240F\250\"\250C\250q\260\013\2704\270q\360\010\000\t\"\240\037\260\002\260$\260a\340\010\025\220R\220|\2401\330$%\240U\250!\2501\330%)\320):\270!\330%)\250\027\260\t\270\023\270A\270Q\330=A\300\021\360\006\000\t\r\320\014\037\230q\240\005\240T\250\037\270\004\270A\270Q\330\010\013\2101\340\014\020\320\020\"\240!\2405\250\001\360\006\000\t\r\210C\210{\230)\2401\240O\2601\260D\3208M\310Q\330\014\027\220r\230\034\240Q\240a\240u\250A\250W\260A\330'.\250i\260s\270!\2709\300D\310\001\360\006\000\r\032\230\022\230<\240r\250\032\2601\260D\270\001\330)*\360\006\000\r\021\320\020#\2401\240E\250\024\250_\270D\300\001\300\021\330\014\017\210q\330\020\024\320\024&\240a\240u\250A";
static const char __pyx_k_A_4_CuCs_83a_6_b_1A_axq_1E_q_2T[] = "\200A\360\020\000\t\014\2104\210}\230C\230u\240C\240s\250!\2508\2603\260a\330\014\023\2206\230\027\240\001\240\021\340\010\026\220b\230\013\2401\240A\340\010\031\230\022\230;\240a\240x\250q\360\n\000\t\024\2201\220E\230\026\230q\240\003\2402\240T\250\034\260R\260q\340\010\027\220r\230\027\240\001\240\024\240Q\330\010\026\220d\230,\240c\250\021\360\006\000\t\r\210E\220\026\220q\230\003\2303\230a\230q\360\006\000\r%\240K\250q\260\002\260\"\260C\260r\270\033\300C\300q\360\006\000\r\033\230!\2305\320 4\260G\2701\270A\330\014\027\220q\230\005\320\0351\260\021\260.\300\001\300\021\3302@\300\002\300&\310\001\310\021\360\010\000\t\022\220\022\2206\230\021\230#\230Q\230i\240v\250Q\330\010\016\210b\220\005\220[\240\002\240\"\240G\2501\330\010\014\320\014\034\230K\240r\250\022\2501\250F\260\"\260A\330\010\027\220~\240R\240r\250\021\250&\260\002\260!\340\010\014\210E\220\025\220a\220s\230!\2308\2402\240S\250\004\250A\330\014\022\220!\2205\230\001\330\014\033\230>\250\021\250\"\250A\250Q\340\010\016\210a\210u\220A\330\010\017\210q";
static const char __pyx_k_A_4_T_a_4_q_2Yat1_Q_D_at1_IRy_Q[] = "\200A\360\024\000\t\024\2204\220~\240T\250\021\250$\250a\340\010\013\2104\320\017 \240\007\240q\340\014\032\230)\2402\240Y\250a\250t\2601\330\014\020\320\020%\240Q\340\014\020\320\020$\240D\320(:\270$\270a\270t\3001\360\006\000\r\021\320\020$\240I\250R\250y\270\001\270\024\270Q";
static const char __pyx_k_A_4t_CvS_c_r_Bd_Bb_b_A_a_q_4_G1[] = "\200A\360\010\000\t\014\2104\210t\320\023,\250C\250v\260S\270\001\330\014\r\360\n\000\t\023\220$\220c\230\026\230r\240\023\240B\240d\250/\270\023\270B\270b\300\006\300b\310\004\310A\330\010\014\320\014\036\230a\330\010\014\320\014'\240q\330\010\013\2104\210}\230G\2401\330\014\020\320\020(\250\001";
static const char __pyx_k_A_L_a_a_r_r_A_t1_1_Cy_a_uF_1_Yb[] = "\200A\360\n\000\t+\250\"\250L\270\002\270$\270a\330:;\330:>\270a\360\006\000\t\033\230/\250\027\260\001\260\021\360\006\000\t\r\320\014\037\230r\240\026\240r\250\023\250A\320-?\270t\3001\330\010\023\2201\340\010\014\210C\210y\230\t\240\021\240$\240a\330\014\027\220u\230F\240!\2401\330\014\025\220Y\230b\240\001\340\014\034\230O\2504\250q\330\014\031\230\025\230e\2401\240O\2605\270\001\330\014\020\320\020 \240\004\240I\250Z\260q\340\014\027\220q";
static const char __pyx_k_A_Q_a_N_O1_O1_Rq_O1_a_O1_a_O1_A[] = "\200A\340\035\036\360\022\000\t\r\320\014\035\230Q\330\010\014\320\014&\240a\340\010\014\320\014 \240\001\330\010\014\210N\230!\330\010\014\210O\2301\330\010\014\210O\2301\330\010\014\320\014\"\240+\250R\250q\360\010\000\t\r\210O\2301\340\010\014\320\014\036\230a\330\010\014\210O\2301\330\010\014\320\014\036\230a\330\010\014\210O\2301\340\010\014\320\014$\240A\330\010\014\320\014\037\230q\340\010\014\320\014'\240q";
static const char __pyx_k_A_Qa_d_1_aq_t1A_Qa_d_1_4q_T_d_1[] = "\200A\360\016\000\t\032\230\024\230Q\230a\330\010\026\220d\230!\2301\330\010\032\230$\230a\230q\340\010\027\220t\2301\230A\330\010\031\230\024\230Q\230a\330\010\026\220d\230!\2301\340\010\033\2304\230q\240\001\330\010\025\220T\230\021\230!\330\010\026\220d\230!\2301\330\010\027\220t\2301\230A\330\010\026\220d\230!\2301\360\006\000\t\014\210?\230'\240\023\240A\330\014\036\230a\330\014\033\2301\330\014\033\2301\340\010\r\210S\220\001\320\021#\240<\250}\270A\330\021\036\320\036.\250a\330\021\025\220Q\320\026.\250d\260!\2601\330\021\"\240!\330\021!\240\021\340\010\n\320\n\037\230t\2401\240A\330\010\n\320\n\035\230T\240\021\240!\360\006\000\t\013\320\n\032\230$\230a\230q\330\010\n\320\n\033\2304\230q\240\001\330\010\n\210/\230\022\2306\240\021\240#\240Q\240b\320(:\270#\270U\300!\3002\300Q\330\010\n\210/\230\022\2306\240\021\240#\240Q\240b\320(:\270#\270U\300!\3002\300Q\330\010\n\320\n\034\230D\240\001\240\024\240Q\240a\330\010\n\320\n\036\230a\340\010\017\210q";
static const char __pyx_k_A_e1A_s_1_t1A_s_s_c_WAQ_6_A_A_6[] = "\200A\360\016\000\t\027\220e\2301\230A\330\010\017\210s\220!\2201\330\010\017\210t\2201\220A\340\010\013\210<\220s\230%\230s\240,\250c\260\021\340\014\025\220W\230A\230Q\330\014\023\2206\230\021\330\014\024\220A\340\r\031\230\023\230A\340\014\023\2206\230\021\330\014\024\220C\220q\230\001\230\021\330\014\022\220,\230c\240\021\330\020\025\220T\230\021\230!\330\020\036\230e\2401\240A\340\014\027\220w\230a\230q\340\r\031\230\023\230A\360\006\000\r\024\2206\230\021\330\014\024\220A\360\010\000\r\025\220D\320\030.\250a\250w\260m\3001\330/:\270!\340\010\017\210q";
static const char __pyx_k_A_neural_network_for_NLP_taggin[] = "\nA neural network for NLP tagging tasks.\nIt employs feature tables to store feature vectors for each token.\n";
static const char __pyx_k_A_q_Q_E_as_4q_4_AQ_D_1_t_Cq_A_D[] = "\200A\360\010\000\t\020\210q\330\010\025\220Q\330\010\030\230\001\340\010\014\210E\220\025\220a\220s\230!\2304\230q\330\014\023\2204\320\027,\250A\250Q\330\014\024\220D\320\030)\250\021\250!\330\014\033\2301\340\014\017\210t\320\023$\240C\240q\340\020\031\230\024\320\035@\300\001\300\021\330\020\034\230A\360\006\000\021\035\230D\320 0\260\001\260\021\330\020\031\230\024\320\035>\270a\270v\300Q\340\014\020\220\005\220U\230!\2303\230a\230q\330\020\032\230&\240\001\240\021\330\020\033\2309\240A\240Q\340\020\023\2208\2303\230i\240t\2509\260C\260r\270\024\270X\300S\310\003\3101\310A\330\024\034\230A\340\024#\2401\340\014\017\210q\330\020!\240\021\330\014\032\230#\230Q\230a\340\010\014\210L\230\005\230Q\230f\240B\240a\330\010\014\320\014!\240\025\240a\240\260b\270\003\2701\270D\300\001";
static const char __pyx_k_A_r_Qa_R_3b_D_A_Q_E_s_6_avQha_Q[] = "\200A\360\034\000\t\030\220r\230\024\230Q\230a\360\006\000\t\r\320\014\035\230R\230|\2503\250b\260\014\270D\300\001\300\023\300A\360\006\000\t\036\230Q\330\010\020\220\001\330\010\014\210E\220\036\230s\240!\2406\250\021\330\014\020\220\016\230a\230v\240Q\240h\250a\330\014\025\220Q\330\014\"\240*\250A\250Q\360\010\000\t\021\220\t\230\021\230(\240\"\240A\360\006\000\t\r\210J\220a\340\010\017\210q";
static const char __pyx_k_A_r_aq_Qa_d_1_Qa_d_1_4q_T_d_1_d[] = "\200A\360\016\000\t\020\210r\220\025\220a\220q\360\010\000\t\032\230\024\230Q\230a\330\010\026\220d\230!\2301\330\010\031\230\024\230Q\230a\330\010\026\220d\230!\2301\340\010\033\2304\230q\240\001\330\010\025\220T\230\021\230!\330\010\026\220d\230!\2301\330\010\026\220d\230!\2301\330\010\013\210>\230\023\230A\330\014\032\230$\230a\230q\340\014\032\230!\340\010\r\210W\220A\320\025'\240|\260=\300\001\330\025%\240]\3202B\300!\330\025\026\340\010\n\320\n\032\230$\230a\230q\330\010\n\320\n\033\2304\230q\240\001\330\010\n\210/\230\022\2306\240\022\2402\320%7\260s\270%\270q\300\002\300!\330\010\n\210/\230\022\2306\240\022\2402\320%7\260s\270%\270q\300\002\300!\330\010\n\320\n\034\230D\240\001\240\024\240Q\240a\330\010\n\320\n\036\230a\340\010\017\210q";
static const char __pyx_k_A_r_at1_d_1_O4q_d_1_O4q_d_4q_4q[] = "\200A\360\010\000\t\020\210r\220\025\220a\220t\2301\330\010\014\320\014\036\230d\240!\2401\330\010\014\210O\2304\230q\240\001\330\010\014\320\014\036\230d\240!\2401\330\010\014\210O\2304\230q\240\001\330\010\014\320\014\036\230d\240!\2404\240q\250\001\360\006\000\t\014\2104\210q\220\016\230g\240S\250\001\330\014\020\220\017\230t\2401\240A\340\014\020\220\017\230q";
static const char __pyx_k_A_r_at1_d_1_O4q_d_1_O4q_d_4q_Qa[] = "\200A\360\n\000\t\020\210r\220\025\220a\220t\2301\330\010\014\320\014\036\230d\240!\2401\330\010\014\210O\2304\230q\240\001\330\010\014\320\014\036\230d\240!\2401\330\010\014\210O\2304\230q\240\001\330\010\014\320\014\036\230d\240!\2404\240q\250\001\330\010\014\320\014!\240\024\240Q\240a\330\010\014\320\014\037\230t\2401\240A\360\006\000\t\014\2104\210q\220\016\230g\240S\250\001\330\014\020\220\017\230t\2401\240A\340\014\020\220\017\230q\360\006\000\t\014\2104\210q\320\020\"\240'\250\023\250A\330\014\020\320\020#\2404\240q\250\001\330\014\020\320\020 \240\004\240A\240Q\340\014\020\320\020#\2401";
static const char __pyx_k_ConvolutionalNetwork___setstate[] = "ConvolutionalNetwork.__setstate_cython__";
static const char __pyx_k_ConvolutionalNetwork__calculate[] = "ConvolutionalNetwork._calculate_gradients";
static const char __pyx_k_ConvolutionalNetwork__load_from[] = "ConvolutionalNetwork._load_from_file";
static const char __pyx_k_ConvolutionalNetwork_create_new[] = "ConvolutionalNetwork.create_new";
static const char __pyx_k_Distance_table_sizes_target_and[] = "\nDistance table sizes (target and predicate): ";
static const char __pyx_k_Kq_L8H_STTXXddz_F_F_G_G_K_K_W_W[] = "\200\001\330\004\020\220\014\230K\240q\250\004\250L\3208H\310\013\320ST\320TX\320Xd\320dz\360\000\000{\001F\002\360\000\000F\002G\002\360\000\000G\002K\002\360\000\000K\002W\002\360\000\000W\002g\002\360\000\000g\002r\002\360\000\000r\002s\002\360\000\000s\002w\002\360\000\000w\002C\003\360\000\000C\003L\003\360\000\000L\003W\003\360\000\000W\003X\003\360\000\000X\003\\\003\360\000\000\\\003h\003\360\000\000h\003z\003\360\000\000z\003E\004\360\000\000E\004F\004\360\000\000F\004J\004\360\000\000J\004V\004\360\000\000V\004l\004\360\000\000l\004w\004\360\000\000w\004x\004\360\000\000x\004|\004\360\000\000|\004H\005\360\000\000H\005X\005\360\000\000X\005c\005\360\000\000c\005d\005\360\000\000d\005h\005\360\000\000h\005t\005\360\000\000t\005C\006\360\000\000C\006N\006\360\000\000N\006O\006\360\000\000O\006S\006\360\000\000S\006_\006\360\000\000_\006|\006\360\000\000|\006G\007\360\000\000G\007H\007\360\000\000H\007L\007\360\000\000L\007X\007\360\000\000X\007h\007\360\000\000h\007s\007\360\000\000s\007t\007\360\000\000t\007y\007\360\000\000y\007E\010\360\000\000E\010Z\010\360\000\000Z\010e\010\360\000\000e\010f\010\360\000\000f\010k\010\360\000\000k\010w\010\360\000\000w\010G\t\360\000\000G\tR\t\360\000\000R\tS\t\360\000\000S\tX\t\360\000\000X\td\t\360\000\000d\tv\t\360\000\000v\tA\n\360\000\000A\nB\n\360\000\000B\nG\n\360\000\000G\nS\n\360\000\000S\nf\n\360\000\000f\nq\n\360\000\000q\nr\n\360\000\000r\nw\n\360\000\000w\nC\013\360\000\000C\013_\013\360\000\000_\013j\013\360\000\000j\013k\013\360\000\000k\013p\013\360\000\000p\013|\013\360\000\000|\013K\014\360\000\000K\014V\014\360\000\000V\014W\014\360\000\000W\014\\\014\360\000\000\\\014h\014\360\000\000h\014|\014\360\000\000|\014G\r\360\000\000G\rH\r\360\000\000H\rM\r\360\000\000M\rY\r\360\000\000Y\ro\r\360\000\000o\rz\r\360\000\000z\r{\r\360\000\000{\r@\016\360\000\000@\016L\016\360\000\000L\016[\016\360\000\000[\016f\016\360\000\000f\016g\016\360\000\000g\016l\016\360\000\000l\016x\016\360\000\000x\016I\017\360\000""\000I\017T\017\360\000\000T\017U\017\360\000\000U\017Z\017\360\000\000Z\017f\017\360\000\000f\017x\017\360\000\000x\017C\020\360\000\000C\020D\020\360\000\000D\020I\020\360\000\000I\020U\020\360\000\000U\020e\020\360\000\000e\020p\020\360\000\000p\020q\020\360\000\000q\020v\020\360\000\000v\020B\021\360\000\000B\021W\021\360\000\000W\021b\021\360\000\000b\021c\021\360\000\000c\021h\021\360\000\000h\021t\021\360\000\000t\021B\022\360\000\000B\022M\022\360\000\000M\022N\022\360\000\000N\022S\022\360\000\000S\022_\022\360\000\000_\022o\022\360\000\000o\022z\022\360\000\000z\022{\022\360\000\000{\022@\023\360\000\000@\023L\023\360\000\000L\023b\023\360\000\000b\023m\023\360\000\000m\023n\023\360\000\000n\023s\023\360\000\000s\023\023\360\000\000\023P\024\360\000\000P\024[\024\360\000\000[\024\\\024\360\000\000\\\024a\024\360\000\000a\024m\024\360\000\000m\024~\024\360\000\000~\024I\025\360\000\000I\025J\025\360\000\000J\025O\025\360\000\000O\025[\025\360\000\000[\025u\025\360\000\000u\025@\026\360\000\000@\026A\026\360\000\000A\026F\026\360\000\000F\026R\026\360\000\000R\026i\026\360\000\000i\026t\026\360\000\000t\026u\026\360\000\000u\026z\026\360\000\000z\026F\027\360\000\000F\027U\027\360\000\000U\027`\027\360\000\000`\027a\027\360\000\000a\027f\027\360\000\000f\027r\027\360\000\000r\027C\030\360\000\000C\030N\030\360\000\000N\030O\030\360\000\000O\030T\030\360\000\000T\030`\030\360\000\000`\030t\030\360\000\000t\030\030\360\000\000\030@\031\360\000\000@\031E\031\360\000\000E\031Q\031\360\000\000Q\031j\031\360\000\000j\031u\031\360\000\000u\031v\031\360\000\000v\031{\031\360\000\000{\031G\032\360\000\000G\032X\032\360\000\000X\032c\032\360\000\000c\032d\032\360\000\000d\032i\032\360\000\000i\032u\032\360\000\000u\032D\033\360\000\000D\033O\033\360\000\000O\033P\033\360\000\000P\033U\033\360\000\000U\033a\033\360\000\000a\033o\033\360\000\000o\033z\033\360\000\000z\033{\033\360\000\000{\033@\034\360\000\000@\034L\034\360\000\000L\034]\034\360\000\000]\034h\034""\360\000\000h\034i\034\360\000\000i\034n\034\360\000\000n\034z\034\360\000\000z\034I\035\360\000\000I\035T\035\360\000\000T\035U\035\360\000\000U\035Z\035\360\000\000Z\035f\035\360\000\000f\035u\035\360\000\000u\035@\036\360\000\000@\036A\036\360\000\000A\036F\036\360\000\000F\036R\036\360\000\000R\036d\036\360\000\000d\036o\036\360\000\000o\036p\036\360\000\000p\036u\036\360\000\000u\036A\037\360\000\000A\037Q\037\360\000\000Q\037\\\037\360\000\000\\\037]\037\360\000\000]\037b\037\360\000\000b\037n\037\360\000\000n\037\037\360\000\000\037J \360\000\000J K \360\000\000K P \360\000\000P \\ \360\000\000\\ k \360\000\000k v \360\000\000v w \360\000\000w | \360\000\000| H!\360\000\000H!W!\360\000\000W!b!\360\000\000b!c!\360\000\000c!h!\360\000\000h!t!\360\000\000t!O\"\360\000\000O\"Z\"\360\000\000Z\"[\"\360\000\000[\"`\"\360\000\000`\"l\"\360\000\000l\"@#\360\000\000@#K#\360\000\000K#L#\360\000\000L#Q#\360\000\000Q#]#\360\000\000]#q#\360\000\000q#|#\360\000\000|#}#\360\000\000}#B$\360\000\000B$N$\360\000\000N$b$\360\000\000b$m$\360\000\000m$n$\360\000\000n$s$\360\000\000s$$\360\000\000$R%\360\000\000R%]%\360\000\000]%^%\360\000\000^%c%\360\000\000c%o%\360\000\000o%D&\360\000\000D&O&\360\000\000O&P&\360\000\000P&U&\360\000\000U&a&\360\000\000a&v&\360\000\000v&A'\360\000\000A'B'\360\000\000B'G'\360\000\000G'S'\360\000\000S'f'\360\000\000f'q'\360\000\000q'r'\360\000\000r'w'\360\000\000w'C(\360\000\000C(L(\360\000\000L(W(\360\000\000W(X(\360\000\000X(](\360\000\000](i(\360\000\000i(F)\360\000\000F)Q)\360\000\000Q)R)\360\000\000R)W)\360\000\000W)c)\360\000\000c)y)\360\000\000y)D*\360\000\000D*E*\360\000\000E*J*\360\000\000J*V*\360\000\000V*l*\360\000\000l*w*\360\000\000w*x*\360\000\000x*}*\360\000\000}*I+\360\000\000I+_+\360\000\000_+j+\360\000\000j+k+\360\000\000k+p+\360\000\000p+|+\360\000\000|+Q,\360\000\000Q,\\,\360\000\000\\,],\360\000\000],b,\360\000\000b,n,\360\000\000n,E-\360\000\000E-P-\360\000\000P-Q-\360\000\000Q-V-\360\000\000V-b-\360\000\000b-u-\360\000\000u""-@.\360\000\000@.A.\360\000\000A.F.\360\000\000F.R.\360\000\000R.a.\360\000\000a.l.\360\000\000l.m.\360\000\000m.r.\360\000\000r.~.\360\000\000~.Y/\360\000\000Y/d/\360\000\000d/e/\360\000\000e/j/\360\000\000j/v/\360\000\000v/N0\360\000\000N0Y0\360\000\000Y0Z0\360\000\000Z0_0\360\000\000_0k0\360\000\000k0D1\360\000\000D1O1\360\000\000O1P1\360\000\000P1U1\360\000\000U1a1\360\000\000a1y1\360\000\000y1D2\360\000\000D2E2\360\000\000E2J2\360\000\000J2V2\360\000\000V2i2\360\000\000i2t2\360\000\000t2u2\360\000\000u2z2\360\000\000z2F3\360\000\000F3Z3\360\000\000Z3e3\360\000\000e3f3\360\000\000f3g3\330\004\007\200s\210!\210=\230\002\230#\230T\240\027\250\001\250\036\260q\330\010\024\220I\230W\240A\240[\260\001\260\021";
static const char __pyx_k_Network__create_sentence_lookup[] = "Network._create_sentence_lookup";
static const char __pyx_k_Network_decrease_learning_rates[] = "Network.decrease_learning_rates";
static const char __pyx_k_Network_set_learning_rate_decay[] = "Network.set_learning_rate_decay";
static const char __pyx_k_T_D_t3H_O___ttx_y_A_A_E_E_V_V_Z[] = "\200\001\360\010\000\005\016\210T\220\033\230D\240\017\250t\3203H\310\004\310O\320[_\320_t\320tx\360\000\000y\001A\002\360\000\000A\002E\002\360\000\000E\002V\002\360\000\000V\002Z\002\360\000\000Z\002o\002\360\000\000o\002s\002\360\000\000s\002B\003\360\000\000B\003F\003\360\000\000F\003T\003\360\000\000T\003X\003\360\000\000X\003t\003\360\000\000t\003x\003\360\000\000x\003G\004\360\000\000G\004K\004\360\000\000K\004_\004\360\000\000_\004c\004\360\000\000c\004r\004\360\000\000r\004v\004\360\000\000v\004G\005\360\000\000G\005K\005\360\000\000K\005]\005\360\000\000]\005a\005\360\000\000a\005|\005\360\000\000|\005@\006\360\000\000@\006N\006\360\000\000N\006R\006\360\000\000R\006e\006\360\000\000e\006i\006\360\000\000i\006~\006\360\000\000~\006B\007\360\000\000B\007P\007\360\000\000P\007T\007\360\000\000T\007d\007\360\000\000d\007h\007\360\000\000h\007y\007\360\000\000y\007}\007\360\000\000}\007L\010\360\000\000L\010P\010\360\000\000P\010d\010\360\000\000d\010h\010\360\000\000h\010u\010\360\000\000u\010y\010\360\000\000y\010H\t\360\000\000H\tL\t\360\000\000L\ta\t\360\000\000a\te\t\360\000\000e\tu\t\360\000\000u\ty\t\360\000\000y\tI\n\360\000\000I\nM\n\360\000\000M\nf\n\360\000\000f\nj\n\360\000\000j\n@\013\360\000\000@\013D\013\360\000\000D\013R\013\360\000\000R\013V\013\360\000\000V\013f\013\360\000\000f\013j\013\360\000\000j\013}\013\360\000\000}\013A\014\360\000\000A\014Y\014\360\000\000Y\014]\014\360\000\000]\014m\014\360\000\000m\014q\014\360\000\000q\014\014\360\000\000\014C\r\360\000\000C\rP\r\360\000\000P\rT\r\360\000\000T\rd\r\360\000\000d\rh\r\360\000\000h\rv\r\360\000\000v\rz\r\360\000\000z\rH\016\360\000\000H\016L\016\360\000\000L\016]\016\360\000\000]\016a\016\360\000\000a\016p\016\360\000\000p\016t\016\360\000\000t\016D\017\360\000\000D\017H\017\360\000\000H\017V\017\360\000\000V\017Z\017\360\000\000Z\017h\017\360\000\000h\017l\017\360\000\000l\017F\020\360\000\000F\020J\020\360\000\000J\020]\020\360\000\000]\020a\020\360\000\000a\020t\020\360\000\000t""\020x\020\360\000\000x\020K\021\360\000\000K\021O\021\360\000\000O\021a\021\360\000\000a\021e\021\360\000\000e\021y\021\360\000\000y\021}\021\360\000\000}\021Q\022\360\000\000Q\022U\022\360\000\000U\022g\022\360\000\000g\022k\022\360\000\000k\022s\022\360\000\000s\022w\022\360\000\000w\022S\023\360\000\000S\023W\023\360\000\000W\023l\023\360\000\000l\023p\023\360\000\000p\023E\024\360\000\000E\024I\024\360\000\000I\024^\024\360\000\000^\024b\024\360\000\000b\024v\024\360\000\000v\024z\024\360\000\000z\024P\025\360\000\000P\025T\025\360\000\000T\025f\025\360\000\000f\025j\025\360\000\000j\025x\025\360\000\000x\025|\025\360\000\000|\025V\026\360\000\000V\026Z\026\360\000\000Z\026q\026\360\000\000q\026u\026\360\000\000u\026H\027\360\000\000H\027L\027\360\000\000L\027d\027\360\000\000d\027h\027\360\000\000h\027\027\360\000\000\027C\030\360\000\000C\030U\030\360\000\000U\030Y\030\360\000\000Y\030Z\030\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220A\330\010\022\220!\330\010\027\220q\340\010\027\220t\320\033/\250w\260e\2703\270d\320BV\320V]\320]b\320be\320ei\320iy\360\000\000z\001A\002\360\000\000A\002F\002\360\000\000F\002I\002\360\000\000I\002M\002\360\000\000M\002h\002\360\000\000h\002o\002\360\000\000o\002t\002\360\000\000t\002w\002\360\000\000w\002{\002\360\000\000{\002I\003\360\000\000I\003P\003\360\000\000P\003U\003\360\000\000U\003X\003\360\000\000X\003\\\003\360\000\000\\\003o\003\360\000\000o\003v\003\360\000\000v\003{\003\360\000\000{\003~\003\360\000\000~\003B\004\360\000\000B\004R\004\360\000\000R\004Y\004\360\000\000Y\004^\004\360\000\000^\004a\004\360\000\000a\004e\004\360\000\000e\004v\004\360\000\000v\004}\004\360\000\000}\004B\005\360\000\000B\005E\005\360\000\000E\005I\005\360\000\000I\005c\005\360\000\000c\005j\005\360\000\000j\005o\005\360\000\000o\005r\005\360\000\000r\005v\005\360\000\000v\005C\006\360\000\000C\006J\006\360\000\000J\006O\006\360\000\000O\006R\006\360\000\000R\006V\006\360\000\000V\006h\006\360\000\000h\006o\006\360""\000\000o\006t\006\360\000\000t\006w\006\360\000\000w\006{\006\360\000\000{\006O\007\360\000\000O\007V\007\360\000\000V\007[\007\360\000\000[\007^\007\360\000\000^\007b\007\360\000\000b\007q\007\360\000\000q\007x\007\360\000\000x\007}\007\360\000\000}\007@\010\360\000\000@\010D\010\360\000\000D\010T\010\360\000\000T\010[\010\360\000\000[\010`\010\360\000\000`\010c\010\360\000\000c\010g\010\360\000\000g\010u\010\360\000\000u\010|\010\360\000\000|\010A\t\360\000\000A\tD\t\360\000\000D\tH\t\360\000\000H\t[\t\360\000\000[\tb\t\360\000\000b\tg\t\360\000\000g\tj\t\360\000\000j\tn\t\360\000\000n\t|\t\360\000\000|\tC\n\360\000\000C\nH\n\360\000\000H\nK\n\360\000\000K\nO\n\360\000\000O\nc\n\360\000\000c\nj\n\360\000\000j\no\n\360\000\000o\nr\n\360\000\000r\nv\n\360\000\000v\nE\013\360\000\000E\013L\013\360\000\000L\013Q\013\360\000\000Q\013T\013\360\000\000T\013X\013\360\000\000X\013e\013\360\000\000e\013l\013\360\000\000l\013q\013\360\000\000q\013t\013\360\000\000t\013x\013\360\000\000x\013G\014\360\000\000G\014N\014\360\000\000N\014S\014\360\000\000S\014V\014\360\000\000V\014Z\014\360\000\000Z\014l\014\360\000\000l\014s\014\360\000\000s\014x\014\360\000\000x\014{\014\360\000\000{\014\014\360\000\000\014V\r\360\000\000V\r]\r\360\000\000]\rb\r\360\000\000b\re\r\360\000\000e\ri\r\360\000\000i\rx\r\360\000\000x\r\r\360\000\000\rD\016\360\000\000D\016G\016\360\000\000G\016K\016\360\000\000K\016X\016\360\000\000X\016_\016\360\000\000_\016d\016\360\000\000d\016g\016\360\000\000g\016k\016\360\000\000k\016{\016\360\000\000{\016B\017\360\000\000B\017G\017\360\000\000G\017J\017\360\000\000J\017N\017\360\000\000N\017\\\017\360\000\000\\\017c\017\360\000\000c\017h\017\360\000\000h\017k\017\360\000\000k\017o\017\360\000\000o\017~\017\360\000\000~\017E\020\360\000\000E\020J\020\360\000\000J\020M\020\360\000\000M\020Q\020\360\000\000Q\020^\020\360\000\000^\020e\020\360\000\000e\020j\020\360\000\000j\020m\020\360\000\000m\020q\020\360\000\000q\020~\020\360\000\000~\020E\021\360\000""\000E\021J\021\360\000\000J\021M\021\360\000\000M\021Q\021\360\000\000Q\021j\021\360\000\000j\021q\021\360\000\000q\021v\021\360\000\000v\021y\021\360\000\000y\021}\021\360\000\000}\021O\022\360\000\000O\022V\022\360\000\000V\022[\022\360\000\000[\022^\022\360\000\000^\022b\022\360\000\000b\022t\022\360\000\000t\022{\022\360\000\000{\022@\023\360\000\000@\023C\023\360\000\000C\023G\023\360\000\000G\023X\023\360\000\000X\023_\023\360\000\000_\023d\023\360\000\000d\023g\023\360\000\000g\023k\023\360\000\000k\023~\023\360\000\000~\023E\024\360\000\000E\024J\024\360\000\000J\024M\024\360\000\000M\024Q\024\360\000\000Q\024b\024\360\000\000b\024i\024\360\000\000i\024n\024\360\000\000n\024q\024\360\000\000q\024u\024\360\000\000u\024P\025\360\000\000P\025W\025\360\000\000W\025\\\025\360\000\000\\\025_\025\360\000\000_\025c\025\360\000\000c\025w\025\360\000\000w\025~\025\360\000\000~\025C\026\360\000\000C\026F\026\360\000\000F\026J\026\360\000\000J\026^\026\360\000\000^\026e\026\360\000\000e\026j\026\360\000\000j\026m\026\360\000\000m\026q\026\360\000\000q\026D\027\360\000\000D\027K\027\360\000\000K\027P\027\360\000\000P\027S\027\360\000\000S\027W\027\360\000\000W\027l\027\360\000\000l\027s\027\360\000\000s\027x\027\360\000\000x\027{\027\360\000\000{\027\027\360\000\000\027P\030\360\000\000P\030W\030\360\000\000W\030\\\030\360\000\000\\\030_\030\360\000\000_\030c\030\360\000\000c\030p\030\360\000\000p\030w\030\360\000\000w\030|\030\360\000\000|\030\030\360\000\000\030C\031\360\000\000C\031\\\031\360\000\000\\\031c\031\360\000\000c\031h\031\360\000\000h\031k\031\360\000\000k\031o\031\360\000\000o\031E\032\360\000\000E\032L\032\360\000\000L\032Q\032\360\000\000Q\032T\032\360\000\000T\032X\032\360\000\000X\032j\032\360\000\000j\032q\032\360\000\000q\032v\032\360\000\000v\032y\032\360\000\000y\032}\032\360\000\000}\032T\033\360\000\000T\033[\033\360\000\000[\033`\033\360\000\000`\033c\033\360\000\000c\033g\033\360\000\000g\033}\033\360\000\000}\033D\034\360\000\000D\034I""\034\360\000\000I\034L\034\360\000\000L\034P\034\360\000\000P\034a\034\360\000\000a\034h\034\360\000\000h\034i\034\330\004\007\200q\330\010\017\320\017?\270t\3001\300G\310;\320V]\320]^\340\010\017\320\017?\270t\3001\300G\310;\320VW";
static const char __pyx_k_T_D_t_hdRccgg_A_A_P_P_T_T_b_b_f[] = "\200\001\360\010\000\005\016\210T\220\033\230D\240\017\250t\260?\300$\300h\310d\320Rc\320cg\320g|\360\000\000}\001A\002\360\000\000A\002P\002\360\000\000P\002T\002\360\000\000T\002b\002\360\000\000b\002f\002\360\000\000f\002{\002\360\000\000{\002\002\360\000\000\002M\003\360\000\000M\003Q\003\360\000\000Q\003a\003\360\000\000a\003e\003\360\000\000e\003v\003\360\000\000v\003z\003\360\000\000z\003N\004\360\000\000N\004R\004\360\000\000R\004_\004\360\000\000_\004c\004\360\000\000c\004r\004\360\000\000r\004v\004\360\000\000v\004K\005\360\000\000K\005O\005\360\000\000O\005_\005\360\000\000_\005c\005\360\000\000c\005s\005\360\000\000s\005w\005\360\000\000w\005P\006\360\000\000P\006T\006\360\000\000T\006j\006\360\000\000j\006n\006\360\000\000n\006~\006\360\000\000~\006B\007\360\000\000B\007U\007\360\000\000U\007Y\007\360\000\000Y\007q\007\360\000\000q\007u\007\360\000\000u\007B\010\360\000\000B\010F\010\360\000\000F\010T\010\360\000\000T\010X\010\360\000\000X\010f\010\360\000\000f\010j\010\360\000\000j\010{\010\360\000\000{\010\010\360\000\000\010N\t\360\000\000N\tR\t\360\000\000R\tb\t\360\000\000b\tf\t\360\000\000f\tt\t\360\000\000t\tx\t\360\000\000x\tF\n\360\000\000F\nJ\n\360\000\000J\n^\n\360\000\000^\nb\n\360\000\000b\nt\n\360\000\000t\nx\n\360\000\000x\n@\013\360\000\000@\013D\013\360\000\000D\013V\013\360\000\000V\013Z\013\360\000\000Z\013h\013\360\000\000h\013l\013\360\000\000l\013F\014\360\000\000F\014J\014\360\000\000J\014a\014\360\000\000a\014e\014\360\000\000e\014w\014\360\000\000w\014{\014\360\000\000{\014|\014\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220A\330\010\022\220!\330\010\027\220q\340\010\027\220t\320\033+\2507\260%\260s\270$\270m\3107\320RW\320WZ\320Z^\320^r\320ry\320y~\360\000\000\001B\002\360\000\000B\002F\002\360\000\000F\002U\002\360\000\000U\002\\\002\360\000\000\\\002a\002\360\000\000a\002d\002\360\000\000d\002h\002\360\000\000h\002x\002\360\000\000x\002\002\360\000\000\002D\003\360\000\000D\003G\003\360\000\000G\003K""\003\360\000\000K\003^\003\360\000\000^\003e\003\360\000\000e\003j\003\360\000\000j\003m\003\360\000\000m\003q\003\360\000\000q\003\003\360\000\000\003F\004\360\000\000F\004K\004\360\000\000K\004N\004\360\000\000N\004R\004\360\000\000R\004f\004\360\000\000f\004m\004\360\000\000m\004r\004\360\000\000r\004u\004\360\000\000u\004y\004\360\000\000y\004H\005\360\000\000H\005O\005\360\000\000O\005T\005\360\000\000T\005W\005\360\000\000W\005[\005\360\000\000[\005j\005\360\000\000j\005q\005\360\000\000q\005v\005\360\000\000v\005y\005\360\000\000y\005}\005\360\000\000}\005O\006\360\000\000O\006V\006\360\000\000V\006[\006\360\000\000[\006^\006\360\000\000^\006b\006\360\000\000b\006y\006\360\000\000y\006@\007\360\000\000@\007E\007\360\000\000E\007H\007\360\000\000H\007L\007\360\000\000L\007Y\007\360\000\000Y\007`\007\360\000\000`\007e\007\360\000\000e\007h\007\360\000\000h\007l\007\360\000\000l\007|\007\360\000\000|\007C\010\360\000\000C\010H\010\360\000\000H\010K\010\360\000\000K\010O\010\360\000\000O\010]\010\360\000\000]\010d\010\360\000\000d\010i\010\360\000\000i\010l\010\360\000\000l\010p\010\360\000\000p\010\010\360\000\000\010F\t\360\000\000F\tK\t\360\000\000K\tN\t\360\000\000N\tR\t\360\000\000R\t_\t\360\000\000_\tf\t\360\000\000f\tk\t\360\000\000k\tn\t\360\000\000n\tr\t\360\000\000r\t\t\360\000\000\tF\n\360\000\000F\nK\n\360\000\000K\nN\n\360\000\000N\nR\n\360\000\000R\nc\n\360\000\000c\nj\n\360\000\000j\no\n\360\000\000o\nr\n\360\000\000r\nv\n\360\000\000v\nG\013\360\000\000G\013N\013\360\000\000N\013S\013\360\000\000S\013V\013\360\000\000V\013Z\013\360\000\000Z\013g\013\360\000\000g\013n\013\360\000\000n\013s\013\360\000\000s\013v\013\360\000\000v\013z\013\360\000\000z\013S\014\360\000\000S\014Z\014\360\000\000Z\014_\014\360\000\000_\014b\014\360\000\000b\014f\014\360\000\000f\014|\014\360\000\000|\014C\r\360\000\000C\rH\r\360\000\000H\rK\r\360\000\000K\rO\r\360\000\000O\r`\r\360\000\000`\rg\r\360\000\000g\rh\r\330\004\007\200q\330\010\017\320\017(\250\004\250A""\250W\260K\270w\300a\340\010\017\320\017(\250\004\250A\250W\260K\270q";
static const char __pyx_k_WWX_6_q_S_F_L_2Q_IU_1_4_5Qj_6_y[] = "\320\004W\320WX\360\016\000\t\024\2206\230\027\240\001\330\010\014\320\014\037\230q\240\n\250!\340\010\025\220S\230\001\230\021\360\010\000\t\r\320\014\"\240\"\240F\250\"\250L\270\013\3002\300Q\360\016\000\t\r\210I\220U\230!\2301\360\010\000\r\034\2304\320\0375\260Q\260j\300\001\3306?\270y\310\010\320PQ\320QR\330\014\020\320\020#\2401\240I\250U\260!\340\014\017\210q\330\020\027\220u\230A\230Q\340\020\023\2204\320\027,\250A\250V\2601\330\024\030\230\017\240q\330\024\030\320\0300\260\001\260\032\2701\330\024\030\320\030(\250\001\250\021\330\024\030\320\030)\250\021\250*\260A\360\010\000\t\r\320\014\037\230q\240\002\240'\250\021\250!\330!&\240d\320*=\270Y\300a\330\010\n\210.\230\001\230\024\320\0352\260!\2602\260Q\330\010\021\220\024\320\0251\260\021\340\010\017\210q";
static const char __pyx_k_corrections_skipped_Learning_ra[] = " corrections skipped   Learning rate: ";
static const char __pyx_k_corrections_skipped_learning_ra[] = " corrections skipped   learning rate: ";
static const char __pyx_k_nltkor_tag_libs_networkconv_pyx[] = "nltkor/tag/libs/networkconv.pyx";
static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
static const char __pyx_k_tag_sentence_labeled_dependency[] = "_tag_sentence_labeled_dependency";
static const char __pyx_k_tag_sentence_unlabeled_dependen[] = "_tag_sentence_unlabeled_dependency";
static const char __pyx_k_uCq_AV1_Biq_1_AT_q_2T_D_4q_HE_R[] = "\320\000\"\240!\360$\000\005\010\200u\210C\210q\330\010\014\210A\210V\2201\340\010\014\210B\210i\220q\230\003\2301\330\004\014\210A\210T\220\021\220%\220q\330\004\013\2102\210T\220\021\220\"\220D\230\001\230\022\2304\230q\240\002\240\"\240H\250E\260\024\260R\260q";
static const char __pyx_k_A34_d_T1B_SWWX_2T_r_Q_q_D_d_3b_A[] = "\200A\34034\360\020\000\t\027\220d\320\032-\250T\3201B\300'\310\032\320SW\320WX\330\010\021\220\024\220^\2402\240T\250\021\250-\260r\270\024\270Q\330\010\014\320\014\037\230q\330\010\014\320\014\034\230D\240\016\250d\260!\2603\260b\270\004\270A\340\010\013\2104\320\017 \240\007\240q\330\014\025\220T\320\031+\2502\250T\260\021\260$\3206F\300b\310\004\310A\330\014\020\320\020$\240A\330\014\020\320\020!\240\024\320%7\260t\2701\270C\270r\300\024\300Q\360\016\000\t\r\210C\320\017\037\230y\250\001\250\024\250Q\360\006\000\r\033\230$\320\036/\250q\260\003\2602\260T\270\021\360\006\000\r\034\2304\320\0371\260\025\260a\260~\300Q\360\006\000\r\033\230\"\230E\240\021\240-\250q\260\004\260M\300\023\300A\330\014\020\320\020#\240<\250r\260\021\360\010\000\r\020\210z\230\023\230A\330\020\037\230}\250B\250a\340\020\033\2309\240A\240Q\330\020\037\230t\320#6\260a\260~\300Q\340\014\034\230D\320 3\2605\270\001\270\035\300b\310\004\310A\3309<\270E\300\021\330\014\032\230\"\230E\240\021\240-\250q\260\004\3204H\310\006\310a\310t\320SV\320VW\330\014\020\320\020)\250\034\260R\260~\300Q\360\010\000\r\032\230\035\240b\250\001\330\014\034\230D\320 1\260\025\260a\260{\300\"\300D\310\001\3307:\270%\270q\340\014\017\210t\320\023'\240v\250Q\250c\260\023\260D\3208J\310&\320PQ\320QR\330\020\036\230b\240\005\240Q\240m\2601\260D\3208J\310&\320PQ\320QU\320UX\320XY\340\014\020\320\020'\240|\2602\260^\3001\340\010\014\320\014\034\230D\320 1\260\024\260Q\260c\270\022\2704\270q\360\006\000\t\014\2104\210t\220?\240$\240d\250-\260w\270a\330\014\020\320\020 \240\004\320$5\260R\260t\2701";
static const char __pyx_k_A56_1_e1_32Q_q_Rq_N_T_4_S_1_E_aq[] = "\200A\33056\330%&\360\036\000\t\022\220\027\230\n\240!\2401\330\010\016\210e\2201\320\0243\2602\260Q\330\010\027\220q\330\010\030\230\001\330\010\025\220R\220q\330\010\014\210N\230#\230T\240\021\340\010\013\2104\320\017%\240S\250\001\330\014\020\320\020(\250\001\330\014\020\320\020#\2401\340\010\014\210E\220\025\220a\220q\330\014\020\320\020(\250\001\250\021\330\014\020\220\r\230Q\230k\250\021\330\014\020\220\n\230!\360\006\000\r\021\220\t\230\024\230W\240B\240d\250/\270\024\320=N\310b\320PQ\360\006\000\r\020\210t\220:\230R\230q\330\020\037\230t\2401\330\020\024\220E\230\021\330\020\026\220f\230A\230Q\330\021\025\220Q\360\006\000\021\025\320\024%\240Q\340\014\020\320\020'\240r\250\022\2504\250r\260\022\3203J\310#\310Q\330\020\023\2204\220z\240\023\320$7\260q\330\020\024\220D\230\n\240\"\240N\260$\260d\270'\300\022\3001\340\020\024\320\024(\250\001\250\022\2502\250Q\340\020\023\2204\220z\240\023\320$7\260q\330\030\034\230D\240\007\240r\250\033\260D\270\004\270J\300b\310\001\330\024\025\340\014\034\230D\240\001\330\014\031\230\024\230Q\340\010\014\210N\230!";
static const char __pyx_k_A56_7q_S_N_T_Zwa_1_e1_32Q_q_Rq_4[] = "\200A\33056\330%7\260q\360\024\000\t\r\320\014\035\230S\240\001\240\021\330\010\014\210N\230#\230T\240\021\330\010\014\320\014\035\230Z\240w\250a\340\010\021\220\027\230\n\240!\2401\330\010\016\210e\2201\320\0243\2602\260Q\330\010\030\230\001\330\010\027\220q\330\010\025\220R\220q\340\010\013\2104\320\017%\240S\250\001\330\014\020\320\020$\240A\240[\260\014\270F\300!\340\010\014\210E\220\026\220q\230\001\330\014\020\320\020(\250\001\250\021\330\014\020\220\r\230Q\230k\250\034\260V\2701\330\014\020\220\n\230!\360\006\000\r\020\210t\220:\230R\230q\330\020\037\230t\2401\330\020\024\220E\230\021\330\020\026\220f\230A\230Q\330\021\025\220Q\360\006\000\021\025\320\024%\240Q\340\014\020\320\020'\240r\250\022\2504\250r\260\022\3203J\310#\310Q\330\020\023\2204\220z\240\023\320$7\260q\330\020\024\220D\230\n\240\"\240N\260$\260d\270'\300\022\3001\340\020\024\320\024(\250\001\250\022\2502\250Q\340\020\023\2204\220z\240\023\320$7\260q\330\030\034\230D\240\n\250\"\250N\270$\270d\300'\310\022\3101\360\006\000\025\026\340\014\034\230D\240\001\330\014\031\230\024\230Q\340\010\014\320\014\035\230Q\330\010\014\210N\230!\330\010\014\320\014\034\230A";
static const char __pyx_k_AIJ_O3a_Cz_AQ_RvRt_Q_1_6_4_T_r_r[] = "\200A\340IJ\330'(\360(\000\t\r\210O\2303\230a\230}\320,<\270C\270z\310\023\310A\310Q\360\006\000\t\r\320\014\035\230R\230v\240R\240t\250>\270\024\270Q\340\010\013\2101\340\014\020\320\020!\240\022\2406\250\022\2504\250~\270T\300\021\330\014\020\220\017\230r\240\026\240r\250\024\250^\2704\270\310a\360\010\000\t\035\230B\230g\240Q\240c\250\021\250+\260R\260q\330\010\033\2304\320\0377\260u\270A\320=O\310r\320QU\320UV\330=@\300\005\300Q\340\010%\320%6\260b\270\004\270A\340\010\014\210J\220e\2301\230D\240\001\360\020\000\r\020\320\017\037\230s\240!\330\020&\240b\250\007\250q\260\003\2601\260K\270r\300\021\340\020\033\230?\250!\2501\340\020&\240d\320*=\270Q\270b\300\007\300q\310\003\3101\310L\320XY\340\014!\240\024\320%?\270u\300A\320EY\320Y[\320[_\320_`\330EH\310\005\310Q\340\014!\320!4\260B\260a\360\006\000\r\020\210q\330\020\024\220L\240\001\240\032\320+=\270W\300A\300Q\330\014\020\220\016\230a\230z\320);\2704\270q\300\001\360\006\000\t\r\320\014\036\230d\240!\340\010\013\2104\320\017 \240\007\240q\330\014\020\320\020\"\240$\240n\260D\270\001\270\024\320=M\310T\320QS\320SW\320WX\340\014\017\210q\330\020\024\320\0241\260\024\260_\300E\310\021\340\014\024\220A\220T\320\0312\260!\360\006\000\r\020\210q\330\020\024\320\0240\260\004\260N\300%\300q\340\014\020\320\020\"\240$\240a\330\014\024\220A\220T\320\0311\260\021\340\010\021\220\024\220_\240D\250\001\250\024\250_\270D\300\002\300$\300a\340\010\017\210q";
static const char __pyx_k_ANO_4_Cq_q_q_q_Rt1Bd_2T_1_c_7_Ry[] = "\200A\330NO\360\014\000\t\014\2104\210}\230C\230q\330\014\032\230&\240\007\240q\250\001\340\014\017\210q\330\020\027\220q\360\006\000\r\026\220R\220t\2301\230B\230d\240!\2402\240T\250\021\250)\2601\330\014\030\230\006\230c\240\022\2407\250!\330\014\025\220R\220y\240\001\240\021\340\014\022\220&\230\004\230C\230s\240!\340\020\"\240&\250\007\250q\360\006\000\021\030\220r\230\026\230q\240\014\250C\320/?\270q\300\001\360\006\000\021%\240H\250A\250V\2601\360\006\000\021$\2404\240q\320(9\270\027\300\001\360\006\000\021\036\230T\240\021\240%\240s\250!\330\020\026\220a\220|\320#7\260q\360\006\000\021\037\230f\240G\2501\250A\330\020\031\230\022\2309\240A\240Q\340\014\023\2201\340\010\026\220b\230\013\2401\240A\330\010\031\230\022\230;\240a\240x\250q\360\014\000\t\024\2201\220E\230\026\230q\240\003\2402\240T\250\034\260R\260q\340\010\014\210C\210y\230\t\240\021\240&\250\001\250\025\250a\360\006\000\r%\240K\250q\260\002\260\"\260C\260r\270\024\270\\\310\023\310B\310c\320QR\360\006\000\r\033\230!\2305\320 4\260G\2701\270A\330\014\027\220q\230\005\320\0351\260\021\260.\300\001\300\021\33024\260G\2701\270D\300\017\310r\320QW\320WX\320XY\360\006\000\t\022\220\022\2206\230\021\230#\230Q\230i\240v\250Q\340\010\016\210b\220\005\220[\240\002\240\"\240G\2501\330\010\014\320\014\034\230K\240r\250\022\2501\250F\260\"\260A\330\010\027\220~\240R\240r\250\021\250&\260\002\260!\340\010\014\210E\220\025\220a\220s\230!\2308\2402\240S\250\004\250A\330\014\022\220!\2205\230\001\330\014\033\230>\250\021\250\"\250A\250Q\340\010\016\210a\210u\220A\330\010\017\210q";
static const char __pyx_k_A_34_F_Cq_4q_A_q_DPQ_b_b_V1D_A_4[] = "\200A\360\006\00034\360\026\000\t\033\230\"\230F\240\"\240C\240q\250\013\2604\260q\330\010 \240\002\240&\250\002\250$\320.A\300\026\300q\310\004\310D\320PQ\330\010\036\230b\240\006\240b\250\004\320,=\270V\3001\300D\310\004\310A\360\006\000\t\034\2304\320\0371\260\022\2604\260q\330\0108\270\002\270'\300\021\300$\300a\340\010\014\210J\220e\2301\230D\240\001\360\010\000\r\037\230d\240,\250a\250q\340\014\017\210t\2204\220q\330\020\037\320\037/\250r\260\021\340\020\033\2309\240A\240Q\330\020\037\230t\320#6\260a\3207H\310\001\340\014\033\2302\230U\240!\240=\260\002\260$\3206K\3101\330#'\320':\270&\300\001\300\023\300B\300a\330\014\031\320\031)\250\022\2501\330\014\031\230\022\2305\240\001\240\033\250B\250d\3202E\300Q\330!%\320%6\260f\270A\270S\300\002\300!\340\014\030\320\030(\250\001\250\021\360\010\000\r\034\2301\320\034-\250R\250w\260a\260t\320;M\310Q\360\006\000\r\"\240\021\240.\260\002\260'\270\021\270$\320>P\320PQ\330\014\037\230q\240\014\250B\250g\260Q\260d\320:L\310A\340\010\014\320\014\034\230O\2504\250q\260\004\260A\330\010\014\320\014\"\320\"7\260t\2701\270D\320@T\320TU\330\010\014\320\014 \320 3\2604\260q\270\004\320<N\310a";
static const char __pyx_k_A_7_q_6_Qa_IU_3aq_5_1AV1_T_q_q_9[] = "\200A\330;<\360\016\000\t\024\2207\230'\240\021\330\010\014\320\014\037\230q\240\n\250!\340\010\021\220\022\2206\230\021\230#\230Q\230a\360\010\000\t\r\210I\220U\230!\2303\230a\230q\330\014\023\2205\230\001\230\021\360\010\000\r\024\2201\220A\220V\2301\360\010\000\r\026\220T\320\031/\250q\260\n\270'\300\026\300q\330\014\022\220!\2209\230F\240'\250\021\340\014\017\210q\330\020\030\230\006\230a\230q\330\020\023\2204\320\0275\260Q\260a\260x\270q\330\024\030\230\017\240q\330\024\030\320\0300\260\001\260\032\2707\300!\330\024\030\320\030(\250\001\250\027\260\001\330\024\030\320\030)\250\021\250*\260A\360\006\000\t\020\210q";
static const char __pyx_k_A_7b_AQ_D_Qk_1_D_aq_Ja_6_A_1_N_T[] = "\200A\360&\000\t7\260b\270\004\270A\270Q\330\010\022\220\"\220D\230\001\230\021\330\010\014\320\014\035\230Q\230k\250\022\2501\330\010\020\220\002\220\"\220D\230\016\240a\240q\330\010\014\210J\220a\360\006\000\t\014\2106\220\023\220A\330\014\020\220\n\230!\330\014\023\2201\360\006\000\t\r\210N\230!\230>\250\021\360\010\000\t\026\220T\230\036\240v\250Q\250d\260!\330\010\014\320\014\035\230T\240\036\250x\260q\270\001\340\010\017\210q";
static const char __pyx_k_A_A_4q_Q_T_4q_A_T_T_4q_a_D_Q_T_D[] = "\200A\360\n\000\t\021\220\001\220\037\240\004\240A\330\021#\2404\240q\330\021!\240\024\240Q\330\021%\240T\250\021\330\021#\2404\240q\330\021 \240\004\240A\330\021\035\230T\240\021\330\021\035\230T\240\036\250|\2704\270q\330\021\"\240$\240a\330\021\034\230D\240\r\250\\\270\024\270Q\330\021\035\230T\240\036\250}\270D\300\001\330\021!\240\024\320%7\260}\300D\310\001\330\021\036\230d\240/\260\036\270t\3001\330\021 \240\004\240A\330\010\017\210q";
static const char __pyx_k_A_A_q_4_WA_T_a_F_m3at104A04A_t_D[] = "\200A\360\014\000\t\025\220A\330\010\017\210q\340\010\013\2104\320\017%\240W\250A\330\014\025\220T\230\021\230$\230a\340\014\030\230\001\340\010\014\210F\220,\230m\2503\250a\250t\2601\33004\260A\33004\260A\330\014\017\210t\320\023)\250\027\260\001\330\020\034\230D\240\001\240\021\360\006\000\r\026\220T\230\036\240q\250\006\250l\270&\300\001\330\014\020\320\020\"\320\"4\260C\260q\270\010\300\001\330\020\024\220I\230\\\250\023\250A\320-?\270q\330\024\027\220x\230s\240!\330\030 \240\001\340\020\035\230S\240\001\240\021\340\010\014\210L\230\005\230Q\230f\240B\240a\340\010\014\210J\220a";
static const char __pyx_k_A_C1_Qb_q_1Kt_q_4_S_A_q_Q_e6_Q_A[] = "\200A\330)C\3001\330\032\033\360\016\000\t\026\220Q\220b\230\007\230q\240\003\2401\240K\250t\260<\270q\360\014\000\t\014\2104\320\017%\240S\250\001\330\014\020\320\020$\240A\240[\260\007\260q\340\010\r\210Q\320\016.\250e\2606\270\021\270+\300Q\330:A\300\021\330:;\330:;\330:;";
static const char __pyx_k_A_F_3b_NbPQ_FVV_b_a_D_aq_E_at1_B[] = "\200A\360\020\000\t\031\230\004\320\034,\250F\260!\2603\260b\270\004\320<N\310b\320PQ\330\010\014\320\014 \240\002\240&\250\002\250!\330*.\320.@\300\002\300$\320FV\320V\\\320\\]\320]^\330\010\014\320\014 \240\016\250b\260\001\330\010\026\220a\330\010\024\220D\320\030(\250\006\250a\250q\330\010\014\210E\220\025\220a\220t\2301\340\014\024\220B\220b\230\004\230A\360\006\000\r\024\2202\220W\230A\230W\240N\260\"\260G\2702\270T\300\021\330\014\023\2202\220U\230!\2306\240\023\240D\320(8\270\006\270a\270s\300\"\300A\330\014\020\320\020!\240\023\240N\260-\270t\320CS\320ST\320TU\340\014\032\230!\330\014\031\230\024\320\035-\250V\2601\260A\340\010\014\320\014'\240t\320+<\270D\300\001\300\024\300Q";
static const char __pyx_k_A_N_D_Q_T_t1A_4q_A_4_4Ba_b_AT_V4[] = "\200A\360(\000\t\031\230\004\230N\250\"\250D\260\001\260\024\260Q\360\n\000\t\036\230T\240\036\250t\2601\260A\360\010\000\t\022\220\024\220^\2404\240q\250\004\250A\360\020\000\t\022\220\031\230!\2304\320\0374\260B\260a\360\020\000\t\031\230\006\230b\240\004\240A\240T\250\021\360\010\000\t\036\230V\2404\240q\250\001\360\n\000\t\033\230&\240\004\240A\240T\250\021\360\n\000\t\r\320\014\037\230~\250R\250t\2601\330\010\014\320\014\034\320\034/\250r\260\024\260Q\330\010\014\320\014\037\230~\250R\250t\2601\330\010\014\320\014\034\320\034/\250r\260\024\260Q\360\026\000\t\030\320\027'\240r\250\024\250Q\340\010\032\230\"\230L\250\002\250$\250a\330*+\330*.\250a\360\016\000\t\r\210C\210|\2309\240A\240Q\360\006\000\r\025\220A\330\014\020\220\014\230O\2501\250B\250a\250q\260\004\260A\340\020\024\220C\220y\240\t\250\021\250$\250a\330\024\032\230&\240\002\240%\240v\250Q\250a\330\024\031\230\021\230(\240!\2407\250(\260!\2606\270\021\330\024\034\230A\360\006\000\t\014\2104\210}\230G\2401\330\014\020\320\020 \240\004\320$5\260R\260t\2701";
static const char __pyx_k_A_Q_1_4q_1_4_1_b_Bd_2_a_E_at1_9I[] = "\200A\360\010\000\t\026\220Q\330\010\033\2301\330\010\031\230\021\360\010\000\t\024\2204\220q\330\010\023\2201\330\010\013\2104\320\017!\240\022\2401\330\014\036\230b\240\014\250B\250d\260!\330./\330.2\260!\340\014\036\230a\340\010\014\210E\220\025\220a\220t\2301\340\014\020\220\003\2209\230I\240Q\240d\250!\360\006\000\021 \230t\240=\260\004\260K\270{\310\"\310E\320QW\320WX\320XY\330\020\036\230e\2406\250\021\250!\340\020\024\220G\230:\240S\250\001\250\037\270\001\270\025\270a\330\024\031\230\021\230%\230q\240\007\240q\340\014\032\230$\320\0361\260\024\3205H\320HY\320Y[\320[_\320_q\320qw\320wx\320xy\330\014\031\230\033\240E\250\021\250\"\250G\2601\260K\270r\300\024\300Q\300a\330\014\031\230\033\240E\250\021\250\"\250G\2601\260A\260Z\270t\3002\300T\310\021\310!\330\014\020\320\020\"\240!\2403\240i\250{\270!\270;\300a\300q\330\014\020\320\020\"\240!\2406\250\021\330\014\020\320\020\"\240\"\240F\250!\330\014 \240\004\320$6\260f\270A\270Q\340\014\032\230$\320\036/\250t\3203D\300O\320SU\320UY\320Yi\320io\320op\320pq\330\014\031\230\033\240E\250\021\250\"\250G\2601\260K\270r\300\024\300Q\300a\330\014\031\230\033\240E\250\021\250\"\250G\2601\260A\260Z\270t\3002\300T\310\021\310!\330\014\020\320\020 \240\001\240\023\240I\250[\270\001\270\033\300A\300Q\330\014\020\320\020 \240\001\240\026\240q\330\014\020\320\020 \240\002\240&\250\001\340\014\030\230\001\330\014\030\230\001\330\014\036\230d\320\"2\260&\270\001\270\021\340\010\014\320\014\"\240!\330\010\014\320\014 \240\001";
static const char __pyx_k_A_Q_4q_E_s_4s_fCq_E_Zt_q_RS_AQ_q[] = "\200A\360 \000\t\036\230Q\330\010\023\2204\220q\330\010\014\210E\220\036\230s\240!\2404\240s\250$\250f\260C\260q\340\014\024\220E\230\024\230]\250#\250Z\260t\270<\300q\310\n\320RS\360\010\000\r#\240&\250\002\250*\260A\260Q\330\014\027\220q\360\006\000\t\021\220\004\320\024%\240Q\240a\360\014\000\t\021\220\002\220$\220a\220r\230\024\230Q\230b\240\004\240A\240U\250\"\250F\260\"\260A\360\006\000\t\r\210J\220a\360\020\000\t\014\2106\220\023\220A\330\014\020\220\n\230!\330\014\023\2201\360\010\000\t\r\320\014\035\230R\230v\240R\240s\250!\2507\260$\260a\360\006\000\t\r\320\014\037\230r\240\033\250A\250T\260\036\270r\300\021\360\030\000\t\025\220I\230Q\230e\2402\240Q\340\010\014\210N\230\"\230E\240\021\240\"\240D\250\001\250\025\250b\260\003\2602\260Q\340\010\030\230\005\230T\240\035\250c\260\032\2704\270|\3103\310b\320PQ\360\n\000\t\r\210E\220\025\220a\220s\230!\2308\2402\240T\250\024\250Q\360\014\000\r\034\2305\240\001\240\023\240B\240n\260A\360\n\000\r\036\230Y\240a\240}\260A\360\n\000\r\035\230B\230d\240!\240<\250r\260\021\360\n\000\r\"\240\024\240^\2601\260B\260b\270\003\2702\270Q\340\014\020\320\020 \240\003\2409\250A\360\n\000\r\021\220\016\230a\230u\240B\240d\250!\320+?\270q\360\010\000\t\r\320\014\034\230B\230e\2404\240~\260Q\260a\360\006\000\t\024\2204\220q\330\010\014\210G\2207\230)\2401\240A\330\014\020\220\016\230a\230v\240Q\240h\250a\330\014\017\210t\220=\240\007\240q\330\020\024\320\024$\240A\240Y\250a\250x\260q\330\014\027\220q\340\010\017\210q";
static const char __pyx_k_A_Q_E_3A_3DA3C1_O_r_l_A_O1_1_A_q[] = "\200A\360\010\000\t\016\210Q\320\016$\240E\250\031\260!\260=\300\001\3303A\300\021\3303D\300A\3303C\3001\330\010\014\210O\230<\240r\250\021\330\010\014\320\014\"\240$\240l\260\"\260A\340\010\014\210O\2301\330\010\014\320\014\"\240!\330\010\014\320\014 \240\001\330\010\014\320\014#\2401\330\010\014\320\014!\240\021\340\010\014\320\014\034\230A\330\010\014\320\014\037\230q\330\010\014\320\014\034\230A\340\010\014\320\014%\240Q\330\010\014\320\014$\240A\340\010\014\320\014'\240q";
static const char __pyx_k_A_Q_Je1Cq_wc_Cwc_D_awha_C1_vWA_g[] = "\200A\360\022\000\t!\240\001\360\006\000\t!\240\001\360\006\000\t\026\220Q\340\010\021\220\021\360\006\000\t\r\210J\220e\2301\230C\230q\240\001\330\014\017\210w\220c\320\031,\250C\250w\260c\270\021\330\020\021\340\014\024\220D\320\030.\250a\250w\260h\270a\330/C\3001\330\014\017\210v\220W\230A\330\020\026\220g\230Q\230a\340\010\017\210q";
static const char __pyx_k_A_QfD_Ba_d_c_1_IV1Cs_1_YauAV2S_q[] = "\200A\360\026\000\t\021\220\001\360\010\000\t\016\210Q\210f\220D\230\014\240B\240a\360\n\000\t\027\220d\230,\240c\250\022\2501\340\010\014\210I\220V\2301\230C\230s\240!\2401\340\014\025\220Y\230a\230u\240A\240V\2502\250S\260\002\260-\270q\330\014\021\220\021\220*\230A\340\010\017\210q";
static const char __pyx_k_A_R_81_Q_C_Yaq_aq_2T_b_AQ_Rt1A_G[] = "\200A\360\022\000\t\r\320\014\035\230R\230{\250!\2508\2601\340\010\025\220Q\340\010\014\210C\210~\230Y\240a\240q\330\014\022\220$\220a\220q\340\014\033\2302\230T\240\021\240!\330\014\026\220b\230\004\230A\230Q\330\014\025\220R\220t\2301\230A\360\006\000\r\025\220G\2302\230Z\240q\250\001\330\014\020\220\n\230!\360\n\000\r\020\210v\220S\230\001\330\020\024\220J\230a\330\020\021\340\014\031\230\021\330\014\020\220\016\230a\230u\240B\240m\2602\260Q\330\014\020\220\016\230a\230s\240(\250!\340\010\017\210q";
static const char __pyx_k_A_c_Q_a_36_R_fTUUV_c_Rq_uBb_Qa_7[] = "\200A\360\n\000\t\037\230c\240\034\250Q\330\010\026\220a\340\010\"\320\"3\2606\270\021\270#\270R\270\310f\320TU\320UV\330\010#\240;\250c\260\034\270R\270q\360\006\000\t\020\210u\220B\220b\230\005\230Q\230a\330\010\031\230\022\2307\240(\250!\2501\250F\260'\270\036\300q\340\010\034\230L\250\002\320*;\2706\300\021\300!\330\010\036\230b\240\007\240x\250q\260\001\260\026\260w\320>Q\320QR\330\010\034\230L\250\002\250/\270\026\270q\300\001\330\010\034\230B\230g\240X\250Q\250a\250v\260W\320<O\310q\340\010\017\210u\220B\220b\230\005\230Q\230a\330\010\026\220b\230\007\230x\240q\250\001\250\026\250v\260Q\340\010\013\210=\230\002\230!\330\014\036\230b\240\007\240x\250q\260\001\260\026\260w\270n\310A\330\014\023\2205\230\002\230\"\230E\240\021\240!\330\014\033\2302\230W\240H\250A\250Q\250f\260F\270!\330\014\032\230-\240q\340\014\036\230a\330\014\033\2301\330\014\032\230-\240q\340\010\017\210u\220B\220b\230\005\230Q\230j\250\001\250\021\330\010\031\230\022\2307\240(\250!\2501\250F\260&\270\001\330\010\017\210u\220B\220b\230\005\230Q\230a\330\010\026\220b\230\007\230x\240q\250\001\250\026\250v\260Q\340\010\016\210c\220\021\220-\230|\250>\270\021\330\022\037\320\037/\250q\330\022'\240q\330\022#\2401\330\022\"\240!\330\010\013\320\013\035\230Q\330\010\013\320\013 \240\001\330\010\013\320\013\036\230a\340\010\017\210q";
static const char __pyx_k_A_c_Q_a_uBb_Qa_7_1F_a_b_xq_wa_uB[] = "\200A\360\016\000\t\037\230c\240\034\250Q\330\010\026\220a\360\026\000\t\020\210u\220B\220b\230\005\230Q\230a\340\010\031\230\022\2307\240(\250!\2501\250F\260'\270\035\300a\330\010\026\220b\230\007\230x\240q\250\001\250\026\250w\260a\340\010\017\210u\220B\220b\230\005\230Q\230a\340\010\031\230\022\2307\240(\250!\2501\250F\260'\270\035\300a\330\010\026\220b\230\007\230x\240q\250\001\250\026\250w\260a\340\010\017\210q\340\010\026\220b\230\007\230x\240q\250\001\250\026\250w\260l\300\"\300C\300q\340\010\016\210g\220Q\220m\240<\250}\270A\330\026&\240m\3203C\3001\330\026\027\330\010\013\320\013\035\230Q\340\010\017\210q";
static const char __pyx_k_A_fAS_PPRRS_F_A_00B_DHZZ_aab_a_D[] = "\200A\360\020\000\t\031\230\004\320\034.\250f\260A\260S\270\002\270$\320>P\320PR\320RS\330\010\014\320\014\"\240\"\240F\250\"\250A\330,0\3200B\300\"\300D\320HZ\320Z`\320`a\320ab\330\010\014\320\014\"\240.\260\002\260!\330\010\026\220a\330\010\024\220D\320\030*\250&\260\001\260\021\330\010\014\210E\220\025\220a\220t\2301\340\014\024\220B\220b\230\004\230A\360\006\000\r\024\2202\220W\230A\230W\240N\260\"\260G\2702\270T\300\021\330\014\023\2202\220U\230!\2306\240\023\240D\320(:\270&\300\001\300\023\300B\300a\330\014\020\320\020#\2403\240n\260M\300\024\320EW\320WX\320XY\340\014\032\230!\330\014\031\230\024\320\035/\250v\260Q\260a\340\010\014\320\014)\250\024\320-@\300\004\300A\300T\310\021";
static const char __pyx_k_A_q_F_s_4_d_T_aq_BnAWCq_S_A_L_Qf[] = "\200A\340\010\017\210q\340\010\014\210F\220-\230s\240!\2404\320'>\270d\300!\330\014\025\220T\230\035\240a\240q\330\014\024\220B\220n\240A\240W\250C\250q\360\006\000\t\026\220S\230\004\230A\330\010\014\210L\230\005\230Q\230f\240B\240a";
static const char __pyx_k_A_t_fAQ_F_1Bd_uA_3b_q_Qa_3ay_2V1[] = "\200A\360\026\000\t\030\220t\320\033.\250f\260A\260Q\330\010\022\220\"\220F\230!\2301\230B\230d\240%\240u\250A\250^\2703\270b\300\007\300q\330\010\020\220\002\220&\230\001\230\024\230Q\230a\360\020\000\t\014\2103\210a\210y\230\002\230!\360\006\000\r\034\2302\230V\2401\240A\240Q\240c\250\024\250U\260'\270\023\270A\330\014\037\230t\320#6\260a\260~\300Q\360\010\000\r!\320 0\260\007\260q\270\001\330\014#\320#3\2604\260q\270\001\360\006\000\r\035\230F\240!\2402\240Q\330\014\034\230A\230R\230w\240a\240s\250!\2501\330\0352\260!\330\014\020\320\020#\2401\240N\260)\2701\360\016\000\t\026\220R\220v\230Q\230a\230q\240\003\2404\240u\250A\340\010\033\2304\320\0372\260!\260<\270q\340\010\026\220a\330\010\014\210C\210z\230\031\240!\2401\330\014\030\230\004\320\034/\250q\260\010\270\005\270Q\270a\330\014\033\2301\330\014\034\230A\230V\2401\340\010\034\320\034,\250G\2601\260A\330\010\037\320\037/\250t\2601\260A\340\010 \240\001\360\010\000\t\030\320\027+\2507\260!\330\010#\320#4\260A\260Q\340\010\023\2207\230!\2301\330\010\037\230u\240A\240Q\330\010\023\2205\230\001\230\021\330\010\r\210Q\320\016&\240a\330\010\014\320\014\037\230q\320 6\260l\300!\3002\300Q\360\006\000\t\031\230\006\230a\230r\240\021\330\010\030\230\001\230\021\330\031\033\2307\240!\2403\240a\240}\260A\330\010\014\320\014\037\230q\240\014\250K\260q";
static const char __pyx_k_A_uD_1_Jd_Qc_6_d_t1_d_q_3d_F_4tK[] = "\200A\340\010\027\220u\230D\320 1\260\023\260J\270d\300!\330\010\025\220Q\220c\230\021\230!\2306\240\021\240$\240d\250%\250t\2601\330\010\026\220d\230%\230q\240\001\340\010\032\230)\2403\240d\320*<\270F\300!\3004\300t\320K[\320[a\320ab\320bc\340\010\017\210q\360\020\000\005\010\200t\320\013\036\230l\320*;\2704\270}\310D\320PQ\330\007\025\220T\230\021\340\010\017\210q";
static const char __pyx_k_Confidence_measure_not_implement[] = "Confidence measure not implemented for argument classifying";
static const char __pyx_k_ConvolutionalDependencyNetwork_2[] = "ConvolutionalDependencyNetwork._tag_sentence";
static const char __pyx_k_ConvolutionalDependencyNetwork_3[] = "ConvolutionalDependencyNetwork._tag_sentence_unlabeled_dependency";
static const char __pyx_k_ConvolutionalDependencyNetwork_4[] = "ConvolutionalDependencyNetwork._tag_sentence_labeled_dependency";
static const char __pyx_k_ConvolutionalDependencyNetwork_5[] = "ConvolutionalDependencyNetwork._calculate_gradients";
static const char __pyx_k_ConvolutionalDependencyNetwork_6[] = "ConvolutionalDependencyNetwork._validate";
static const char __pyx_k_ConvolutionalDependencyNetwork_7[] = "ConvolutionalDependencyNetwork._average_error";
static const char __pyx_k_ConvolutionalDependencyNetwork_8[] = "ConvolutionalDependencyNetwork._print_epoch_report";
static const char __pyx_k_ConvolutionalDependencyNetwork_9[] = "ConvolutionalDependencyNetwork._find_cycles";
static const char __pyx_k_ConvolutionalDependencyNetwork_l[] = "ConvolutionalDependencyNetwork.load_from_file";
static const char __pyx_k_ConvolutionalDependencyNetwork_s[] = "ConvolutionalDependencyNetwork.save";
static const char __pyx_k_ConvolutionalDependencyNetwork_t[] = "ConvolutionalDependencyNetwork.train";
static const char __pyx_k_ConvolutionalNetwork___reduce_cy[] = "ConvolutionalNetwork.__reduce_cython__";
static const char __pyx_k_ConvolutionalNetwork__adjust_fea[] = "ConvolutionalNetwork._adjust_features";
static const char __pyx_k_ConvolutionalNetwork__adjust_wei[] = "ConvolutionalNetwork._adjust_weights";
static const char __pyx_k_ConvolutionalNetwork__backpropag[] = "ConvolutionalNetwork._backpropagate";
static const char __pyx_k_ConvolutionalNetwork__create_con[] = "ConvolutionalNetwork._create_convolution_lookup";
static const char __pyx_k_ConvolutionalNetwork__create_pre[] = "ConvolutionalNetwork._create_pred_lookup";
static const char __pyx_k_ConvolutionalNetwork__create_tar[] = "ConvolutionalNetwork._create_target_lookup";
static const char __pyx_k_ConvolutionalNetwork__generate_s[] = "ConvolutionalNetwork._generate_save_dict";
static const char __pyx_k_ConvolutionalNetwork__load_param[] = "ConvolutionalNetwork._load_parameters";
static const char __pyx_k_ConvolutionalNetwork__pre_taggin[] = "ConvolutionalNetwork._pre_tagging_setup";
static const char __pyx_k_ConvolutionalNetwork__reset_coun[] = "ConvolutionalNetwork._reset_counters";
static const char __pyx_k_ConvolutionalNetwork__sentence_c[] = "ConvolutionalNetwork._sentence_convolution";
static const char __pyx_k_ConvolutionalNetwork__shuffle_da[] = "ConvolutionalNetwork._shuffle_data";
static const char __pyx_k_ConvolutionalNetwork__tag_senten[] = "ConvolutionalNetwork._tag_sentence";
static const char __pyx_k_ConvolutionalNetwork__train_epoc[] = "ConvolutionalNetwork._train_epoch";
static const char __pyx_k_ConvolutionalNetwork_description[] = "ConvolutionalNetwork.description";
static const char __pyx_k_ConvolutionalNetwork_load_from_f[] = "ConvolutionalNetwork.load_from_file";
static const char __pyx_k_ConvolutionalNetwork_set_validat[] = "ConvolutionalNetwork.set_validation_data";
static const char __pyx_k_ConvolutionalNetwork_tag_sentenc[] = "ConvolutionalNetwork.tag_sentence";
static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0x72479d4, 0xd248f0d, 0xc0e08fa) = (accuracy, answer_score, decay_factor, error, feature_tables, features_per_token, float_errors, hidden_bias, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, net_gradients, network_filename, network_text_filename, num_tokens, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, sentence_accuracy, sentence_lookup, skips, trans_gradients, transitions, use_learning_rate_decay, validation_sentences, validation_tags, word_window_size))";
static const char __pyx_k_Network__calculate_gradients_sll[] = "Network._calculate_gradients_sll";
static const char __pyx_k_Network__calculate_gradients_wll[] = "Network._calculate_gradients_wll";
static const char __pyx_k_Note_that_Cython_is_deliberately[] = "Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False.";
static const char __pyx_k_nltkor_tag_libs_networkdependenc[] = "nltkor/tag/libs/networkdependencyconv.pyx";
static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
static const char __pyx_k_pyx_unpickle_ConvolutionalDepe_2[] = "__pyx_unpickle_ConvolutionalDependencyNetwork__set_state";
static const char __pyx_k_pyx_unpickle_ConvolutionalNetw_2[] = "__pyx_unpickle_ConvolutionalNetwork__set_state";
static const char __pyx_k_ConvolutionalDependencyNetwork_10[] = "ConvolutionalDependencyNetwork._find_cycle_recursive";
static const char __pyx_k_ConvolutionalDependencyNetwork_11[] = "ConvolutionalDependencyNetwork._contract_cycle";
static const char __pyx_k_ConvolutionalDependencyNetwork_12[] = "ConvolutionalDependencyNetwork._find_maximum_spanning_tree";
static const char __pyx_k_ConvolutionalDependencyNetwork_13[] = "ConvolutionalDependencyNetwork.__reduce_cython__";
static const char __pyx_k_ConvolutionalDependencyNetwork_14[] = "ConvolutionalDependencyNetwork.__setstate_cython__";
static const char __pyx_k_ConvolutionalNetwork__calculate_2[] = "ConvolutionalNetwork._calculate_gradients_classify";
static const char __pyx_k_ConvolutionalNetwork__calculate_3[] = "ConvolutionalNetwork._calculate_input_deltas";
static const char __pyx_k_Kq_L8H_STTXXddz_F_F_G_G_K_K_W_W_2[] = "\200\001\330\004\020\220\014\230K\240q\250\004\250L\3208H\310\013\320ST\320TX\320Xd\320dz\360\000\000{\001F\002\360\000\000F\002G\002\360\000\000G\002K\002\360\000\000K\002W\002\360\000\000W\002g\002\360\000\000g\002r\002\360\000\000r\002s\002\360\000\000s\002w\002\360\000\000w\002C\003\360\000\000C\003Y\003\360\000\000Y\003d\003\360\000\000d\003e\003\360\000\000e\003i\003\360\000\000i\003u\003\360\000\000u\003~\003\360\000\000~\003I\004\360\000\000I\004J\004\360\000\000J\004N\004\360\000\000N\004Z\004\360\000\000Z\004l\004\360\000\000l\004w\004\360\000\000w\004x\004\360\000\000x\004|\004\360\000\000|\004H\005\360\000\000H\005^\005\360\000\000^\005i\005\360\000\000i\005j\005\360\000\000j\005n\005\360\000\000n\005z\005\360\000\000z\005J\006\360\000\000J\006U\006\360\000\000U\006V\006\360\000\000V\006Z\006\360\000\000Z\006f\006\360\000\000f\006u\006\360\000\000u\006@\007\360\000\000@\007A\007\360\000\000A\007E\007\360\000\000E\007Q\007\360\000\000Q\007n\007\360\000\000n\007y\007\360\000\000y\007z\007\360\000\000z\007\007\360\000\000\007K\010\360\000\000K\010[\010\360\000\000[\010f\010\360\000\000f\010g\010\360\000\000g\010l\010\360\000\000l\010x\010\360\000\000x\010M\t\360\000\000M\tX\t\360\000\000X\tY\t\360\000\000Y\t^\t\360\000\000^\tj\t\360\000\000j\tz\t\360\000\000z\tE\n\360\000\000E\nF\n\360\000\000F\nK\n\360\000\000K\nW\n\360\000\000W\ni\n\360\000\000i\nt\n\360\000\000t\nu\n\360\000\000u\nz\n\360\000\000z\nF\013\360\000\000F\013Y\013\360\000\000Y\013d\013\360\000\000d\013e\013\360\000\000e\013j\013\360\000\000j\013v\013\360\000\000v\013R\014\360\000\000R\014]\014\360\000\000]\014^\014\360\000\000^\014c\014\360\000\000c\014o\014\360\000\000o\014~\014\360\000\000~\014I\r\360\000\000I\rJ\r\360\000\000J\rO\r\360\000\000O\r[\r\360\000\000[\ro\r\360\000\000o\rz\r\360\000\000z\r{\r\360\000\000{\r@\016\360\000\000@\016L\016\360\000\000L\016b\016\360\000\000b\016m\016\360\000\000m\016n\016\360\000\000n\016s\016\360\000\000s\016\016\360\000\000\016N\017\360\000\000N""\017Y\017\360\000\000Y\017Z\017\360\000\000Z\017_\017\360\000\000_\017k\017\360\000\000k\017|\017\360\000\000|\017G\020\360\000\000G\020H\020\360\000\000H\020M\020\360\000\000M\020Y\020\360\000\000Y\020k\020\360\000\000k\020v\020\360\000\000v\020w\020\360\000\000w\020|\020\360\000\000|\020H\021\360\000\000H\021X\021\360\000\000X\021c\021\360\000\000c\021d\021\360\000\000d\021i\021\360\000\000i\021u\021\360\000\000u\021J\022\360\000\000J\022U\022\360\000\000U\022V\022\360\000\000V\022[\022\360\000\000[\022g\022\360\000\000g\022u\022\360\000\000u\022@\023\360\000\000@\023A\023\360\000\000A\023F\023\360\000\000F\023R\023\360\000\000R\023b\023\360\000\000b\023m\023\360\000\000m\023n\023\360\000\000n\023s\023\360\000\000s\023\023\360\000\000\023U\024\360\000\000U\024`\024\360\000\000`\024a\024\360\000\000a\024f\024\360\000\000f\024r\024\360\000\000r\024C\025\360\000\000C\025N\025\360\000\000N\025O\025\360\000\000O\025T\025\360\000\000T\025`\025\360\000\000`\025q\025\360\000\000q\025|\025\360\000\000|\025}\025\360\000\000}\025B\026\360\000\000B\026N\026\360\000\000N\026h\026\360\000\000h\026s\026\360\000\000s\026t\026\360\000\000t\026y\026\360\000\000y\026E\027\360\000\000E\027\\\027\360\000\000\\\027g\027\360\000\000g\027h\027\360\000\000h\027m\027\360\000\000m\027y\027\360\000\000y\027H\030\360\000\000H\030S\030\360\000\000S\030T\030\360\000\000T\030Y\030\360\000\000Y\030e\030\360\000\000e\030v\030\360\000\000v\030A\031\360\000\000A\031B\031\360\000\000B\031G\031\360\000\000G\031S\031\360\000\000S\031g\031\360\000\000g\031r\031\360\000\000r\031s\031\360\000\000s\031x\031\360\000\000x\031D\032\360\000\000D\032]\032\360\000\000]\032h\032\360\000\000h\032i\032\360\000\000i\032n\032\360\000\000n\032z\032\360\000\000z\032K\033\360\000\000K\033V\033\360\000\000V\033W\033\360\000\000W\033\\\033\360\000\000\\\033h\033\360\000\000h\033w\033\360\000\000w\033B\034\360\000\000B\034C\034\360\000\000C\034H\034\360\000\000H\034T\034\360\000\000T\034b\034\360\000\000b\034m\034\360""\000\000m\034n\034\360\000\000n\034s\034\360\000\000s\034\034\360\000\000\034P\035\360\000\000P\035[\035\360\000\000[\035\\\035\360\000\000\\\035a\035\360\000\000a\035m\035\360\000\000m\035|\035\360\000\000|\035G\036\360\000\000G\036H\036\360\000\000H\036M\036\360\000\000M\036Y\036\360\000\000Y\036h\036\360\000\000h\036s\036\360\000\000s\036t\036\360\000\000t\036y\036\360\000\000y\036E\037\360\000\000E\037W\037\360\000\000W\037b\037\360\000\000b\037c\037\360\000\000c\037h\037\360\000\000h\037t\037\360\000\000t\037D \360\000\000D O \360\000\000O P \360\000\000P U \360\000\000U a \360\000\000a r \360\000\000r } \360\000\000} ~ \360\000\000~ C!\360\000\000C!O!\360\000\000O!^!\360\000\000^!i!\360\000\000i!j!\360\000\000j!o!\360\000\000o!{!\360\000\000{!J\"\360\000\000J\"U\"\360\000\000U\"V\"\360\000\000V\"[\"\360\000\000[\"g\"\360\000\000g\"B#\360\000\000B#M#\360\000\000M#N#\360\000\000N#S#\360\000\000S#_#\360\000\000_#s#\360\000\000s#~#\360\000\000~##\360\000\000#D$\360\000\000D$P$\360\000\000P$d$\360\000\000d$o$\360\000\000o$p$\360\000\000p$u$\360\000\000u$A%\360\000\000A%U%\360\000\000U%`%\360\000\000`%a%\360\000\000a%f%\360\000\000f%r%\360\000\000r%E&\360\000\000E&P&\360\000\000P&Q&\360\000\000Q&V&\360\000\000V&b&\360\000\000b&w&\360\000\000w&B'\360\000\000B'C'\360\000\000C'H'\360\000\000H'T'\360\000\000T'i'\360\000\000i't'\360\000\000t'u'\360\000\000u'z'\360\000\000z'F(\360\000\000F(Y(\360\000\000Y(d(\360\000\000d(e(\360\000\000e(j(\360\000\000j(v(\360\000\000v((\360\000\000(J)\360\000\000J)K)\360\000\000K)P)\360\000\000P)\\)\360\000\000\\)y)\360\000\000y)D*\360\000\000D*E*\360\000\000E*J*\360\000\000J*V*\360\000\000V*l*\360\000\000l*w*\360\000\000w*x*\360\000\000x*}*\360\000\000}*I+\360\000\000I+_+\360\000\000_+j+\360\000\000j+k+\360\000\000k+p+\360\000\000p+|+\360\000\000|+R,\360\000\000R,],\360\000\000],^,\360\000\000^,c,\360\000\000c,o,\360\000\000o,D-\360\000\000D-O-\360\000\000O-P-\360\000\000P-U-\360\000\000U-a-\360\000\000a-x-\360\000\000x-C.\360\000""\000C.D.\360\000\000D.I.\360\000\000I.U.\360\000\000U.h.\360\000\000h.s.\360\000\000s.t.\360\000\000t.y.\360\000\000y.E/\360\000\000E/T/\360\000\000T/_/\360\000\000_/`/\360\000\000`/e/\360\000\000e/q/\360\000\000q/L0\360\000\000L0W0\360\000\000W0X0\360\000\000X0]0\360\000\000]0i0\360\000\000i0A1\360\000\000A1L1\360\000\000L1M1\360\000\000M1R1\360\000\000R1^1\360\000\000^1r1\360\000\000r1}1\360\000\000}1~1\360\000\000~1C2\360\000\000C2O2\360\000\000O2h2\360\000\000h2s2\360\000\000s2t2\360\000\000t2y2\360\000\000y2E3\360\000\000E3]3\360\000\000]3h3\360\000\000h3i3\360\000\000i3n3\360\000\000n3z3\360\000\000z3M4\360\000\000M4X4\360\000\000X4Y4\360\000\000Y4^4\360\000\000^4j4\360\000\000j4~4\360\000\000~4I5\360\000\000I5J5\360\000\000J5K5\330\004\007\200s\210!\210=\230\002\230#\230T\240\027\250\001\250\036\260q\330\010\024\220I\230W\240A\240[\260\001\260\021";
static const char __pyx_k_ConvolutionalDependencyNetwork_s_2[] = "ConvolutionalDependencyNetwork.set_validation_data";
static const char __pyx_k_ConvolutionalDependencyNetwork_t_2[] = "ConvolutionalDependencyNetwork.tag_sentence";
static const char __pyx_k_Incompatible_checksums_0x_x_vs_0_2[] = "Incompatible checksums (0x%x vs (0x2f64fba, 0x8d42e09, 0x8e85e02) = (accuracy, answer_score, convolution_lookup, decay_factor, error, feature_tables, features_per_token, float_errors, half_window, hidden2_before_activation, hidden2_bias, hidden2_gradients, hidden2_size, hidden2_values, hidden2_weights, hidden_before_activation, hidden_bias, hidden_gradients, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_deltas, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, max_indices, net_gradients, network_filename, network_text_filename, num_sentences, num_targets, num_tokens, only_classify, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, pred_convolution_lookup, pred_dist_deltas, pred_dist_lookup, pred_dist_offset, pred_dist_table, pred_dist_weights, sentence_accuracy, sentence_lookup, skips, target_convolution_lookup, target_dist_deltas, target_dist_lookup, target_dist_offset, target_dist_table, target_dist_weights, trans_gradients, transitions, use_learning_rate_decay, validation_arguments, validation_predicates, validation_sentences, validation_tags, word_window_size))";
static const char __pyx_k_Incompatible_checksums_0x_x_vs_0_3[] = "Incompatible checksums (0x%x vs (0xca52c1e, 0x8b21fc2, 0x1a87293) = (accuracy, answer_score, convolution_lookup, decay_factor, dependency_weights, error, feature_tables, features_per_token, float_errors, half_window, hidden2_before_activation, hidden2_bias, hidden2_gradients, hidden2_size, hidden2_values, hidden2_weights, hidden_before_activation, hidden_bias, hidden_gradients, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_deltas, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, max_indices, net_gradients, network_filename, network_text_filename, num_sentences, num_targets, num_tokens, only_classify, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, pred_convolution_lookup, pred_dist_deltas, pred_dist_lookup, pred_dist_offset, pred_dist_table, pred_dist_weights, sentence_accuracy, sentence_lookup, skips, target_convolution_lookup, target_dist_deltas, target_dist_lookup, target_dist_offset, target_dist_table, target_dist_weights, trans_gradients, transitions, use_learning_rate_decay, validation_arguments, validation_heads, validation_predicates, validation_sentences, validation_tags, word_window_size))";
/* #### Code section: decls ### */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_10create_new_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_create_new(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_feature_tables, int __pyx_v_word_window, int __pyx_v_hidden_size, int __pyx_v_output_size); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_2__init__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_word_window, PyObject *__pyx_v_input_size, PyObject *__pyx_v_hidden_size, PyObject *__pyx_v_output_size, PyObject *__pyx_v_hidden_weights, PyObject *__pyx_v_hidden_bias, PyObject *__pyx_v_output_weights, PyObject *__pyx_v_output_bias, PyObject *__pyx_v_transitions); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_4description(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_6_create_sentence_lookup(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyArrayObject *__pyx_v_sentence); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_12padding_left___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_12padding_left_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyArrayObject *__pyx_v_padding_left); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_13padding_right___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_13padding_right_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyArrayObject *__pyx_v_padding_right); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_8tag_sentence(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyArrayObject *__pyx_v_sentence); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_10_tag_sentence(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyArrayObject *__pyx_v_sentence, PyObject *__pyx_v_tags); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_12_calculate_delta(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_scores); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_14_calculate_gradients_sll(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_tags, PyObject *__pyx_v_scores); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_16_calculate_gradients_wll(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_tags, PyObject *__pyx_v_scores); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_18_viterbi(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyArrayObject *__pyx_v_scores); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_20set_validation_data(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_validation_sentences, PyObject *__pyx_v_validation_tags); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_22set_learning_rate_decay(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, float __pyx_v_decay_factor); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_24decrease_learning_rates(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_epoch); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_5train_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_26train(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_sentences, PyObject *__pyx_v_tags, int __pyx_v_epochs, int __pyx_v_epochs_between_reports, float __pyx_v_desired_accuracy); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_28_print_epoch_report(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, int __pyx_v_num); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_30_train_epoch(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_sentences, PyObject *__pyx_v_tags); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_9_validate_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_32_validate(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_34_backpropagate(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_sentence); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_36_load_parameters(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_38save(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_40load_from_file(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_16word_window_size___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_10input_size___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_11hidden_size___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_11output_size___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_13learning_rate___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_13learning_rate_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_22learning_rate_features___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_22learning_rate_features_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_12decay_factor___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_12decay_factor_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_18features_per_token___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pre_padding___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pre_padding_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pre_padding_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pos_padding___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pos_padding_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pos_padding_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_14hidden_weights___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_14output_weights___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_11hidden_bias___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_11output_bias___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_12input_values___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_13hidden_values___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_13layer2_values___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_14feature_tables___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_14feature_tables_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_14feature_tables_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_19learning_rate_trans___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_19learning_rate_trans_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_11transitions___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11transitions_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11transitions_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_12answer_score___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_13net_gradients___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_15trans_gradients___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_17input_sent_values___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_18hidden_sent_values___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_18layer2_sent_values___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_16network_filename___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_16network_filename_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_16network_filename_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_21network_text_filename___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_21network_text_filename_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_21network_text_filename_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_42__reduce_cython__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_44__setstate_cython__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_10create_new_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_create_new(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_feature_tables, PyObject *__pyx_v_target_dist_table, PyObject *__pyx_v_pred_dist_table, int __pyx_v_word_window, int __pyx_v_hidden1_size, int __pyx_v_hidden2_size, int __pyx_v_output_size); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_2description(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_4__init__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_word_window, PyObject *__pyx_v_input_size, PyObject *__pyx_v_hidden1_size, PyObject *__pyx_v_hidden2_size, PyObject *__pyx_v_output_size, PyObject *__pyx_v_hidden1_weights, PyObject *__pyx_v_hidden1_bias, PyObject *__pyx_v_target_dist_weights, PyObject *__pyx_v_pred_dist_weights, PyObject *__pyx_v_hidden2_weights, PyObject *__pyx_v_hidden2_bias, PyObject *__pyx_v_output_weights, PyObject *__pyx_v_output_bias); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_6_generate_save_dict(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_8save(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_10_load_from_file(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_data, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12load_from_file(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_14_load_parameters(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16set_validation_data(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_validation_sentences, PyObject *__pyx_v_validation_predicates, PyObject *__pyx_v_validation_tags, PyObject *__pyx_v_validation_arguments); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_5train_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18train(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_sentences, PyObject *__pyx_v_predicates, PyObject *__pyx_v_tags, int __pyx_v_epochs, int __pyx_v_epochs_between_reports, float __pyx_v_desired_accuracy, PyObject *__pyx_v_arguments); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_20_reset_counters(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_22_shuffle_data(CYTHON_UNUSED struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_sentences, PyObject *__pyx_v_predicates, PyObject *__pyx_v_tags, PyObject *__pyx_v_arguments); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_24_train_epoch(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_sentences, PyObject *__pyx_v_predicates, PyObject *__pyx_v_tags, PyObject *__pyx_v_arguments); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_26tag_sentence(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyArrayObject *__pyx_v_sentence, PyArrayObject *__pyx_v_predicates, PyObject *__pyx_v_arguments, PyLongObject *__pyx_v_logprob, PyLongObject *__pyx_v_allow_repeats); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_28_sentence_convolution(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_sentence, PyObject *__pyx_v_predicate, PyObject *__pyx_v_argument_blocks, PyObject *__pyx_v_training); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_30_pre_tagging_setup(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyArrayObject *__pyx_v_sentence, PyLongObject *__pyx_v_training); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_32_tag_sentence(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyArrayObject *__pyx_v_sentence, PyArrayObject *__pyx_v_predicates, PyObject *__pyx_v_tags, PyObject *__pyx_v_argument_blocks, PyLongObject *__pyx_v_allow_repeats, PyLongObject *__pyx_v_logprob); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_34_validate(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_36_calculate_gradients(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_tags, PyObject *__pyx_v_scores); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_38_calculate_gradients_classify(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_tags, PyObject *__pyx_v_scores); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_40_backpropagate(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_42_adjust_weights(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_predicate, PyObject *__pyx_v_arguments); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_44_calculate_input_deltas(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyArrayObject *__pyx_v_sentence, int __pyx_v_predicate, PyObject *__pyx_v_arguments); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_46_adjust_features(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_sentence, CYTHON_UNUSED PyObject *__pyx_v_predicate); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_48_viterbi(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyArrayObject *__pyx_v_scores, PyLongObject *__pyx_v_allow_repeats); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_50_create_target_lookup(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_52_create_pred_lookup(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_54_create_convolution_lookup(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_sentence, PyObject *__pyx_v_training); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_19target_dist_weights___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17pred_dist_weights___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_offset___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_offset___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_lookup___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_lookup___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25target_convolution_lookup___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_23pred_convolution_lookup___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_deltas___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_deltas___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12hidden2_size___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15hidden2_weights___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12hidden2_bias___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_14hidden2_values___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25hidden2_before_activation___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_24hidden_before_activation___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_11max_indices___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_56__reduce_cython__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_58__setstate_cython__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_save(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_2load_from_file(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_4train(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyObject *__pyx_v_sentences, PyObject *__pyx_v_heads, int __pyx_v_epochs, int __pyx_v_epochs_between_reports, float __pyx_v_desired_accuracy, PyObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_6set_validation_data(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyObject *__pyx_v_sentences, PyObject *__pyx_v_heads, PyObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_8_tag_sentence(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyObject *__pyx_v_sentence, CYTHON_UNUSED PyObject *__pyx_v_predicates, PyObject *__pyx_v_heads, PyObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_10_tag_sentence_unlabeled_dependency(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyArrayObject *__pyx_v_sentence, PyArrayObject *__pyx_v_heads); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_12_tag_sentence_labeled_dependency(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyArrayObject *__pyx_v_sentence, PyArrayObject *__pyx_v_heads, PyArrayObject *__pyx_v_labels); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_14_calculate_gradients(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyObject *__pyx_v_gold_head, PyObject *__pyx_v_scores); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_16_validate(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_18_average_error(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_20_print_epoch_report(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, int __pyx_v_num); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_22tag_sentence(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyArrayObject *__pyx_v_sentence, PyArrayObject *__pyx_v_heads); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_24_find_cycles(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyArrayObject *__pyx_v_graph); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_26_find_cycle_recursive(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyArrayObject *__pyx_v_graph, int __pyx_v_vertex, PyObject *__pyx_v_visited, PyObject *__pyx_v_reachable, PyObject *__pyx_v_unreachable); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_28_contract_cycle(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyObject *__pyx_v_heads, PyObject *__pyx_v_cycle); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_30_find_maximum_spanning_tree(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_18dependency_weights___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_32__reduce_cython__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_34__setstate_cython__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network___pyx_unpickle_Network(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_2__pyx_unpickle_ConvolutionalNetwork(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_4__pyx_unpickle_ConvolutionalDependencyNetwork(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_tp_new_6nltkor_3tag_4libs_7network_Network(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6nltkor_3tag_4libs_7network_ConvolutionalNetwork(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
/* #### Code section: late_includes ### */
/* #### Code section: module_state ### */
/* SmallCodeConfig */
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif

typedef struct {
  PyObject *__pyx_d;
  PyObject *__pyx_b;
  PyObject *__pyx_cython_runtime;
  PyObject *__pyx_empty_tuple;
  PyObject *__pyx_empty_bytes;
  PyObject *__pyx_empty_unicode;
  #ifdef __Pyx_CyFunction_USED
  PyTypeObject *__pyx_CyFunctionType;
  #endif
  #ifdef __Pyx_FusedFunction_USED
  PyTypeObject *__pyx_FusedFunctionType;
  #endif
  #ifdef __Pyx_Generator_USED
  PyTypeObject *__pyx_GeneratorType;
  #endif
  #ifdef __Pyx_IterableCoroutine_USED
  PyTypeObject *__pyx_IterableCoroutineType;
  #endif
  #ifdef __Pyx_Coroutine_USED
  PyTypeObject *__pyx_CoroutineAwaitType;
  #endif
  #ifdef __Pyx_Coroutine_USED
  PyTypeObject *__pyx_CoroutineType;
  #endif
  PyTypeObject *__pyx_ptype_7cpython_4type_type;
  PyTypeObject *__pyx_ptype_7cpython_4bool_bool;
  PyTypeObject *__pyx_ptype_7cpython_7complex_complex;
  PyTypeObject *__pyx_ptype_5numpy_dtype;
  PyTypeObject *__pyx_ptype_5numpy_flatiter;
  PyTypeObject *__pyx_ptype_5numpy_broadcast;
  PyTypeObject *__pyx_ptype_5numpy_ndarray;
  PyTypeObject *__pyx_ptype_5numpy_generic;
  PyTypeObject *__pyx_ptype_5numpy_number;
  PyTypeObject *__pyx_ptype_5numpy_integer;
  PyTypeObject *__pyx_ptype_5numpy_signedinteger;
  PyTypeObject *__pyx_ptype_5numpy_unsignedinteger;
  PyTypeObject *__pyx_ptype_5numpy_inexact;
  PyTypeObject *__pyx_ptype_5numpy_floating;
  PyTypeObject *__pyx_ptype_5numpy_complexfloating;
  PyTypeObject *__pyx_ptype_5numpy_flexible;
  PyTypeObject *__pyx_ptype_5numpy_character;
  PyTypeObject *__pyx_ptype_5numpy_ufunc;
  PyObject *__pyx_type_6nltkor_3tag_4libs_7network_Network;
  PyObject *__pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalNetwork;
  PyObject *__pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork;
  PyObject *__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr;
  PyObject *__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr;
  PyObject *__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr;
  PyObject *__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr;
  PyObject *__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr;
  PyTypeObject *__pyx_ptype_6nltkor_3tag_4libs_7network_Network;
  PyTypeObject *__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork;
  PyTypeObject *__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork;
  PyTypeObject *__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr;
  PyTypeObject *__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr;
  PyTypeObject *__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr;
  PyTypeObject *__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr;
  PyTypeObject *__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
  __Pyx_CachedCFunction __pyx_umethod_PySet_Type__update;
  PyObject *__pyx_slice[5];
  PyObject *__pyx_tuple[15];
  PyObject *__pyx_codeobj_tab[161];
  PyObject *__pyx_string_tab[521];
  PyObject *__pyx_float_0_0;
  PyObject *__pyx_float_1_0;
  PyObject *__pyx_float_0_01;
  PyObject *__pyx_float_2_38;
  PyObject *__pyx_float_neg_1_0;
  PyObject *__pyx_int_0;
  PyObject *__pyx_int_1;
  PyObject *__pyx_int_2;
  PyObject *__pyx_int_27816595;
  PyObject *__pyx_int_49696698;
  PyObject *__pyx_int_119830996;
  PyObject *__pyx_int_145891266;
  PyObject *__pyx_int_148123145;
  PyObject *__pyx_int_149446146;
  PyObject *__pyx_int_202246394;
  PyObject *__pyx_int_212151326;
  PyObject *__pyx_int_220499725;
  PyObject *__pyx_int_neg_1;
  PyObject *__pyx_int_neg_2;
  PyObject *__pyx_int_neg_1000;
/* #### Code section: module_state_contents ### */
/* IterNextPlain.module_state_decls */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
PyObject *__Pyx_GetBuiltinNext_LimitedAPI_cache;
#endif


#if CYTHON_USE_FREELISTS
struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr *__pyx_freelist_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr[8];
int __pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr *__pyx_freelist_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr[8];
int __pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr *__pyx_freelist_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr[8];
int __pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr *__pyx_freelist_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr[8];
int __pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr *__pyx_freelist_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr[8];
int __pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr;
#endif
/* CachedMethodType.module_state_decls */
#if CYTHON_COMPILING_IN_LIMITED_API
PyObject *__Pyx_CachedMethodType;
#endif

/* CodeObjectCache.module_state_decls */
struct __Pyx_CodeObjectCache __pyx_code_cache;

/* #### Code section: module_state_end ### */
} __pyx_mstatetype;

#if CYTHON_USE_MODULE_STATE
#ifdef __cplusplus
namespace {
extern struct PyModuleDef __pyx_moduledef;
} /* anonymous namespace */
#else
static struct PyModuleDef __pyx_moduledef;
#endif

#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))

#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
#else
static __pyx_mstatetype __pyx_mstate_global_static =
#ifdef __cplusplus
    {};
#else
    {0};
#endif
static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static;
#endif
/* #### Code section: constant_name_defines ### */
#define __pyx_kp_u_ __pyx_string_tab[0]
#define __pyx_kp_u_Accuracy __pyx_string_tab[1]
#define __pyx_kp_u_Confidence_measure_not_implement __pyx_string_tab[2]
#define __pyx_kp_u_Convolution_layer_size __pyx_string_tab[3]
#define __pyx_n_u_ConvolutionalDependencyNetwork __pyx_string_tab[4]
#define __pyx_n_u_ConvolutionalDependencyNetwork_10 __pyx_string_tab[5]
#define __pyx_n_u_ConvolutionalDependencyNetwork_11 __pyx_string_tab[6]
#define __pyx_n_u_ConvolutionalDependencyNetwork_12 __pyx_string_tab[7]
#define __pyx_n_u_ConvolutionalDependencyNetwork_13 __pyx_string_tab[8]
#define __pyx_n_u_ConvolutionalDependencyNetwork_14 __pyx_string_tab[9]
#define __pyx_n_u_ConvolutionalDependencyNetwork_2 __pyx_string_tab[10]
#define __pyx_n_u_ConvolutionalDependencyNetwork_3 __pyx_string_tab[11]
#define __pyx_n_u_ConvolutionalDependencyNetwork_4 __pyx_string_tab[12]
#define __pyx_n_u_ConvolutionalDependencyNetwork_5 __pyx_string_tab[13]
#define __pyx_n_u_ConvolutionalDependencyNetwork_6 __pyx_string_tab[14]
#define __pyx_n_u_ConvolutionalDependencyNetwork_7 __pyx_string_tab[15]
#define __pyx_n_u_ConvolutionalDependencyNetwork_8 __pyx_string_tab[16]
#define __pyx_n_u_ConvolutionalDependencyNetwork_9 __pyx_string_tab[17]
#define __pyx_n_u_ConvolutionalDependencyNetwork_l __pyx_string_tab[18]
#define __pyx_n_u_ConvolutionalDependencyNetwork_s __pyx_string_tab[19]
#define __pyx_n_u_ConvolutionalDependencyNetwork_s_2 __pyx_string_tab[20]
#define __pyx_n_u_ConvolutionalDependencyNetwork_t __pyx_string_tab[21]
#define __pyx_n_u_ConvolutionalDependencyNetwork_t_2 __pyx_string_tab[22]
#define __pyx_n_u_ConvolutionalNetwork __pyx_string_tab[23]
#define __pyx_n_u_ConvolutionalNetwork___reduce_cy __pyx_string_tab[24]
#define __pyx_n_u_ConvolutionalNetwork___setstate __pyx_string_tab[25]
#define __pyx_n_u_ConvolutionalNetwork__adjust_fea __pyx_string_tab[26]
#define __pyx_n_u_ConvolutionalNetwork__adjust_wei __pyx_string_tab[27]
#define __pyx_n_u_ConvolutionalNetwork__backpropag __pyx_string_tab[28]
#define __pyx_n_u_ConvolutionalNetwork__calculate __pyx_string_tab[29]
#define __pyx_n_u_ConvolutionalNetwork__calculate_2 __pyx_string_tab[30]
#define __pyx_n_u_ConvolutionalNetwork__calculate_3 __pyx_string_tab[31]
#define __pyx_n_u_ConvolutionalNetwork__create_con __pyx_string_tab[32]
#define __pyx_n_u_ConvolutionalNetwork__create_pre __pyx_string_tab[33]
#define __pyx_n_u_ConvolutionalNetwork__create_tar __pyx_string_tab[34]
#define __pyx_n_u_ConvolutionalNetwork__generate_s __pyx_string_tab[35]
#define __pyx_n_u_ConvolutionalNetwork__load_from __pyx_string_tab[36]
#define __pyx_n_u_ConvolutionalNetwork__load_param __pyx_string_tab[37]
#define __pyx_n_u_ConvolutionalNetwork__pre_taggin __pyx_string_tab[38]
#define __pyx_n_u_ConvolutionalNetwork__reset_coun __pyx_string_tab[39]
#define __pyx_n_u_ConvolutionalNetwork__sentence_c __pyx_string_tab[40]
#define __pyx_n_u_ConvolutionalNetwork__shuffle_da __pyx_string_tab[41]
#define __pyx_n_u_ConvolutionalNetwork__tag_senten __pyx_string_tab[42]
#define __pyx_n_u_ConvolutionalNetwork__train_epoc __pyx_string_tab[43]
#define __pyx_n_u_ConvolutionalNetwork__validate __pyx_string_tab[44]
#define __pyx_n_u_ConvolutionalNetwork__viterbi __pyx_string_tab[45]
#define __pyx_n_u_ConvolutionalNetwork_create_new __pyx_string_tab[46]
#define __pyx_n_u_ConvolutionalNetwork_description __pyx_string_tab[47]
#define __pyx_n_u_ConvolutionalNetwork_load_from_f __pyx_string_tab[48]
#define __pyx_n_u_ConvolutionalNetwork_save __pyx_string_tab[49]
#define __pyx_n_u_ConvolutionalNetwork_set_validat __pyx_string_tab[50]
#define __pyx_n_u_ConvolutionalNetwork_tag_sentenc __pyx_string_tab[51]
#define __pyx_n_u_ConvolutionalNetwork_train __pyx_string_tab[52]
#define __pyx_kp_u_Distance_table_sizes_target_and __pyx_string_tab[53]
#define __pyx_kp_u_Feature_table_sizes __pyx_string_tab[54]
#define __pyx_n_u_FloatingPointError __pyx_string_tab[55]
#define __pyx_kp_u_Hidden_layer_size __pyx_string_tab[56]
#define __pyx_n_u_ImportError __pyx_string_tab[57]
#define __pyx_kp_u_Incompatible_checksums_0x_x_vs_0 __pyx_string_tab[58]
#define __pyx_kp_u_Incompatible_checksums_0x_x_vs_0_2 __pyx_string_tab[59]
#define __pyx_kp_u_Incompatible_checksums_0x_x_vs_0_3 __pyx_string_tab[60]
#define __pyx_n_u_Infinity __pyx_string_tab[61]
#define __pyx_kp_u_Input_layer_size __pyx_string_tab[62]
#define __pyx_n_u_Logger __pyx_string_tab[63]
#define __pyx_n_u_Network __pyx_string_tab[64]
#define __pyx_n_u_Network___reduce_cython __pyx_string_tab[65]
#define __pyx_n_u_Network___setstate_cython __pyx_string_tab[66]
#define __pyx_n_u_Network__backpropagate __pyx_string_tab[67]
#define __pyx_n_u_Network__calculate_delta __pyx_string_tab[68]
#define __pyx_n_u_Network__calculate_gradients_sll __pyx_string_tab[69]
#define __pyx_n_u_Network__calculate_gradients_wll __pyx_string_tab[70]
#define __pyx_n_u_Network__create_sentence_lookup __pyx_string_tab[71]
#define __pyx_n_u_Network__load_parameters __pyx_string_tab[72]
#define __pyx_n_u_Network__print_epoch_report __pyx_string_tab[73]
#define __pyx_n_u_Network__tag_sentence __pyx_string_tab[74]
#define __pyx_n_u_Network__train_epoch __pyx_string_tab[75]
#define __pyx_n_u_Network__validate __pyx_string_tab[76]
#define __pyx_n_u_Network__viterbi __pyx_string_tab[77]
#define __pyx_n_u_Network_create_new __pyx_string_tab[78]
#define __pyx_n_u_Network_decrease_learning_rates __pyx_string_tab[79]
#define __pyx_n_u_Network_description __pyx_string_tab[80]
#define __pyx_n_u_Network_load_from_file __pyx_string_tab[81]
#define __pyx_n_u_Network_save __pyx_string_tab[82]
#define __pyx_n_u_Network_set_learning_rate_decay __pyx_string_tab[83]
#define __pyx_n_u_Network_set_validation_data __pyx_string_tab[84]
#define __pyx_n_u_Network_tag_sentence __pyx_string_tab[85]
#define __pyx_n_u_Network_train __pyx_string_tab[86]
#define __pyx_n_u_NotImplementedError __pyx_string_tab[87]
#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[88]
#define __pyx_kp_u_Output_size __pyx_string_tab[89]
#define __pyx_n_u_PickleError __pyx_string_tab[90]
#define __pyx_kp_u_Saved_model __pyx_string_tab[91]
#define __pyx_kp_u_Second_hidden_layer_size __pyx_string_tab[92]
#define __pyx_kp_u_Sentence_accuracy __pyx_string_tab[93]
#define __pyx_n_u_T __pyx_string_tab[94]
#define __pyx_kp_u_Token_accuracy __pyx_string_tab[95]
#define __pyx_kp_u_Training_for_up_to_d_epochs __pyx_string_tab[96]
#define __pyx_kp_u_Word_window_size __pyx_string_tab[97]
#define __pyx_kp_u__2 __pyx_string_tab[98]
#define __pyx_kp_u__3 __pyx_string_tab[99]
#define __pyx_kp_u__4 __pyx_string_tab[100]
#define __pyx_kp_u__5 __pyx_string_tab[101]
#define __pyx_kp_u__6 __pyx_string_tab[102]
#define __pyx_n_u_a __pyx_string_tab[103]
#define __pyx_n_u_add __pyx_string_tab[104]
#define __pyx_kp_u_add_note __pyx_string_tab[105]
#define __pyx_n_u_adjust_features __pyx_string_tab[106]
#define __pyx_n_u_adjust_weights __pyx_string_tab[107]
#define __pyx_n_u_all_scores __pyx_string_tab[108]
#define __pyx_n_u_allow_pickle __pyx_string_tab[109]
#define __pyx_n_u_allow_repeats __pyx_string_tab[110]
#define __pyx_n_u_answer __pyx_string_tab[111]
#define __pyx_n_u_arange __pyx_string_tab[112]
#define __pyx_n_u_argmax __pyx_string_tab[113]
#define __pyx_n_u_args __pyx_string_tab[114]
#define __pyx_n_u_argument __pyx_string_tab[115]
#define __pyx_n_u_argument_blocks __pyx_string_tab[116]
#define __pyx_n_u_argument_distances __pyx_string_tab[117]
#define __pyx_n_u_arguments __pyx_string_tab[118]
#define __pyx_n_u_array __pyx_string_tab[119]
#define __pyx_n_u_astype __pyx_string_tab[120]
#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[121]
#define __pyx_n_u_average_error __pyx_string_tab[122]
#define __pyx_n_u_axis __pyx_string_tab[123]
#define __pyx_n_u_backpropagate __pyx_string_tab[124]
#define __pyx_n_u_best_scores __pyx_string_tab[125]
#define __pyx_n_u_bincount __pyx_string_tab[126]
#define __pyx_n_u_calculate_all_scores __pyx_string_tab[127]
#define __pyx_n_u_calculate_delta __pyx_string_tab[128]
#define __pyx_n_u_calculate_gradients __pyx_string_tab[129]
#define __pyx_n_u_calculate_gradients_classify __pyx_string_tab[130]
#define __pyx_n_u_calculate_gradients_sll __pyx_string_tab[131]
#define __pyx_n_u_calculate_gradients_wll __pyx_string_tab[132]
#define __pyx_n_u_calculate_input_deltas __pyx_string_tab[133]
#define __pyx_n_u_class_getitem __pyx_string_tab[134]
#define __pyx_n_u_cline_in_traceback __pyx_string_tab[135]
#define __pyx_n_u_clip __pyx_string_tab[136]
#define __pyx_n_u_close __pyx_string_tab[137]
#define __pyx_n_u_cls __pyx_string_tab[138]
#define __pyx_n_u_column_numbers __pyx_string_tab[139]
#define __pyx_n_u_concatenate __pyx_string_tab[140]
#define __pyx_n_u_confidence __pyx_string_tab[141]
#define __pyx_n_u_conflicting_probs __pyx_string_tab[142]
#define __pyx_n_u_conflicting_tag __pyx_string_tab[143]
#define __pyx_n_u_contract_cycle __pyx_string_tab[144]
#define __pyx_n_u_convolution_lookup __pyx_string_tab[145]
#define __pyx_n_u_convolution_max __pyx_string_tab[146]
#define __pyx_n_u_convolution_values __pyx_string_tab[147]
#define __pyx_n_u_copy __pyx_string_tab[148]
#define __pyx_n_u_correct_path_score __pyx_string_tab[149]
#define __pyx_n_u_correction __pyx_string_tab[150]
#define __pyx_kp_u_corrections_skipped_Learning_ra __pyx_string_tab[151]
#define __pyx_kp_u_corrections_skipped_learning_ra __pyx_string_tab[152]
#define __pyx_n_u_count_nonzero __pyx_string_tab[153]
#define __pyx_n_u_counts __pyx_string_tab[154]
#define __pyx_n_u_create_convolution_lookup __pyx_string_tab[155]
#define __pyx_n_u_create_new __pyx_string_tab[156]
#define __pyx_n_u_create_new_locals_genexpr __pyx_string_tab[157]
#define __pyx_n_u_create_pred_lookup __pyx_string_tab[158]
#define __pyx_n_u_create_sentence_lookup __pyx_string_tab[159]
#define __pyx_n_u_create_target_lookup __pyx_string_tab[160]
#define __pyx_n_u_cycle __pyx_string_tab[161]
#define __pyx_n_u_cycle_inds __pyx_string_tab[162]
#define __pyx_n_u_cycle_score __pyx_string_tab[163]
#define __pyx_n_u_cycles __pyx_string_tab[164]
#define __pyx_n_u_d __pyx_string_tab[165]
#define __pyx_n_u_dCd_hidden2 __pyx_string_tab[166]
#define __pyx_n_u_dCd_tanh __pyx_string_tab[167]
#define __pyx_n_u_dCdf_2 __pyx_string_tab[168]
#define __pyx_n_u_dCdf_3 __pyx_string_tab[169]
#define __pyx_n_u_data __pyx_string_tab[170]
#define __pyx_n_u_debug __pyx_string_tab[171]
#define __pyx_n_u_decay_factor __pyx_string_tab[172]
#define __pyx_n_u_decrease_learning_rates __pyx_string_tab[173]
#define __pyx_n_u_del __pyx_string_tab[174]
#define __pyx_n_u_delta __pyx_string_tab[175]
#define __pyx_n_u_delta_softmax __pyx_string_tab[176]
#define __pyx_n_u_deltas __pyx_string_tab[177]
#define __pyx_n_u_desc __pyx_string_tab[178]
#define __pyx_n_u_description __pyx_string_tab[179]
#define __pyx_n_u_desired_accuracy __pyx_string_tab[180]
#define __pyx_n_u_diagonal __pyx_string_tab[181]
#define __pyx_n_u_dict __pyx_string_tab[182]
#define __pyx_n_u_dict_2 __pyx_string_tab[183]
#define __pyx_kp_u_disable __pyx_string_tab[184]
#define __pyx_n_u_dist_deltas __pyx_string_tab[185]
#define __pyx_n_u_dist_features __pyx_string_tab[186]
#define __pyx_n_u_dist_features_per_token __pyx_string_tab[187]
#define __pyx_n_u_dist_pred_from __pyx_string_tab[188]
#define __pyx_n_u_dist_table_dims __pyx_string_tab[189]
#define __pyx_n_u_dist_target_from __pyx_string_tab[190]
#define __pyx_n_u_dot __pyx_string_tab[191]
#define __pyx_n_u_dtype __pyx_string_tab[192]
#define __pyx_n_u_element __pyx_string_tab[193]
#define __pyx_n_u_embeddings __pyx_string_tab[194]
#define __pyx_n_u_empty __pyx_string_tab[195]
#define __pyx_n_u_empty_like __pyx_string_tab[196]
#define __pyx_kp_u_enable __pyx_string_tab[197]
#define __pyx_n_u_end __pyx_string_tab[198]
#define __pyx_n_u_enumerate __pyx_string_tab[199]
#define __pyx_n_u_epoch __pyx_string_tab[200]
#define __pyx_n_u_epochs __pyx_string_tab[201]
#define __pyx_kp_u_epochs_Error __pyx_string_tab[202]
#define __pyx_n_u_epochs_between_reports __pyx_string_tab[203]
#define __pyx_n_u_error __pyx_string_tab[204]
#define __pyx_n_u_exp __pyx_string_tab[205]
#define __pyx_n_u_exp_scores __pyx_string_tab[206]
#define __pyx_n_u_exp_sum __pyx_string_tab[207]
#define __pyx_n_u_exponentials __pyx_string_tab[208]
#define __pyx_n_u_f __pyx_string_tab[209]
#define __pyx_n_u_factor __pyx_string_tab[210]
#define __pyx_n_u_feature_tables __pyx_string_tab[211]
#define __pyx_n_u_features __pyx_string_tab[212]
#define __pyx_n_u_filename __pyx_string_tab[213]
#define __pyx_n_u_fill_diagonal __pyx_string_tab[214]
#define __pyx_n_u_find_cycle_recursive __pyx_string_tab[215]
#define __pyx_n_u_find_cycles __pyx_string_tab[216]
#define __pyx_n_u_find_maximum_spanning_tree __pyx_string_tab[217]
#define __pyx_n_u_flatten __pyx_string_tab[218]
#define __pyx_n_u_float64 __pyx_string_tab[219]
#define __pyx_n_u_func __pyx_string_tab[220]
#define __pyx_kp_u_gc __pyx_string_tab[221]
#define __pyx_n_u_generate_save_dict __pyx_string_tab[222]
#define __pyx_n_u_genexpr __pyx_string_tab[223]
#define __pyx_n_u_get __pyx_string_tab[224]
#define __pyx_n_u_getLogger __pyx_string_tab[225]
#define __pyx_n_u_get_state __pyx_string_tab[226]
#define __pyx_n_u_getstate __pyx_string_tab[227]
#define __pyx_n_u_gold_head __pyx_string_tab[228]
#define __pyx_n_u_gold_tag __pyx_string_tab[229]
#define __pyx_n_u_gold_tags __pyx_string_tab[230]
#define __pyx_n_u_grad_matrix __pyx_string_tab[231]
#define __pyx_n_u_grad_times_softmax __pyx_string_tab[232]
#define __pyx_n_u_gradients __pyx_string_tab[233]
#define __pyx_n_u_gradients_t __pyx_string_tab[234]
#define __pyx_n_u_graph __pyx_string_tab[235]
#define __pyx_n_u_greater __pyx_string_tab[236]
#define __pyx_n_u_half_window __pyx_string_tab[237]
#define __pyx_n_u_hardtanh __pyx_string_tab[238]
#define __pyx_n_u_hardtanhd __pyx_string_tab[239]
#define __pyx_n_u_head __pyx_string_tab[240]
#define __pyx_n_u_head_to_v __pyx_string_tab[241]
#define __pyx_n_u_heads __pyx_string_tab[242]
#define __pyx_n_u_hidden1_bias __pyx_string_tab[243]
#define __pyx_n_u_hidden1_size __pyx_string_tab[244]
#define __pyx_n_u_hidden1_weights __pyx_string_tab[245]
#define __pyx_n_u_hidden2_before_activation __pyx_string_tab[246]
#define __pyx_n_u_hidden2_bias __pyx_string_tab[247]
#define __pyx_n_u_hidden2_gradients __pyx_string_tab[248]
#define __pyx_n_u_hidden2_size __pyx_string_tab[249]
#define __pyx_n_u_hidden2_values __pyx_string_tab[250]
#define __pyx_n_u_hidden2_weights __pyx_string_tab[251]
#define __pyx_n_u_hidden_before_activation __pyx_string_tab[252]
#define __pyx_n_u_hidden_bias __pyx_string_tab[253]
#define __pyx_n_u_hidden_bias_deltas __pyx_string_tab[254]
#define __pyx_n_u_hidden_deltas __pyx_string_tab[255]
#define __pyx_n_u_hidden_gradients __pyx_string_tab[256]
#define __pyx_n_u_hidden_size __pyx_string_tab[257]
#define __pyx_n_u_hidden_weights __pyx_string_tab[258]
#define __pyx_n_u_high __pyx_string_tab[259]
#define __pyx_n_u_highest_prob_arg __pyx_string_tab[260]
#define __pyx_n_u_hits __pyx_string_tab[261]
#define __pyx_n_u_i __pyx_string_tab[262]
#define __pyx_n_u_i_args __pyx_string_tab[263]
#define __pyx_n_u_incoming_weights __pyx_string_tab[264]
#define __pyx_n_u_ind_from __pyx_string_tab[265]
#define __pyx_n_u_ind_to __pyx_string_tab[266]
#define __pyx_n_u_index __pyx_string_tab[267]
#define __pyx_n_u_inds __pyx_string_tab[268]
#define __pyx_n_u_info __pyx_string_tab[269]
#define __pyx_n_u_init __pyx_string_tab[270]
#define __pyx_n_u_initializing __pyx_string_tab[271]
#define __pyx_n_u_inplace __pyx_string_tab[272]
#define __pyx_n_u_input_and_pred_dist_values __pyx_string_tab[273]
#define __pyx_n_u_input_data __pyx_string_tab[274]
#define __pyx_n_u_input_deltas __pyx_string_tab[275]
#define __pyx_n_u_input_gradients __pyx_string_tab[276]
#define __pyx_n_u_input_size __pyx_string_tab[277]
#define __pyx_n_u_input_size_with_distance __pyx_string_tab[278]
#define __pyx_n_u_input_values __pyx_string_tab[279]
#define __pyx_n_u_is_coroutine __pyx_string_tab[280]
#define __pyx_kp_u_isenabled __pyx_string_tab[281]
#define __pyx_n_u_j __pyx_string_tab[282]
#define __pyx_n_u_label __pyx_string_tab[283]
#define __pyx_n_u_labels __pyx_string_tab[284]
#define __pyx_n_u_last_accuracy __pyx_string_tab[285]
#define __pyx_n_u_last_error __pyx_string_tab[286]
#define __pyx_n_u_last_tag __pyx_string_tab[287]
#define __pyx_n_u_last_token __pyx_string_tab[288]
#define __pyx_n_u_last_values __pyx_string_tab[289]
#define __pyx_n_u_less __pyx_string_tab[290]
#define __pyx_n_u_load __pyx_string_tab[291]
#define __pyx_n_u_load_from_file __pyx_string_tab[292]
#define __pyx_n_u_load_from_file_2 __pyx_string_tab[293]
#define __pyx_n_u_load_parameters __pyx_string_tab[294]
#define __pyx_n_u_log __pyx_string_tab[295]
#define __pyx_n_u_log_sum_scores __pyx_string_tab[296]
#define __pyx_n_u_logadd __pyx_string_tab[297]
#define __pyx_n_u_logger __pyx_string_tab[298]
#define __pyx_n_u_logging __pyx_string_tab[299]
#define __pyx_n_u_logical_and __pyx_string_tab[300]
#define __pyx_n_u_logical_not __pyx_string_tab[301]
#define __pyx_n_u_logprob __pyx_string_tab[302]
#define __pyx_n_u_logprobs __pyx_string_tab[303]
#define __pyx_n_u_logsumexp __pyx_string_tab[304]
#define __pyx_n_u_main __pyx_string_tab[305]
#define __pyx_n_u_max __pyx_string_tab[306]
#define __pyx_n_u_max_incoming_inds __pyx_string_tab[307]
#define __pyx_n_u_max_incoming_weights __pyx_string_tab[308]
#define __pyx_n_u_max_indices __pyx_string_tab[309]
#define __pyx_n_u_max_outgoing_inds __pyx_string_tab[310]
#define __pyx_n_u_max_outgoing_weights __pyx_string_tab[311]
#define __pyx_n_u_mode __pyx_string_tab[312]
#define __pyx_n_u_module __pyx_string_tab[313]
#define __pyx_n_u_name __pyx_string_tab[314]
#define __pyx_n_u_net __pyx_string_tab[315]
#define __pyx_n_u_net_scores __pyx_string_tab[316]
#define __pyx_n_u_net_tag __pyx_string_tab[317]
#define __pyx_n_u_network_filename __pyx_string_tab[318]
#define __pyx_n_u_neuron_maxes __pyx_string_tab[319]
#define __pyx_n_u_new __pyx_string_tab[320]
#define __pyx_n_u_new_data __pyx_string_tab[321]
#define __pyx_n_u_new_head __pyx_string_tab[322]
#define __pyx_n_u_new_head_ind __pyx_string_tab[323]
#define __pyx_n_u_new_shape __pyx_string_tab[324]
#define __pyx_n_u_next __pyx_string_tab[325]
#define __pyx_n_u_next_vertex __pyx_string_tab[326]
#define __pyx_n_u_nltkor_tag_libs_network __pyx_string_tab[327]
#define __pyx_kp_u_nltkor_tag_libs_network_pyx __pyx_string_tab[328]
#define __pyx_kp_u_nltkor_tag_libs_networkconv_pyx __pyx_string_tab[329]
#define __pyx_kp_u_nltkor_tag_libs_networkdependenc __pyx_string_tab[330]
#define __pyx_n_u_nn __pyx_string_tab[331]
#define __pyx_n_u_np __pyx_string_tab[332]
#define __pyx_n_u_num __pyx_string_tab[333]
#define __pyx_n_u_num_dims __pyx_string_tab[334]
#define __pyx_n_u_num_dist_features __pyx_string_tab[335]
#define __pyx_n_u_num_distances __pyx_string_tab[336]
#define __pyx_n_u_num_items __pyx_string_tab[337]
#define __pyx_n_u_num_sentences __pyx_string_tab[338]
#define __pyx_n_u_num_targets __pyx_string_tab[339]
#define __pyx_n_u_num_tokens __pyx_string_tab[340]
#define __pyx_n_u_num_vertices __pyx_string_tab[341]
#define __pyx_n_u_numpy __pyx_string_tab[342]
#define __pyx_kp_u_numpy_core_multiarray_failed_to __pyx_string_tab[343]
#define __pyx_kp_u_numpy_core_umath_failed_to_impor __pyx_string_tab[344]
#define __pyx_n_u_old_head __pyx_string_tab[345]
#define __pyx_n_u_only_classify __pyx_string_tab[346]
#define __pyx_n_u_other_args __pyx_string_tab[347]
#define __pyx_n_u_outgoing_weights __pyx_string_tab[348]
#define __pyx_n_u_output __pyx_string_tab[349]
#define __pyx_n_u_output_bias __pyx_string_tab[350]
#define __pyx_n_u_output_bias_deltas __pyx_string_tab[351]
#define __pyx_n_u_output_deltas __pyx_string_tab[352]
#define __pyx_n_u_output_dim __pyx_string_tab[353]
#define __pyx_n_u_output_range __pyx_string_tab[354]
#define __pyx_n_u_output_size __pyx_string_tab[355]
#define __pyx_n_u_output_weights __pyx_string_tab[356]
#define __pyx_n_u_outside __pyx_string_tab[357]
#define __pyx_n_u_outside_inds __pyx_string_tab[358]
#define __pyx_n_u_padded_sentence __pyx_string_tab[359]
#define __pyx_n_u_padding_left __pyx_string_tab[360]
#define __pyx_n_u_padding_right __pyx_string_tab[361]
#define __pyx_n_u_path_backtrack __pyx_string_tab[362]
#define __pyx_n_u_path_scores __pyx_string_tab[363]
#define __pyx_n_u_pickle __pyx_string_tab[364]
#define __pyx_n_u_pop __pyx_string_tab[365]
#define __pyx_n_u_pos_deltas __pyx_string_tab[366]
#define __pyx_n_u_pos_dist __pyx_string_tab[367]
#define __pyx_n_u_pos_padding __pyx_string_tab[368]
#define __pyx_n_u_positions __pyx_string_tab[369]
#define __pyx_n_u_pre_deltas __pyx_string_tab[370]
#define __pyx_n_u_pre_dist __pyx_string_tab[371]
#define __pyx_n_u_pre_padding __pyx_string_tab[372]
#define __pyx_n_u_pre_tagging_setup __pyx_string_tab[373]
#define __pyx_n_u_pred_answer __pyx_string_tab[374]
#define __pyx_n_u_pred_arguments __pyx_string_tab[375]
#define __pyx_n_u_pred_convolution_lookup __pyx_string_tab[376]
#define __pyx_n_u_pred_dist_deltas __pyx_string_tab[377]
#define __pyx_n_u_pred_dist_gradients __pyx_string_tab[378]
#define __pyx_n_u_pred_dist_indices __pyx_string_tab[379]
#define __pyx_n_u_pred_dist_lookup __pyx_string_tab[380]
#define __pyx_n_u_pred_dist_offset __pyx_string_tab[381]
#define __pyx_n_u_pred_dist_table __pyx_string_tab[382]
#define __pyx_n_u_pred_dist_values __pyx_string_tab[383]
#define __pyx_n_u_pred_dist_weights __pyx_string_tab[384]
#define __pyx_n_u_pred_dists __pyx_string_tab[385]
#define __pyx_n_u_pred_tags __pyx_string_tab[386]
#define __pyx_n_u_predicate __pyx_string_tab[387]
#define __pyx_n_u_predicate_answer __pyx_string_tab[388]
#define __pyx_n_u_predicate_tags __pyx_string_tab[389]
#define __pyx_n_u_predicates __pyx_string_tab[390]
#define __pyx_n_u_prev_score_and_trans __pyx_string_tab[391]
#define __pyx_n_u_previous_tag __pyx_string_tab[392]
#define __pyx_n_u_print_epoch_report __pyx_string_tab[393]
#define __pyx_n_u_pyx_PickleError __pyx_string_tab[394]
#define __pyx_n_u_pyx_checksum __pyx_string_tab[395]
#define __pyx_n_u_pyx_result __pyx_string_tab[396]
#define __pyx_n_u_pyx_state __pyx_string_tab[397]
#define __pyx_n_u_pyx_type __pyx_string_tab[398]
#define __pyx_n_u_pyx_unpickle_ConvolutionalDepe __pyx_string_tab[399]
#define __pyx_n_u_pyx_unpickle_ConvolutionalDepe_2 __pyx_string_tab[400]
#define __pyx_n_u_pyx_unpickle_ConvolutionalNetw __pyx_string_tab[401]
#define __pyx_n_u_pyx_unpickle_ConvolutionalNetw_2 __pyx_string_tab[402]
#define __pyx_n_u_pyx_unpickle_Network __pyx_string_tab[403]
#define __pyx_n_u_pyx_unpickle_Network__set_stat __pyx_string_tab[404]
#define __pyx_n_u_pyx_vtable __pyx_string_tab[405]
#define __pyx_n_u_qualname __pyx_string_tab[406]
#define __pyx_n_u_random __pyx_string_tab[407]
#define __pyx_n_u_random_state __pyx_string_tab[408]
#define __pyx_n_u_range __pyx_string_tab[409]
#define __pyx_n_u_ravel __pyx_string_tab[410]
#define __pyx_n_u_reachable __pyx_string_tab[411]
#define __pyx_n_u_reachable_vertices __pyx_string_tab[412]
#define __pyx_n_u_reduce __pyx_string_tab[413]
#define __pyx_n_u_reduce_cython __pyx_string_tab[414]
#define __pyx_n_u_reduce_ex __pyx_string_tab[415]
#define __pyx_n_u_reset_counters __pyx_string_tab[416]
#define __pyx_n_u_reshape __pyx_string_tab[417]
#define __pyx_n_u_rollaxis __pyx_string_tab[418]
#define __pyx_n_u_root __pyx_string_tab[419]
#define __pyx_n_u_save __pyx_string_tab[420]
#define __pyx_n_u_savez __pyx_string_tab[421]
#define __pyx_n_u_scores __pyx_string_tab[422]
#define __pyx_n_u_self __pyx_string_tab[423]
#define __pyx_n_u_send __pyx_string_tab[424]
#define __pyx_n_u_sent __pyx_string_tab[425]
#define __pyx_n_u_sent_args __pyx_string_tab[426]
#define __pyx_n_u_sent_preds __pyx_string_tab[427]
#define __pyx_n_u_sent_tags __pyx_string_tab[428]
#define __pyx_n_u_sentence __pyx_string_tab[429]
#define __pyx_n_u_sentence_convolution __pyx_string_tab[430]
#define __pyx_n_u_sentence_hit __pyx_string_tab[431]
#define __pyx_n_u_sentence_hits __pyx_string_tab[432]
#define __pyx_n_u_sentences __pyx_string_tab[433]
#define __pyx_n_u_set __pyx_string_tab[434]
#define __pyx_n_u_set_learning_rate_decay __pyx_string_tab[435]
#define __pyx_n_u_set_name __pyx_string_tab[436]
#define __pyx_n_u_set_state __pyx_string_tab[437]
#define __pyx_n_u_set_validation_data __pyx_string_tab[438]
#define __pyx_n_u_setstate __pyx_string_tab[439]
#define __pyx_n_u_setstate_cython __pyx_string_tab[440]
#define __pyx_n_u_shape __pyx_string_tab[441]
#define __pyx_n_u_shift __pyx_string_tab[442]
#define __pyx_n_u_shuffle __pyx_string_tab[443]
#define __pyx_n_u_shuffle_data __pyx_string_tab[444]
#define __pyx_n_u_spec __pyx_string_tab[445]
#define __pyx_n_u_sqrt __pyx_string_tab[446]
#define __pyx_n_u_start __pyx_string_tab[447]
#define __pyx_n_u_start_from __pyx_string_tab[448]
#define __pyx_n_u_state __pyx_string_tab[449]
#define __pyx_kp_u_stringsource __pyx_string_tab[450]
#define __pyx_n_u_sum __pyx_string_tab[451]
#define __pyx_n_u_sumlogadd __pyx_string_tab[452]
#define __pyx_n_u_super __pyx_string_tab[453]
#define __pyx_n_u_t __pyx_string_tab[454]
#define __pyx_n_u_table __pyx_string_tab[455]
#define __pyx_n_u_table_deltas __pyx_string_tab[456]
#define __pyx_n_u_table_dims __pyx_string_tab[457]
#define __pyx_n_u_tag __pyx_string_tab[458]
#define __pyx_n_u_tag_scores __pyx_string_tab[459]
#define __pyx_n_u_tag_sentence __pyx_string_tab[460]
#define __pyx_n_u_tag_sentence_2 __pyx_string_tab[461]
#define __pyx_n_u_tag_sentence_labeled_dependency __pyx_string_tab[462]
#define __pyx_n_u_tag_sentence_unlabeled_dependen __pyx_string_tab[463]
#define __pyx_n_u_tags __pyx_string_tab[464]
#define __pyx_n_u_take __pyx_string_tab[465]
#define __pyx_n_u_target __pyx_string_tab[466]
#define __pyx_n_u_target_convolution_lookup __pyx_string_tab[467]
#define __pyx_n_u_target_dist_deltas __pyx_string_tab[468]
#define __pyx_n_u_target_dist_gradients __pyx_string_tab[469]
#define __pyx_n_u_target_dist_indices __pyx_string_tab[470]
#define __pyx_n_u_target_dist_lookup __pyx_string_tab[471]
#define __pyx_n_u_target_dist_offset __pyx_string_tab[472]
#define __pyx_n_u_target_dist_table __pyx_string_tab[473]
#define __pyx_n_u_target_dist_values __pyx_string_tab[474]
#define __pyx_n_u_target_dist_weights __pyx_string_tab[475]
#define __pyx_n_u_target_dists __pyx_string_tab[476]
#define __pyx_n_u_test __pyx_string_tab[477]
#define __pyx_n_u_throw __pyx_string_tab[478]
#define __pyx_n_u_tile __pyx_string_tab[479]
#define __pyx_n_u_token __pyx_string_tab[480]
#define __pyx_n_u_token_indices __pyx_string_tab[481]
#define __pyx_n_u_token_scores __pyx_string_tab[482]
#define __pyx_n_u_top_accuracy __pyx_string_tab[483]
#define __pyx_n_u_train __pyx_string_tab[484]
#define __pyx_n_u_train_epoch __pyx_string_tab[485]
#define __pyx_n_u_train_locals_genexpr __pyx_string_tab[486]
#define __pyx_n_u_training __pyx_string_tab[487]
#define __pyx_n_u_trans __pyx_string_tab[488]
#define __pyx_n_u_transitions __pyx_string_tab[489]
#define __pyx_n_u_transitions_t __pyx_string_tab[490]
#define __pyx_n_u_uniform __pyx_string_tab[491]
#define __pyx_n_u_unreachable __pyx_string_tab[492]
#define __pyx_n_u_update __pyx_string_tab[493]
#define __pyx_n_u_use_setstate __pyx_string_tab[494]
#define __pyx_n_u_validate __pyx_string_tab[495]
#define __pyx_n_u_validate_locals_genexpr __pyx_string_tab[496]
#define __pyx_n_u_validation_arguments __pyx_string_tab[497]
#define __pyx_n_u_validation_predicates __pyx_string_tab[498]
#define __pyx_n_u_validation_sentences __pyx_string_tab[499]
#define __pyx_n_u_validation_tags __pyx_string_tab[500]
#define __pyx_n_u_value __pyx_string_tab[501]
#define __pyx_n_u_vertex __pyx_string_tab[502]
#define __pyx_n_u_vertex_leaving_cycle __pyx_string_tab[503]
#define __pyx_n_u_vertex_leaving_cycle_ind __pyx_string_tab[504]
#define __pyx_n_u_vertices_in_cycles __pyx_string_tab[505]
#define __pyx_n_u_visited __pyx_string_tab[506]
#define __pyx_n_u_viterbi __pyx_string_tab[507]
#define __pyx_n_u_vstack __pyx_string_tab[508]
#define __pyx_n_u_w_deltas __pyx_string_tab[509]
#define __pyx_n_u_weights __pyx_string_tab[510]
#define __pyx_n_u_where __pyx_string_tab[511]
#define __pyx_n_u_window __pyx_string_tab[512]
#define __pyx_n_u_window_from __pyx_string_tab[513]
#define __pyx_n_u_window_to __pyx_string_tab[514]
#define __pyx_n_u_word_window __pyx_string_tab[515]
#define __pyx_n_u_word_window_size __pyx_string_tab[516]
#define __pyx_n_u_x __pyx_string_tab[517]
#define __pyx_n_u_zeros __pyx_string_tab[518]
#define __pyx_n_u_zeros_like __pyx_string_tab[519]
#define __pyx_n_u_zip __pyx_string_tab[520]
/* #### Code section: module_state_clear ### */
#if CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
  __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m);
  if (!clear_module_state) return 0;
  Py_CLEAR(clear_module_state->__pyx_d);
  Py_CLEAR(clear_module_state->__pyx_b);
  Py_CLEAR(clear_module_state->__pyx_cython_runtime);
  Py_CLEAR(clear_module_state->__pyx_empty_tuple);
  Py_CLEAR(clear_module_state->__pyx_empty_bytes);
  Py_CLEAR(clear_module_state->__pyx_empty_unicode);
  #ifdef __Pyx_CyFunction_USED
  Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
  #endif
  #ifdef __Pyx_FusedFunction_USED
  Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
  #endif
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __Pyx_State_RemoveModule(NULL);
  #endif
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4bool_bool);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_7complex_complex);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc);
  Py_CLEAR(clear_module_state->__pyx_ptype_6nltkor_3tag_4libs_7network_Network);
  Py_CLEAR(clear_module_state->__pyx_type_6nltkor_3tag_4libs_7network_Network);
  Py_CLEAR(clear_module_state->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);
  Py_CLEAR(clear_module_state->__pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);
  Py_CLEAR(clear_module_state->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork);
  Py_CLEAR(clear_module_state->__pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork);
  Py_CLEAR(clear_module_state->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr);
  for (int i=0; i<5; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); }
  for (int i=0; i<15; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
  for (int i=0; i<161; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
  for (int i=0; i<521; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
  Py_CLEAR(clear_module_state->__pyx_float_0_0);
  Py_CLEAR(clear_module_state->__pyx_float_1_0);
  Py_CLEAR(clear_module_state->__pyx_float_0_01);
  Py_CLEAR(clear_module_state->__pyx_float_2_38);
  Py_CLEAR(clear_module_state->__pyx_float_neg_1_0);
  Py_CLEAR(clear_module_state->__pyx_int_0);
  Py_CLEAR(clear_module_state->__pyx_int_1);
  Py_CLEAR(clear_module_state->__pyx_int_2);
  Py_CLEAR(clear_module_state->__pyx_int_27816595);
  Py_CLEAR(clear_module_state->__pyx_int_49696698);
  Py_CLEAR(clear_module_state->__pyx_int_119830996);
  Py_CLEAR(clear_module_state->__pyx_int_145891266);
  Py_CLEAR(clear_module_state->__pyx_int_148123145);
  Py_CLEAR(clear_module_state->__pyx_int_149446146);
  Py_CLEAR(clear_module_state->__pyx_int_202246394);
  Py_CLEAR(clear_module_state->__pyx_int_212151326);
  Py_CLEAR(clear_module_state->__pyx_int_220499725);
  Py_CLEAR(clear_module_state->__pyx_int_neg_1);
  Py_CLEAR(clear_module_state->__pyx_int_neg_2);
  Py_CLEAR(clear_module_state->__pyx_int_neg_1000);
  return 0;
}
#endif
/* #### Code section: module_state_traverse ### */
#if CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
  __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m);
  if (!traverse_module_state) return 0;
  Py_VISIT(traverse_module_state->__pyx_d);
  Py_VISIT(traverse_module_state->__pyx_b);
  Py_VISIT(traverse_module_state->__pyx_cython_runtime);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode);
  #ifdef __Pyx_CyFunction_USED
  Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
  #endif
  #ifdef __Pyx_FusedFunction_USED
  Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
  #endif
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4bool_bool);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_7complex_complex);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc);
  Py_VISIT(traverse_module_state->__pyx_ptype_6nltkor_3tag_4libs_7network_Network);
  Py_VISIT(traverse_module_state->__pyx_type_6nltkor_3tag_4libs_7network_Network);
  Py_VISIT(traverse_module_state->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);
  Py_VISIT(traverse_module_state->__pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);
  Py_VISIT(traverse_module_state->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork);
  Py_VISIT(traverse_module_state->__pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork);
  Py_VISIT(traverse_module_state->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr);
  for (int i=0; i<5; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); }
  for (int i=0; i<15; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
  for (int i=0; i<161; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
  for (int i=0; i<521; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_float_0_0);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_float_1_0);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_float_0_01);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_float_2_38);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_float_neg_1_0);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_0);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_1);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_2);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_27816595);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_49696698);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_119830996);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_145891266);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_148123145);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_149446146);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_202246394);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_212151326);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_220499725);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_neg_1);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_neg_2);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_neg_1000);
  return 0;
}
#endif
/* #### Code section: module_code ### */

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":244
 *         # Instead, we use properties that map to the corresponding C-API functions.
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline PyObject* base(self) nogil:
 *             """Returns a borrowed reference to the object owning the data/memory.
*/

static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self) {
  PyObject *__pyx_r;

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":248
 *             """Returns a borrowed reference to the object owning the data/memory.
 *             """
 *             return PyArray_BASE(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyArray_BASE(__pyx_v_self);
  goto __pyx_L0;

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":244
 *         # Instead, we use properties that map to the corresponding C-API functions.
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline PyObject* base(self) nogil:
 *             """Returns a borrowed reference to the object owning the data/memory.
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":250
 *             return PyArray_BASE(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline dtype descr(self):
 *             """Returns an owned reference to the dtype of the array.
*/

static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self) {
  PyArray_Descr *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyArray_Descr *__pyx_t_1;
  __Pyx_RefNannySetupContext("descr", 0);

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":254
 *             """Returns an owned reference to the dtype of the array.
 *             """
 *             return <dtype>PyArray_DESCR(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = PyArray_DESCR(__pyx_v_self);
  __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1));
  __pyx_r = ((PyArray_Descr *)__pyx_t_1);
  goto __pyx_L0;

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":250
 *             return PyArray_BASE(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline dtype descr(self):
 *             """Returns an owned reference to the dtype of the array.
*/

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":256
 *             return <dtype>PyArray_DESCR(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int ndim(self) nogil:
 *             """Returns the number of dimensions in the array.
*/

static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self) {
  int __pyx_r;

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":260
 *             """Returns the number of dimensions in the array.
 *             """
 *             return PyArray_NDIM(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyArray_NDIM(__pyx_v_self);
  goto __pyx_L0;

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":256
 *             return <dtype>PyArray_DESCR(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int ndim(self) nogil:
 *             """Returns the number of dimensions in the array.
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":262
 *             return PyArray_NDIM(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp *shape(self) nogil:
 *             """Returns a pointer to the dimensions/shape of the array.
*/

static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self) {
  npy_intp *__pyx_r;

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":268
 *             Can return NULL for 0-dimensional arrays.
 *             """
 *             return PyArray_DIMS(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyArray_DIMS(__pyx_v_self);
  goto __pyx_L0;

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":262
 *             return PyArray_NDIM(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp *shape(self) nogil:
 *             """Returns a pointer to the dimensions/shape of the array.
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":270
 *             return PyArray_DIMS(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp *strides(self) nogil:
 *             """Returns a pointer to the strides of the array.
*/

static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self) {
  npy_intp *__pyx_r;

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":275
 *             The number of elements matches the number of dimensions of the array (ndim).
 *             """
 *             return PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyArray_STRIDES(__pyx_v_self);
  goto __pyx_L0;

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":270
 *             return PyArray_DIMS(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp *strides(self) nogil:
 *             """Returns a pointer to the strides of the array.
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":277
 *             return PyArray_STRIDES(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp size(self) nogil:
 *             """Returns the total size (in number of elements) of the array.
*/

static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self) {
  npy_intp __pyx_r;

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":281
 *             """Returns the total size (in number of elements) of the array.
 *             """
 *             return PyArray_SIZE(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyArray_SIZE(__pyx_v_self);
  goto __pyx_L0;

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":277
 *             return PyArray_STRIDES(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline npy_intp size(self) nogil:
 *             """Returns the total size (in number of elements) of the array.
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":283
 *             return PyArray_SIZE(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline char* data(self) nogil:
 *             """The pointer to the data buffer as a char*.
*/

static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self) {
  char *__pyx_r;

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":290
 *             of `PyArray_DATA()` instead, which returns a 'void*'.
 *             """
 *             return PyArray_BYTES(self)             # <<<<<<<<<<<<<<
 * 
 *     ctypedef unsigned char      npy_bool
*/
  __pyx_r = PyArray_BYTES(__pyx_v_self);
  goto __pyx_L0;

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":283
 *             return PyArray_SIZE(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline char* data(self) nogil:
 *             """The pointer to the data buffer as a char*.
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":773
 * ctypedef npy_cdouble     complex_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
*/

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":774
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":773
 * ctypedef npy_cdouble     complex_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":776
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
*/

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":777
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 777, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":776
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":779
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
*/

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":780
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":779
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":782
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
*/

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":783
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 783, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":782
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":785
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
*/

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":786
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 786, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":785
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":788
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
 *     if PyDataType_HASSUBARRAY(d):
 *         return <tuple>d.subarray.shape
*/

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":789
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
 *         return <tuple>d.subarray.shape
 *     else:
*/
  __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
  if (__pyx_t_1) {

    /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":790
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 *     if PyDataType_HASSUBARRAY(d):
 *         return <tuple>d.subarray.shape             # <<<<<<<<<<<<<<
 *     else:
 *         return ()
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
    __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
    goto __pyx_L0;

    /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":789
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
 *         return <tuple>d.subarray.shape
 *     else:
*/
  }

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":792
 *         return <tuple>d.subarray.shape
 *     else:
 *         return ()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
    __pyx_r = __pyx_mstate_global->__pyx_empty_tuple;
    goto __pyx_L0;
  }

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":788
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
 *     if PyDataType_HASSUBARRAY(d):
 *         return <tuple>d.subarray.shape
*/

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":968
 *     int _import_umath() except -1
 * 
 * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
 *     Py_INCREF(base) # important to do this before stealing the reference below!
 *     PyArray_SetBaseObject(arr, base)
*/

static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":969
 * 
 * cdef inline void set_array_base(ndarray arr, object base):
 *     Py_INCREF(base) # important to do this before stealing the reference below!             # <<<<<<<<<<<<<<
 *     PyArray_SetBaseObject(arr, base)
 * 
*/
  Py_INCREF(__pyx_v_base);

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":970
 * cdef inline void set_array_base(ndarray arr, object base):
 *     Py_INCREF(base) # important to do this before stealing the reference below!
 *     PyArray_SetBaseObject(arr, base)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object get_array_base(ndarray arr):
*/
  __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 970, __pyx_L1_error)

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":968
 *     int _import_umath() except -1
 * 
 * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
 *     Py_INCREF(base) # important to do this before stealing the reference below!
 *     PyArray_SetBaseObject(arr, base)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":972
 *     PyArray_SetBaseObject(arr, base)
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     base = PyArray_BASE(arr)
 *     if base is NULL:
*/

static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
  PyObject *__pyx_v_base;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("get_array_base", 0);

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":973
 * 
 * cdef inline object get_array_base(ndarray arr):
 *     base = PyArray_BASE(arr)             # <<<<<<<<<<<<<<
 *     if base is NULL:
 *         return None
*/
  __pyx_v_base = PyArray_BASE(__pyx_v_arr);

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":974
 * cdef inline object get_array_base(ndarray arr):
 *     base = PyArray_BASE(arr)
 *     if base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     return <object>base
*/
  __pyx_t_1 = (__pyx_v_base == NULL);
  if (__pyx_t_1) {

    /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":975
 *     base = PyArray_BASE(arr)
 *     if base is NULL:
 *         return None             # <<<<<<<<<<<<<<
 *     return <object>base
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":974
 * cdef inline object get_array_base(ndarray arr):
 *     base = PyArray_BASE(arr)
 *     if base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     return <object>base
*/
  }

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":976
 *     if base is NULL:
 *         return None
 *     return <object>base             # <<<<<<<<<<<<<<
 * 
 * # Versions of the import_* functions which are more suitable for
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_base));
  __pyx_r = ((PyObject *)__pyx_v_base);
  goto __pyx_L0;

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":972
 *     PyArray_SetBaseObject(arr, base)
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     base = PyArray_BASE(arr)
 *     if base is NULL:
*/

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":980
 * # Versions of the import_* functions which are more suitable for
 * # Cython code.
 * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         __pyx_import_array()
*/

static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  size_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("import_array", 0);

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":981
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         __pyx_import_array()
 *     except Exception:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":982
 * cdef inline int import_array() except -1:
 *     try:
 *         __pyx_import_array()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         raise ImportError("numpy.core.multiarray failed to import")
*/
      __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 982, __pyx_L3_error)

      /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":981
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         __pyx_import_array()
 *     except Exception:
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":983
 *     try:
 *         __pyx_import_array()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy.core.multiarray failed to import")
 * 
*/
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 983, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);

      /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":984
 *         __pyx_import_array()
 *     except Exception:
 *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_umath() except -1:
*/
      __pyx_t_9 = NULL;
      __Pyx_INCREF(__pyx_builtin_ImportError);
      __pyx_t_10 = __pyx_builtin_ImportError; 
      __pyx_t_11 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy_core_multiarray_failed_to};
        __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 984, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(2, 984, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":981
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         __pyx_import_array()
 *     except Exception:
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":980
 * # Versions of the import_* functions which are more suitable for
 * # Cython code.
 * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         __pyx_import_array()
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":986
 *         raise ImportError("numpy.core.multiarray failed to import")
 * 
 * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
*/

static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  size_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("import_umath", 0);

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":987
 * 
 * cdef inline int import_umath() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":988
 * cdef inline int import_umath() except -1:
 *     try:
 *         _import_umath()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")
*/
      __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 988, __pyx_L3_error)

      /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":987
 * 
 * cdef inline int import_umath() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":989
 *     try:
 *         _import_umath()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy.core.umath failed to import")
 * 
*/
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 989, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);

      /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":990
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_ufunc() except -1:
*/
      __pyx_t_9 = NULL;
      __Pyx_INCREF(__pyx_builtin_ImportError);
      __pyx_t_10 = __pyx_builtin_ImportError; 
      __pyx_t_11 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy_core_umath_failed_to_impor};
        __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 990, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(2, 990, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":987
 * 
 * cdef inline int import_umath() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":986
 *         raise ImportError("numpy.core.multiarray failed to import")
 * 
 * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":992
 *         raise ImportError("numpy.core.umath failed to import")
 * 
 * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
*/

static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  size_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("import_ufunc", 0);

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":993
 * 
 * cdef inline int import_ufunc() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":994
 * cdef inline int import_ufunc() except -1:
 *     try:
 *         _import_umath()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")
*/
      __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 994, __pyx_L3_error)

      /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":993
 * 
 * cdef inline int import_ufunc() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":995
 *     try:
 *         _import_umath()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy.core.umath failed to import")
 * 
*/
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 995, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);

      /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":996
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
 * 
 * 
*/
      __pyx_t_9 = NULL;
      __Pyx_INCREF(__pyx_builtin_ImportError);
      __pyx_t_10 = __pyx_builtin_ImportError; 
      __pyx_t_11 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy_core_umath_failed_to_impor};
        __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 996, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(2, 996, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":993
 * 
 * cdef inline int import_ufunc() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":992
 *         raise ImportError("numpy.core.umath failed to import")
 * 
 * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":999
 * 
 * 
 * cdef inline bint is_timedelta64_object(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Cython equivalent of `isinstance(obj, np.timedelta64)`
*/

static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1011
 *     bool
 *     """
 *     return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
  goto __pyx_L0;

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":999
 * 
 * 
 * cdef inline bint is_timedelta64_object(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Cython equivalent of `isinstance(obj, np.timedelta64)`
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1014
 * 
 * 
 * cdef inline bint is_datetime64_object(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Cython equivalent of `isinstance(obj, np.datetime64)`
*/

static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1026
 *     bool
 *     """
 *     return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
  goto __pyx_L0;

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1014
 * 
 * 
 * cdef inline bint is_datetime64_object(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Cython equivalent of `isinstance(obj, np.datetime64)`
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1029
 * 
 * 
 * cdef inline npy_datetime get_datetime64_value(object obj) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the int64 value underlying scalar numpy datetime64 object
*/

static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
  npy_datetime __pyx_r;

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1036
 *     also needed.  That can be found using `get_datetime64_unit`.
 *     """
 *     return (<PyDatetimeScalarObject*>obj).obval             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
  goto __pyx_L0;

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1029
 * 
 * 
 * cdef inline npy_datetime get_datetime64_value(object obj) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the int64 value underlying scalar numpy datetime64 object
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1039
 * 
 * 
 * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the int64 value underlying scalar numpy timedelta64 object
*/

static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
  npy_timedelta __pyx_r;

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1043
 *     returns the int64 value underlying scalar numpy timedelta64 object
 *     """
 *     return (<PyTimedeltaScalarObject*>obj).obval             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
  goto __pyx_L0;

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1039
 * 
 * 
 * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the int64 value underlying scalar numpy timedelta64 object
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1046
 * 
 * 
 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the unit part of the dtype for a numpy datetime64 object.
*/

static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
  NPY_DATETIMEUNIT __pyx_r;

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1050
 *     returns the unit part of the dtype for a numpy datetime64 object.
 *     """
 *     return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base             # <<<<<<<<<<<<<<
*/
  __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
  goto __pyx_L0;

  /* "../../nltkorenv/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1046
 * 
 * 
 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the unit part of the dtype for a numpy datetime64 object.
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/complex.pxd":20
 * 
 *         # unavailable in limited API
 *         @property             # <<<<<<<<<<<<<<
 *         @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 *         cdef inline double real(self) noexcept:
*/

#if !CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self) {
  double __pyx_r;

  /* "cpython/complex.pxd":23
 *         @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 *         cdef inline double real(self) noexcept:
 *             return self.cval.real             # <<<<<<<<<<<<<<
 * 
 *         # unavailable in limited API
*/
  __pyx_r = __pyx_v_self->cval.real;
  goto __pyx_L0;

  /* "cpython/complex.pxd":20
 * 
 *         # unavailable in limited API
 *         @property             # <<<<<<<<<<<<<<
 *         @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 *         cdef inline double real(self) noexcept:
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}
#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/

/* "cpython/complex.pxd":26
 * 
 *         # unavailable in limited API
 *         @property             # <<<<<<<<<<<<<<
 *         @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 *         cdef inline double imag(self) noexcept:
*/

#if !CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self) {
  double __pyx_r;

  /* "cpython/complex.pxd":29
 *         @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 *         cdef inline double imag(self) noexcept:
 *             return self.cval.imag             # <<<<<<<<<<<<<<
 * 
 *     # PyTypeObject PyComplex_Type
*/
  __pyx_r = __pyx_v_self->cval.imag;
  goto __pyx_L0;

  /* "cpython/complex.pxd":26
 * 
 *         # unavailable in limited API
 *         @property             # <<<<<<<<<<<<<<
 *         @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 *         cdef inline double imag(self) noexcept:
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}
#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/

/* "cpython/contextvars.pxd":115
 * 
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")             # <<<<<<<<<<<<<<
 * cdef inline object get_value(var, default_value=None):
 *     """Return a new reference to the value of the context variable,
*/

#if !CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value *__pyx_optional_args) {

  /* "cpython/contextvars.pxd":116
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 * cdef inline object get_value(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the default value of the context variable,
*/
  PyObject *__pyx_v_default_value = ((PyObject *)Py_None);
  PyObject *__pyx_v_value;
  PyObject *__pyx_v_pyvalue = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_value", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_default_value = __pyx_optional_args->default_value;
    }
  }

  /* "cpython/contextvars.pxd":121
 *     or None if no such value or default was found.
 *     """
 *     cdef PyObject *value = NULL             # <<<<<<<<<<<<<<
 *     PyContextVar_Get(var, NULL, &value)
 *     if value is NULL:
*/
  __pyx_v_value = NULL;

  /* "cpython/contextvars.pxd":122
 *     """
 *     cdef PyObject *value = NULL
 *     PyContextVar_Get(var, NULL, &value)             # <<<<<<<<<<<<<<
 *     if value is NULL:
 *         # context variable does not have a default
*/
  __pyx_t_1 = PyContextVar_Get(__pyx_v_var, NULL, (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 122, __pyx_L1_error)

  /* "cpython/contextvars.pxd":123
 *     cdef PyObject *value = NULL
 *     PyContextVar_Get(var, NULL, &value)
 *     if value is NULL:             # <<<<<<<<<<<<<<
 *         # context variable does not have a default
 *         pyvalue = default_value
*/
  __pyx_t_2 = (__pyx_v_value == NULL);
  if (__pyx_t_2) {

    /* "cpython/contextvars.pxd":125
 *     if value is NULL:
 *         # context variable does not have a default
 *         pyvalue = default_value             # <<<<<<<<<<<<<<
 *     else:
 *         # value or default value of context variable
*/
    __Pyx_INCREF(__pyx_v_default_value);
    __pyx_v_pyvalue = __pyx_v_default_value;

    /* "cpython/contextvars.pxd":123
 *     cdef PyObject *value = NULL
 *     PyContextVar_Get(var, NULL, &value)
 *     if value is NULL:             # <<<<<<<<<<<<<<
 *         # context variable does not have a default
 *         pyvalue = default_value
*/
    goto __pyx_L3;
  }

  /* "cpython/contextvars.pxd":128
 *     else:
 *         # value or default value of context variable
 *         pyvalue = <object>value             # <<<<<<<<<<<<<<
 *         Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'
 *     return pyvalue
*/
  /*else*/ {
    __pyx_t_3 = ((PyObject *)__pyx_v_value);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_pyvalue = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cpython/contextvars.pxd":129
 *         # value or default value of context variable
 *         pyvalue = <object>value
 *         Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'             # <<<<<<<<<<<<<<
 *     return pyvalue
 * 
*/
    Py_XDECREF(__pyx_v_value);
  }
  __pyx_L3:;

  /* "cpython/contextvars.pxd":130
 *         pyvalue = <object>value
 *         Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'
 *     return pyvalue             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_pyvalue);
  __pyx_r = __pyx_v_pyvalue;
  goto __pyx_L0;

  /* "cpython/contextvars.pxd":115
 * 
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")             # <<<<<<<<<<<<<<
 * cdef inline object get_value(var, default_value=None):
 *     """Return a new reference to the value of the context variable,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cpython.contextvars.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pyvalue);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/

/* "cpython/contextvars.pxd":133
 * 
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")             # <<<<<<<<<<<<<<
 * cdef inline object get_value_no_default(var, default_value=None):
 *     """Return a new reference to the value of the context variable,
*/

#if !CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value_no_default(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default *__pyx_optional_args) {

  /* "cpython/contextvars.pxd":134
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 * cdef inline object get_value_no_default(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the provided default value if no such value was found.
*/
  PyObject *__pyx_v_default_value = ((PyObject *)Py_None);
  PyObject *__pyx_v_value;
  PyObject *__pyx_v_pyvalue = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_value_no_default", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_default_value = __pyx_optional_args->default_value;
    }
  }

  /* "cpython/contextvars.pxd":140
 *     Ignores the default value of the context variable, if any.
 *     """
 *     cdef PyObject *value = NULL             # <<<<<<<<<<<<<<
 *     PyContextVar_Get(var, <PyObject*>default_value, &value)
 *     # value of context variable or 'default_value'
*/
  __pyx_v_value = NULL;

  /* "cpython/contextvars.pxd":141
 *     """
 *     cdef PyObject *value = NULL
 *     PyContextVar_Get(var, <PyObject*>default_value, &value)             # <<<<<<<<<<<<<<
 *     # value of context variable or 'default_value'
 *     pyvalue = <object>value
*/
  __pyx_t_1 = PyContextVar_Get(__pyx_v_var, ((PyObject *)__pyx_v_default_value), (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 141, __pyx_L1_error)

  /* "cpython/contextvars.pxd":143
 *     PyContextVar_Get(var, <PyObject*>default_value, &value)
 *     # value of context variable or 'default_value'
 *     pyvalue = <object>value             # <<<<<<<<<<<<<<
 *     Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'
 *     return pyvalue
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_value);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_v_pyvalue = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cpython/contextvars.pxd":144
 *     # value of context variable or 'default_value'
 *     pyvalue = <object>value
 *     Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'             # <<<<<<<<<<<<<<
 *     return pyvalue
*/
  Py_XDECREF(__pyx_v_value);

  /* "cpython/contextvars.pxd":145
 *     pyvalue = <object>value
 *     Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'
 *     return pyvalue             # <<<<<<<<<<<<<<
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_pyvalue);
  __pyx_r = __pyx_v_pyvalue;
  goto __pyx_L0;

  /* "cpython/contextvars.pxd":133
 * 
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")             # <<<<<<<<<<<<<<
 * cdef inline object get_value_no_default(var, default_value=None):
 *     """Return a new reference to the value of the context variable,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cpython.contextvars.get_value_no_default", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pyvalue);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/

/* "nltkor/tag/libs/network.pyx":28
 * # Math functions
 * 
 * cdef logsumexp(np.ndarray a, axis=None):             # <<<<<<<<<<<<<<
 *     """Compute the log of the sum of exponentials of input elements.
 *     like: scipy.misc.logsumexp
*/

static PyObject *__pyx_f_6nltkor_3tag_4libs_7network_logsumexp(PyArrayObject *__pyx_v_a, struct __pyx_opt_args_6nltkor_3tag_4libs_7network_logsumexp *__pyx_optional_args) {
  PyObject *__pyx_v_axis = ((PyObject *)Py_None);
  PyObject *__pyx_v_a_max = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0]))
  __Pyx_RefNannySetupContext("logsumexp", 0);
  __Pyx_TraceStartFunc("logsumexp", __pyx_f[0], 28, 0, 0, 0, __PYX_ERR(0, 28, __pyx_L1_error));
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_axis = __pyx_optional_args->axis;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_a);

  /* "nltkor/tag/libs/network.pyx":46
 *         more stable way.
 *     """
 *     if axis is None:             # <<<<<<<<<<<<<<
 *         a = a.ravel()
 *     else:
*/
  __pyx_t_1 = (__pyx_v_axis == Py_None);
  if (__pyx_t_1) {

    /* "nltkor/tag/libs/network.pyx":47
 *     """
 *     if axis is None:
 *         a = a.ravel()             # <<<<<<<<<<<<<<
 *     else:
 *         a = np.rollaxis(a, axis)
*/
    __pyx_t_3 = ((PyObject *)__pyx_v_a);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_ravel, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 47, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_a, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/network.pyx":46
 *         more stable way.
 *     """
 *     if axis is None:             # <<<<<<<<<<<<<<
 *         a = a.ravel()
 *     else:
*/
    goto __pyx_L3;
  }

  /* "nltkor/tag/libs/network.pyx":49
 *         a = a.ravel()
 *     else:
 *         a = np.rollaxis(a, axis)             # <<<<<<<<<<<<<<
 *     a_max = a.max(axis=0)
 *     return np.log(np.sum(np.exp(a - a_max), axis=0)) + a_max
*/
  /*else*/ {
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 49, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_rollaxis); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 49, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_4 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_4 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, ((PyObject *)__pyx_v_a), __pyx_v_axis};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 49, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_a, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "nltkor/tag/libs/network.pyx":50
 *     else:
 *         a = np.rollaxis(a, axis)
 *     a_max = a.max(axis=0)             # <<<<<<<<<<<<<<
 *     return np.log(np.sum(np.exp(a - a_max), axis=0)) + a_max
 * 
*/
  __pyx_t_6 = ((PyObject *)__pyx_v_a);
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_6, NULL};
    __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_axis, __pyx_mstate_global->__pyx_int_0, __pyx_t_3, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_max, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_a_max = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":51
 *         a = np.rollaxis(a, axis)
 *     a_max = a.max(axis=0)
 *     return np.log(np.sum(np.exp(a - a_max), axis=0)) + a_max             # <<<<<<<<<<<<<<
 * 
 * cdef hardtanh(np.ndarray weights, inplace=False):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_log); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_7 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_sum); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_10 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_exp); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = PyNumber_Subtract(((PyObject *)__pyx_v_a), __pyx_v_a_max); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_12))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12);
    assert(__pyx_t_10);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
    __Pyx_INCREF(__pyx_t_10);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_11};
    __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 51, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
    assert(__pyx_t_7);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_7, __pyx_t_8};
    __pyx_t_12 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 51, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_axis, __pyx_mstate_global->__pyx_int_0, __pyx_t_12, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 51, __pyx_L1_error)
    __pyx_t_6 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_9, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_12);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 51, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_v_a_max); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  __Pyx_TraceReturnValue(__pyx_r, 22, 0, __PYX_ERR(0, 51, __pyx_L1_error));
  goto __pyx_L0;

  /* "nltkor/tag/libs/network.pyx":28
 * # Math functions
 * 
 * cdef logsumexp(np.ndarray a, axis=None):             # <<<<<<<<<<<<<<
 *     """Compute the log of the sum of exponentials of input elements.
 *     like: scipy.misc.logsumexp
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 28, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.logsumexp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_a_max);
  __Pyx_XDECREF((PyObject *)__pyx_v_a);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":53
 *     return np.log(np.sum(np.exp(a - a_max), axis=0)) + a_max
 * 
 * cdef hardtanh(np.ndarray weights, inplace=False):             # <<<<<<<<<<<<<<
 *     """
 *     Hard hyperbolic tangent.
*/

static PyObject *__pyx_f_6nltkor_3tag_4libs_7network_hardtanh(PyArrayObject *__pyx_v_weights, struct __pyx_opt_args_6nltkor_3tag_4libs_7network_hardtanh *__pyx_optional_args) {
  PyObject *__pyx_v_inplace = ((PyObject *)Py_False);
  PyObject *__pyx_v_out = NULL;
  PyObject *__pyx_v_inds_greater = NULL;
  PyObject *__pyx_v_inds_lesser = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1]))
  __Pyx_RefNannySetupContext("hardtanh", 0);
  __Pyx_TraceStartFunc("hardtanh", __pyx_f[0], 53, 0, 0, 0, __PYX_ERR(0, 53, __pyx_L1_error));
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_inplace = __pyx_optional_args->inplace;
    }
  }

  /* "nltkor/tag/libs/network.pyx":58
 *     If inplace is True, modifies the input weights, which will be faster.
 *     """
 *     if inplace:             # <<<<<<<<<<<<<<
 *         out = weights
 *     else:
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_inplace); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 58, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "nltkor/tag/libs/network.pyx":59
 *     """
 *     if inplace:
 *         out = weights             # <<<<<<<<<<<<<<
 *     else:
 *         out = np.copy(weights)
*/
    __Pyx_INCREF((PyObject *)__pyx_v_weights);
    __pyx_v_out = ((PyObject *)__pyx_v_weights);

    /* "nltkor/tag/libs/network.pyx":58
 *     If inplace is True, modifies the input weights, which will be faster.
 *     """
 *     if inplace:             # <<<<<<<<<<<<<<
 *         out = weights
 *     else:
*/
    goto __pyx_L3;
  }

  /* "nltkor/tag/libs/network.pyx":61
 *         out = weights
 *     else:
 *         out = np.copy(weights)             # <<<<<<<<<<<<<<
 *     inds_greater = weights > 1
 *     inds_lesser = weights < -1
*/
  /*else*/ {
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_copy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 61, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_weights)};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_v_out = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "nltkor/tag/libs/network.pyx":62
 *     else:
 *         out = np.copy(weights)
 *     inds_greater = weights > 1             # <<<<<<<<<<<<<<
 *     inds_lesser = weights < -1
 *     out[inds_greater] = 1
*/
  __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_v_weights), __pyx_mstate_global->__pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
  __pyx_v_inds_greater = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":63
 *         out = np.copy(weights)
 *     inds_greater = weights > 1
 *     inds_lesser = weights < -1             # <<<<<<<<<<<<<<
 *     out[inds_greater] = 1
 *     out[inds_lesser] = -1
*/
  __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_v_weights), __pyx_mstate_global->__pyx_int_neg_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
  __pyx_v_inds_lesser = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":64
 *     inds_greater = weights > 1
 *     inds_lesser = weights < -1
 *     out[inds_greater] = 1             # <<<<<<<<<<<<<<
 *     out[inds_lesser] = -1
 * 
*/
  if (unlikely((PyObject_SetItem(__pyx_v_out, __pyx_v_inds_greater, __pyx_mstate_global->__pyx_int_1) < 0))) __PYX_ERR(0, 64, __pyx_L1_error)

  /* "nltkor/tag/libs/network.pyx":65
 *     inds_lesser = weights < -1
 *     out[inds_greater] = 1
 *     out[inds_lesser] = -1             # <<<<<<<<<<<<<<
 * 
 *     return out
*/
  if (unlikely((PyObject_SetItem(__pyx_v_out, __pyx_v_inds_lesser, __pyx_mstate_global->__pyx_int_neg_1) < 0))) __PYX_ERR(0, 65, __pyx_L1_error)

  /* "nltkor/tag/libs/network.pyx":67
 *     out[inds_lesser] = -1
 * 
 *     return out             # <<<<<<<<<<<<<<
 * 
 * cdef hardtanhd(np.ndarray[FLOAT_t, ndim=2] weights):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_out);
  __pyx_r = __pyx_v_out;
  __Pyx_TraceReturnValue(__pyx_r, 27, 0, __PYX_ERR(0, 67, __pyx_L1_error));
  goto __pyx_L0;

  /* "nltkor/tag/libs/network.pyx":53
 *     return np.log(np.sum(np.exp(a - a_max), axis=0)) + a_max
 * 
 * cdef hardtanh(np.ndarray weights, inplace=False):             # <<<<<<<<<<<<<<
 *     """
 *     Hard hyperbolic tangent.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 53, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.hardtanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out);
  __Pyx_XDECREF(__pyx_v_inds_greater);
  __Pyx_XDECREF(__pyx_v_inds_lesser);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":69
 *     return out
 * 
 * cdef hardtanhd(np.ndarray[FLOAT_t, ndim=2] weights):             # <<<<<<<<<<<<<<
 *     """derivative of hardtanh"""
 *     cdef np.ndarray out = np.zeros_like(weights)
*/

static PyObject *__pyx_f_6nltkor_3tag_4libs_7network_hardtanhd(PyArrayObject *__pyx_v_weights) {
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_inds = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_weights;
  __Pyx_Buffer __pyx_pybuffer_weights;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2]))
  __Pyx_RefNannySetupContext("hardtanhd", 0);
  __Pyx_TraceStartFunc("hardtanhd", __pyx_f[0], 69, 0, 0, 0, __PYX_ERR(0, 69, __pyx_L1_error));
  __pyx_pybuffer_weights.pybuffer.buf = NULL;
  __pyx_pybuffer_weights.refcount = 0;
  __pyx_pybuffernd_weights.data = NULL;
  __pyx_pybuffernd_weights.rcbuffer = &__pyx_pybuffer_weights;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_weights.rcbuffer->pybuffer, (PyObject*)__pyx_v_weights, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 69, __pyx_L1_error)
  }
  __pyx_pybuffernd_weights.diminfo[0].strides = __pyx_pybuffernd_weights.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_weights.diminfo[0].shape = __pyx_pybuffernd_weights.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_weights.diminfo[1].strides = __pyx_pybuffernd_weights.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_weights.diminfo[1].shape = __pyx_pybuffernd_weights.rcbuffer->pybuffer.shape[1];

  /* "nltkor/tag/libs/network.pyx":71
 * cdef hardtanhd(np.ndarray[FLOAT_t, ndim=2] weights):
 *     """derivative of hardtanh"""
 *     cdef np.ndarray out = np.zeros_like(weights)             # <<<<<<<<<<<<<<
 *     inds = np.logical_and(-1.0 <= weights, weights <= 1.0)
 *     out[inds] = 1.0
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_zeros_like); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_weights)};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 71, __pyx_L1_error)
  __pyx_v_out = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":72
 *     """derivative of hardtanh"""
 *     cdef np.ndarray out = np.zeros_like(weights)
 *     inds = np.logical_and(-1.0 <= weights, weights <= 1.0)             # <<<<<<<<<<<<<<
 *     out[inds] = 1.0
 * 
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_logical_and); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_mstate_global->__pyx_float_neg_1_0, ((PyObject *)__pyx_v_weights), Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error)
  __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_v_weights), __pyx_mstate_global->__pyx_float_1_0, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 72, __pyx_L1_error)
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_2, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_inds = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":73
 *     cdef np.ndarray out = np.zeros_like(weights)
 *     inds = np.logical_and(-1.0 <= weights, weights <= 1.0)
 *     out[inds] = 1.0             # <<<<<<<<<<<<<<
 * 
 *     return out
*/
  if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_out), __pyx_v_inds, __pyx_mstate_global->__pyx_float_1_0) < 0))) __PYX_ERR(0, 73, __pyx_L1_error)

  /* "nltkor/tag/libs/network.pyx":75
 *     out[inds] = 1.0
 * 
 *     return out             # <<<<<<<<<<<<<<
 * 
 * # ----------------------------------------------------------------------
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_out);
  __pyx_r = ((PyObject *)__pyx_v_out);
  __Pyx_TraceReturnValue(__pyx_r, 20, 0, __PYX_ERR(0, 75, __pyx_L1_error));
  goto __pyx_L0;

  /* "nltkor/tag/libs/network.pyx":69
 *     return out
 * 
 * cdef hardtanhd(np.ndarray[FLOAT_t, ndim=2] weights):             # <<<<<<<<<<<<<<
 *     """derivative of hardtanh"""
 *     cdef np.ndarray out = np.zeros_like(weights)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_weights.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 69, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.hardtanhd", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_weights.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XDECREF(__pyx_v_inds);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":126
 *     cdef list validation_tags
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def create_new(cls, feature_tables, int word_window, int hidden_size,
 *                  int output_size):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_1create_new(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_create_new, "Network.create_new(cls, feature_tables, int word_window, int hidden_size, int output_size)\nCreates a new neural network.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_1create_new = {"create_new", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_1create_new, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_create_new};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_1create_new(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_feature_tables = 0;
  int __pyx_v_word_window;
  int __pyx_v_hidden_size;
  int __pyx_v_output_size;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create_new (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_feature_tables,&__pyx_mstate_global->__pyx_n_u_word_window,&__pyx_mstate_global->__pyx_n_u_hidden_size,&__pyx_mstate_global->__pyx_n_u_output_size,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 126, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 126, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 126, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 126, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 126, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create_new", 0) < 0) __PYX_ERR(0, 126, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("create_new", 1, 4, 4, i); __PYX_ERR(0, 126, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 126, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 126, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 126, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 126, __pyx_L3_error)
    }
    __pyx_v_feature_tables = values[0];
    __pyx_v_word_window = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_word_window == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 127, __pyx_L3_error)
    __pyx_v_hidden_size = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_hidden_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 127, __pyx_L3_error)
    __pyx_v_output_size = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_output_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create_new", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 126, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.create_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_create_new(((PyTypeObject*)__pyx_v_cls), __pyx_v_feature_tables, __pyx_v_word_window, __pyx_v_hidden_size, __pyx_v_output_size);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6nltkor_3tag_4libs_7network_7Network_10create_new_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "nltkor/tag/libs/network.pyx":133
 *         """
 *         # sum the number of features in all tables
 *         cdef int input_size = sum(table.shape[1] for table in feature_tables)             # <<<<<<<<<<<<<<
 *         input_size *= word_window
 * 
*/

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_10create_new_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr *)__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 133, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6nltkor_3tag_4libs_7network_7Network_10create_new_2generator, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_create_new_locals_genexpr, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network); if (unlikely(!gen)) __PYX_ERR(0, 133, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.create_new.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6nltkor_3tag_4libs_7network_7Network_10create_new_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr *__pyx_cur_scope = ((struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsGen
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_TraceStartGen("genexpr", __pyx_f[0], 133, 0, 0, 0, __PYX_ERR(0, 133, __pyx_L1_error));
    __Pyx_TraceReturnValue(Py_None, 0, 0, __PYX_ERR(0, 133, __pyx_L1_error));
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  __Pyx_TraceStartGen("genexpr", __pyx_f[0], 133, 0, 0, 0, __PYX_ERR(0, 133, __pyx_L1_error));
  if (unlikely(__pyx_sent_value != Py_None)) {
    if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started generator");
    __PYX_ERR(0, 133, __pyx_L1_error)
  }
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 133, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 133, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2);
        ++__pyx_t_2;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 133, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
        #endif
        ++__pyx_t_2;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 133, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 133, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_table);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_table, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_table, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 133, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 133, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_TraceYield(__pyx_r, 0, __PYX_ERR(0, 133, __pyx_L1_error));
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __Pyx_TraceResumeGen("genexpr", __pyx_f[0], 133, 0, __PYX_ERR(0, 133, __pyx_L1_error));
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 133, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
  __Pyx_TraceReturnValue(Py_None, 0, 0, __PYX_ERR(0, 133, __pyx_L1_error));

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_TraceException(__pyx_lineno, 0, 0);
    __Pyx_Generator_Replace_StopIteration(0);
    __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_TraceExceptionUnwind(0, 0);
  }
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":126
 *     cdef list validation_tags
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def create_new(cls, feature_tables, int word_window, int hidden_size,
 *                  int output_size):
*/

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_create_new(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_feature_tables, int __pyx_v_word_window, int __pyx_v_hidden_size, int __pyx_v_output_size) {
  int __pyx_v_input_size;
  PyObject *__pyx_v_high = NULL;
  PyObject *__pyx_v_hidden_weights = NULL;
  PyObject *__pyx_v_hidden_bias = NULL;
  PyObject *__pyx_v_output_weights = NULL;
  PyObject *__pyx_v_output_bias = NULL;
  PyObject *__pyx_v_transitions = NULL;
  struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_net = NULL;
  PyObject *__pyx_gb_6nltkor_3tag_4libs_7network_7Network_10create_new_2generator = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4]))
  __Pyx_RefNannySetupContext("create_new", 0);
  __Pyx_TraceStartFunc("create_new", __pyx_f[0], 126, 0, 0, 0, __PYX_ERR(0, 126, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":133
 *         """
 *         # sum the number of features in all tables
 *         cdef int input_size = sum(table.shape[1] for table in feature_tables)             # <<<<<<<<<<<<<<
 *         input_size *= word_window
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_builtin_sum);
  __pyx_t_3 = __pyx_builtin_sum; 
  __pyx_t_4 = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_10create_new_genexpr(NULL, __pyx_v_feature_tables); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_6 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_input_size = __pyx_t_6;

  /* "nltkor/tag/libs/network.pyx":134
 *         # sum the number of features in all tables
 *         cdef int input_size = sum(table.shape[1] for table in feature_tables)
 *         input_size *= word_window             # <<<<<<<<<<<<<<
 * 
 *         # creates the weight matrices
*/
  __pyx_v_input_size = (__pyx_v_input_size * __pyx_v_word_window);

  /* "nltkor/tag/libs/network.pyx":145
 *         # interval = 3.46 / fanin ^ 1/4
 *         #high = 1.732 / np.power(input_size, 0.25) # SENNA: 0.416
 *         high = 2.38 / np.sqrt(input_size) # [Bottou-88]             # <<<<<<<<<<<<<<
 *         #high = 0.1              # Fonseca
 *         hidden_weights = np.random.uniform(-high, high, (hidden_size, input_size))
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sqrt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_input_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_2 = __Pyx_PyFloat_TrueDivideCObj(__pyx_mstate_global->__pyx_float_2_38, __pyx_t_1, 2.38, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_high = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":147
 *         high = 2.38 / np.sqrt(input_size) # [Bottou-88]
 *         #high = 0.1              # Fonseca
 *         hidden_weights = np.random.uniform(-high, high, (hidden_size, input_size))             # <<<<<<<<<<<<<<
 *         hidden_bias = np.random.uniform(-high, high, (hidden_size))
 *         #high = 1.732 / np.power(hidden_size, 0.25) # SENNA
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_4 = PyNumber_Negative(__pyx_v_high); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_hidden_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_input_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 147, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 147, __pyx_L1_error);
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_t_4, __pyx_v_high, __pyx_t_9};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_uniform, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_hidden_weights = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":148
 *         #high = 0.1              # Fonseca
 *         hidden_weights = np.random.uniform(-high, high, (hidden_size, input_size))
 *         hidden_bias = np.random.uniform(-high, high, (hidden_size))             # <<<<<<<<<<<<<<
 *         #high = 1.732 / np.power(hidden_size, 0.25) # SENNA
 *         high = 2.38 / np.sqrt(hidden_size) # [Bottou-88]
*/
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_3 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_9 = PyNumber_Negative(__pyx_v_high); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_hidden_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_t_9, __pyx_v_high, __pyx_t_1};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_uniform, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_hidden_bias = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":150
 *         hidden_bias = np.random.uniform(-high, high, (hidden_size))
 *         #high = 1.732 / np.power(hidden_size, 0.25) # SENNA
 *         high = 2.38 / np.sqrt(hidden_size) # [Bottou-88]             # <<<<<<<<<<<<<<
 *         #high = 0.1              # Fonseca
 *         output_weights = np.random.uniform(-high, high, (output_size, hidden_size))
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_sqrt); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_hidden_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_9);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_1};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_9 = __Pyx_PyFloat_TrueDivideCObj(__pyx_mstate_global->__pyx_float_2_38, __pyx_t_2, 2.38, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_high, __pyx_t_9);
  __pyx_t_9 = 0;

  /* "nltkor/tag/libs/network.pyx":152
 *         high = 2.38 / np.sqrt(hidden_size) # [Bottou-88]
 *         #high = 0.1              # Fonseca
 *         output_weights = np.random.uniform(-high, high, (output_size, hidden_size))             # <<<<<<<<<<<<<<
 *         output_bias = np.random.uniform(-high, high, (output_size))
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Negative(__pyx_v_high); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_output_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_hidden_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 152, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 152, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_8 = 0;
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_t_1, __pyx_v_high, __pyx_t_7};
    __pyx_t_9 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_uniform, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
  }
  __pyx_v_output_weights = __pyx_t_9;
  __pyx_t_9 = 0;

  /* "nltkor/tag/libs/network.pyx":153
 *         #high = 0.1              # Fonseca
 *         output_weights = np.random.uniform(-high, high, (output_size, hidden_size))
 *         output_bias = np.random.uniform(-high, high, (output_size))             # <<<<<<<<<<<<<<
 * 
 *         high = 1.0
*/
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_4 = __pyx_t_1;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_7 = PyNumber_Negative(__pyx_v_high); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_output_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_t_7, __pyx_v_high, __pyx_t_2};
    __pyx_t_9 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_uniform, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
  }
  __pyx_v_output_bias = __pyx_t_9;
  __pyx_t_9 = 0;

  /* "nltkor/tag/libs/network.pyx":155
 *         output_bias = np.random.uniform(-high, high, (output_size))
 * 
 *         high = 1.0             # <<<<<<<<<<<<<<
 *         # +1 is due for the initial transition
 *         transitions = np.random.uniform(-high, high, (output_size + 1, output_size))
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_float_1_0);
  __Pyx_DECREF_SET(__pyx_v_high, __pyx_mstate_global->__pyx_float_1_0);

  /* "nltkor/tag/libs/network.pyx":157
 *         high = 1.0
 *         # +1 is due for the initial transition
 *         transitions = np.random.uniform(-high, high, (output_size + 1, output_size))             # <<<<<<<<<<<<<<
 * 
 *         net = Network(word_window, input_size, hidden_size, output_size,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __pyx_t_7;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Negative(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyLong_From_long((__pyx_v_output_size + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_output_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 157, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 157, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_8 = 0;
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_t_2, __pyx_v_high, __pyx_t_3};
    __pyx_t_9 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_uniform, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 157, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
  }
  __pyx_v_transitions = __pyx_t_9;
  __pyx_t_9 = 0;

  /* "nltkor/tag/libs/network.pyx":159
 *         transitions = np.random.uniform(-high, high, (output_size + 1, output_size))
 * 
 *         net = Network(word_window, input_size, hidden_size, output_size,             # <<<<<<<<<<<<<<
 *                       hidden_weights, hidden_bias, output_weights, output_bias,
 *                       transitions)
*/
  __pyx_t_7 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network);
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network); 
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_word_window); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_input_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_hidden_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_output_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "nltkor/tag/libs/network.pyx":161
 *         net = Network(word_window, input_size, hidden_size, output_size,
 *                       hidden_weights, hidden_bias, output_weights, output_bias,
 *                       transitions)             # <<<<<<<<<<<<<<
 *         net.feature_tables = feature_tables
 * 
*/
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[10] = {__pyx_t_7, __pyx_t_2, __pyx_t_1, __pyx_t_8, __pyx_t_4, __pyx_v_hidden_weights, __pyx_v_hidden_bias, __pyx_v_output_weights, __pyx_v_output_bias, __pyx_v_transitions};
    __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (10-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 159, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_9);
  }
  __pyx_v_net = ((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "nltkor/tag/libs/network.pyx":162
 *                       hidden_weights, hidden_bias, output_weights, output_bias,
 *                       transitions)
 *         net.feature_tables = feature_tables             # <<<<<<<<<<<<<<
 * 
 *         return net
*/
  __pyx_t_9 = __pyx_v_feature_tables;
  __Pyx_INCREF(__pyx_t_9);
  if (!(likely(PyList_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_9))) __PYX_ERR(0, 162, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_9);
  __Pyx_GOTREF(__pyx_v_net->feature_tables);
  __Pyx_DECREF(__pyx_v_net->feature_tables);
  __pyx_v_net->feature_tables = ((PyObject*)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "nltkor/tag/libs/network.pyx":164
 *         net.feature_tables = feature_tables
 * 
 *         return net             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, word_window, input_size, hidden_size, output_size,
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_net);
  __pyx_r = ((PyObject *)__pyx_v_net);
  __Pyx_TraceReturnValue(__pyx_r, 88, 0, __PYX_ERR(0, 164, __pyx_L1_error));
  goto __pyx_L0;

  /* "nltkor/tag/libs/network.pyx":126
 *     cdef list validation_tags
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def create_new(cls, feature_tables, int word_window, int hidden_size,
 *                  int output_size):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 126, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.create_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_high);
  __Pyx_XDECREF(__pyx_v_hidden_weights);
  __Pyx_XDECREF(__pyx_v_hidden_bias);
  __Pyx_XDECREF(__pyx_v_output_weights);
  __Pyx_XDECREF(__pyx_v_output_bias);
  __Pyx_XDECREF(__pyx_v_transitions);
  __Pyx_XDECREF((PyObject *)__pyx_v_net);
  __Pyx_XDECREF(__pyx_gb_6nltkor_3tag_4libs_7network_7Network_10create_new_2generator);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":166
 *         return net
 * 
 *     def __init__(self, word_window, input_size, hidden_size, output_size,             # <<<<<<<<<<<<<<
 *                  hidden_weights, hidden_bias, output_weights, output_bias,
 *                  transitions=None):
*/

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_2__init__, "\n        This function isn't expected to be directly called.\n        Instead, use the classmethods load_from_file or \n        create_new.\n        \n        :param transitions: transition weights. If None uses\n            Window Level Likelihood instead of Sentence Level Likelihood.\n        ");
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_6nltkor_3tag_4libs_7network_7Network_2__init__;
#endif
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_word_window = 0;
  PyObject *__pyx_v_input_size = 0;
  PyObject *__pyx_v_hidden_size = 0;
  PyObject *__pyx_v_output_size = 0;
  PyObject *__pyx_v_hidden_weights = 0;
  PyObject *__pyx_v_hidden_bias = 0;
  PyObject *__pyx_v_output_weights = 0;
  PyObject *__pyx_v_output_bias = 0;
  PyObject *__pyx_v_transitions = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_word_window,&__pyx_mstate_global->__pyx_n_u_input_size,&__pyx_mstate_global->__pyx_n_u_hidden_size,&__pyx_mstate_global->__pyx_n_u_output_size,&__pyx_mstate_global->__pyx_n_u_hidden_weights,&__pyx_mstate_global->__pyx_n_u_hidden_bias,&__pyx_mstate_global->__pyx_n_u_output_weights,&__pyx_mstate_global->__pyx_n_u_output_bias,&__pyx_mstate_global->__pyx_n_u_transitions,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 166, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_VARARGS(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 166, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_VARARGS(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 166, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_VARARGS(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 166, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 166, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 166, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 166, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 166, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 166, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 166, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 166, __pyx_L3_error)

      /* "nltkor/tag/libs/network.pyx":168
 *     def __init__(self, word_window, input_size, hidden_size, output_size,
 *                  hidden_weights, hidden_bias, output_weights, output_bias,
 *                  transitions=None):             # <<<<<<<<<<<<<<
 *         """
 *         This function isn't expected to be directly called.
*/
      if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 9, i); __PYX_ERR(0, 166, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_VARARGS(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 166, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_VARARGS(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 166, __pyx_L3_error)
        values[6] = __Pyx_ArgRef_VARARGS(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 166, __pyx_L3_error)
        values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 166, __pyx_L3_error)
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 166, __pyx_L3_error)
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 166, __pyx_L3_error)
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 166, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 166, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 166, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_word_window = values[0];
    __pyx_v_input_size = values[1];
    __pyx_v_hidden_size = values[2];
    __pyx_v_output_size = values[3];
    __pyx_v_hidden_weights = values[4];
    __pyx_v_hidden_bias = values[5];
    __pyx_v_output_weights = values[6];
    __pyx_v_output_bias = values[7];
    __pyx_v_transitions = values[8];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 9, __pyx_nargs); __PYX_ERR(0, 166, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_2__init__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), __pyx_v_word_window, __pyx_v_input_size, __pyx_v_hidden_size, __pyx_v_output_size, __pyx_v_hidden_weights, __pyx_v_hidden_bias, __pyx_v_output_weights, __pyx_v_output_bias, __pyx_v_transitions);

  /* "nltkor/tag/libs/network.pyx":166
 *         return net
 * 
 *     def __init__(self, word_window, input_size, hidden_size, output_size,             # <<<<<<<<<<<<<<
 *                  hidden_weights, hidden_bias, output_weights, output_bias,
 *                  transitions=None):
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_2__init__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_word_window, PyObject *__pyx_v_input_size, PyObject *__pyx_v_hidden_size, PyObject *__pyx_v_output_size, PyObject *__pyx_v_hidden_weights, PyObject *__pyx_v_hidden_bias, PyObject *__pyx_v_output_weights, PyObject *__pyx_v_output_bias, PyObject *__pyx_v_transitions) {
  int __pyx_r;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5]))
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_TraceStartFunc("__init__", __pyx_f[0], 166, 0, 0, 0, __PYX_ERR(0, 166, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":177
 *             Window Level Likelihood instead of Sentence Level Likelihood.
 *         """
 *         self.learning_rate = 0             # <<<<<<<<<<<<<<
 *         self.learning_rate_features = 0
 * 
*/
  __pyx_v_self->learning_rate = 0.0;

  /* "nltkor/tag/libs/network.pyx":178
 *         """
 *         self.learning_rate = 0
 *         self.learning_rate_features = 0             # <<<<<<<<<<<<<<
 * 
 *         self.word_window_size = word_window
*/
  __pyx_v_self->learning_rate_features = 0.0;

  /* "nltkor/tag/libs/network.pyx":180
 *         self.learning_rate_features = 0
 * 
 *         self.word_window_size = word_window             # <<<<<<<<<<<<<<
 *         self.input_size = input_size
 *         self.hidden_size = hidden_size
*/
  __pyx_t_1 = __Pyx_PyLong_As_int(__pyx_v_word_window); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L1_error)
  __pyx_v_self->word_window_size = __pyx_t_1;

  /* "nltkor/tag/libs/network.pyx":181
 * 
 *         self.word_window_size = word_window
 *         self.input_size = input_size             # <<<<<<<<<<<<<<
 *         self.hidden_size = hidden_size
 *         self.output_size = output_size
*/
  __pyx_t_1 = __Pyx_PyLong_As_int(__pyx_v_input_size); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L1_error)
  __pyx_v_self->input_size = __pyx_t_1;

  /* "nltkor/tag/libs/network.pyx":182
 *         self.word_window_size = word_window
 *         self.input_size = input_size
 *         self.hidden_size = hidden_size             # <<<<<<<<<<<<<<
 *         self.output_size = output_size
 *         self.features_per_token = input_size / word_window
*/
  __pyx_t_1 = __Pyx_PyLong_As_int(__pyx_v_hidden_size); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L1_error)
  __pyx_v_self->hidden_size = __pyx_t_1;

  /* "nltkor/tag/libs/network.pyx":183
 *         self.input_size = input_size
 *         self.hidden_size = hidden_size
 *         self.output_size = output_size             # <<<<<<<<<<<<<<
 *         self.features_per_token = input_size / word_window
 * 
*/
  __pyx_t_1 = __Pyx_PyLong_As_int(__pyx_v_output_size); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L1_error)
  __pyx_v_self->output_size = __pyx_t_1;

  /* "nltkor/tag/libs/network.pyx":184
 *         self.hidden_size = hidden_size
 *         self.output_size = output_size
 *         self.features_per_token = input_size / word_window             # <<<<<<<<<<<<<<
 * 
 *         # A_i_j score for jumping from tag i to j
*/
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_input_size, __pyx_v_word_window); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_self->features_per_token = __pyx_t_1;

  /* "nltkor/tag/libs/network.pyx":188
 *         # A_i_j score for jumping from tag i to j
 *         # A_0_i = transitions[-1]
 *         self.transitions = transitions             # <<<<<<<<<<<<<<
 * 
 *         self.hidden_weights = hidden_weights
*/
  __pyx_t_2 = __pyx_v_transitions;
  __Pyx_INCREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 188, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->transitions);
  __Pyx_DECREF((PyObject *)__pyx_v_self->transitions);
  __pyx_v_self->transitions = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":190
 *         self.transitions = transitions
 * 
 *         self.hidden_weights = hidden_weights             # <<<<<<<<<<<<<<
 *         self.hidden_bias = hidden_bias
 *         self.output_weights = output_weights
*/
  __pyx_t_2 = __pyx_v_hidden_weights;
  __Pyx_INCREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 190, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden_weights);
  __Pyx_DECREF((PyObject *)__pyx_v_self->hidden_weights);
  __pyx_v_self->hidden_weights = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":191
 * 
 *         self.hidden_weights = hidden_weights
 *         self.hidden_bias = hidden_bias             # <<<<<<<<<<<<<<
 *         self.output_weights = output_weights
 *         self.output_bias = output_bias
*/
  __pyx_t_2 = __pyx_v_hidden_bias;
  __Pyx_INCREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 191, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden_bias);
  __Pyx_DECREF((PyObject *)__pyx_v_self->hidden_bias);
  __pyx_v_self->hidden_bias = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":192
 *         self.hidden_weights = hidden_weights
 *         self.hidden_bias = hidden_bias
 *         self.output_weights = output_weights             # <<<<<<<<<<<<<<
 *         self.output_bias = output_bias
 * 
*/
  __pyx_t_2 = __pyx_v_output_weights;
  __Pyx_INCREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->output_weights);
  __Pyx_DECREF((PyObject *)__pyx_v_self->output_weights);
  __pyx_v_self->output_weights = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":193
 *         self.hidden_bias = hidden_bias
 *         self.output_weights = output_weights
 *         self.output_bias = output_bias             # <<<<<<<<<<<<<<
 * 
 *         self.validation_sentences = None
*/
  __pyx_t_2 = __pyx_v_output_bias;
  __Pyx_INCREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 193, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->output_bias);
  __Pyx_DECREF((PyObject *)__pyx_v_self->output_bias);
  __pyx_v_self->output_bias = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":195
 *         self.output_bias = output_bias
 * 
 *         self.validation_sentences = None             # <<<<<<<<<<<<<<
 *         self.validation_tags = None
 * 
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->validation_sentences);
  __Pyx_DECREF(__pyx_v_self->validation_sentences);
  __pyx_v_self->validation_sentences = ((PyObject*)Py_None);

  /* "nltkor/tag/libs/network.pyx":196
 * 
 *         self.validation_sentences = None
 *         self.validation_tags = None             # <<<<<<<<<<<<<<
 * 
 *         self.use_learning_rate_decay = False
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->validation_tags);
  __Pyx_DECREF(__pyx_v_self->validation_tags);
  __pyx_v_self->validation_tags = ((PyObject*)Py_None);

  /* "nltkor/tag/libs/network.pyx":198
 *         self.validation_tags = None
 * 
 *         self.use_learning_rate_decay = False             # <<<<<<<<<<<<<<
 * 
 *     def description(self):
*/
  __Pyx_INCREF(Py_False);
  __Pyx_GIVEREF(Py_False);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->use_learning_rate_decay);
  __Pyx_DECREF((PyObject *)__pyx_v_self->use_learning_rate_decay);
  __pyx_v_self->use_learning_rate_decay = ((PyLongObject *)Py_False);

  /* "nltkor/tag/libs/network.pyx":166
 *         return net
 * 
 *     def __init__(self, word_window, input_size, hidden_size, output_size,             # <<<<<<<<<<<<<<
 *                  hidden_weights, hidden_bias, output_weights, output_bias,
 *                  transitions=None):
*/

  /* function exit code */
  __pyx_r = 0;
  __Pyx_TraceReturnCValue(__pyx_r, __Pyx_Owned_Py_None, 0, 0, __PYX_ERR(0, 166, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 166, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":200
 *         self.use_learning_rate_decay = False
 * 
 *     def description(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a textual description of the network.
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_5description(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_4description, "Network.description(self)\nReturns a textual description of the network.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_5description = {"description", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_5description, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_4description};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_5description(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("description (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("description", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("description", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_4description(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_4description(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_v_table_dims = NULL;
  PyObject *__pyx_v_desc = NULL;
  PyObject *__pyx_8genexpr1__pyx_v_t = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7[11];
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6]))
  __Pyx_RefNannySetupContext("description", 0);
  __Pyx_TraceStartFunc("description", __pyx_f[0], 200, 0, 0, 0, __PYX_ERR(0, 200, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":204
 *         Returns a textual description of the network.
 *         """
 *         table_dims = [str(t.shape[1]) for t in self.feature_tables]             # <<<<<<<<<<<<<<
 *         table_dims =  ', '.join(table_dims)
 * 
*/
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(__pyx_v_self->feature_tables == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 204, __pyx_L5_error)
    }
    __pyx_t_2 = __pyx_v_self->feature_tables; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 204, __pyx_L5_error)
        #endif
        if (__pyx_t_3 >= __pyx_temp) break;
      }
      __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3);
      ++__pyx_t_3;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_t, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr1__pyx_v_t, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_Unicode(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 204, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_t); __pyx_8genexpr1__pyx_v_t = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_t); __pyx_8genexpr1__pyx_v_t = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_v_table_dims = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":205
 *         """
 *         table_dims = [str(t.shape[1]) for t in self.feature_tables]
 *         table_dims =  ', '.join(table_dims)             # <<<<<<<<<<<<<<
 * 
 *         desc = """
*/
  __pyx_t_1 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u_, __pyx_v_table_dims); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_table_dims, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":213
 * Hidden layer size: %d
 * Output size: %d
 * """ % (self.word_window_size, table_dims, self.input_size, self.hidden_size, self.output_size)             # <<<<<<<<<<<<<<
 * 
 *         return desc
*/
  __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_v_self->word_window_size, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_table_dims), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_v_self->input_size, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_v_self->hidden_size, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyUnicode_From_int(__pyx_v_self->output_size, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_Word_window_size;
  __pyx_t_7[1] = __pyx_t_1;
  __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u_Feature_table_sizes;
  __pyx_t_7[3] = __pyx_t_2;
  __pyx_t_7[4] = __pyx_mstate_global->__pyx_kp_u_Input_layer_size;
  __pyx_t_7[5] = __pyx_t_4;
  __pyx_t_7[6] = __pyx_mstate_global->__pyx_kp_u_Hidden_layer_size;
  __pyx_t_7[7] = __pyx_t_5;
  __pyx_t_7[8] = __pyx_mstate_global->__pyx_kp_u_Output_size;
  __pyx_t_7[9] = __pyx_t_6;
  __pyx_t_7[10] = __pyx_mstate_global->__pyx_kp_u__2;

  /* "nltkor/tag/libs/network.pyx":207
 *         table_dims =  ', '.join(table_dims)
 * 
 *         desc = """             # <<<<<<<<<<<<<<
 * Word window size: %d
 * Feature table sizes: %s
*/
  __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_7, 11, 19 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 22 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 20 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 14 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2));
  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_desc = ((PyObject*)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "nltkor/tag/libs/network.pyx":215
 * """ % (self.word_window_size, table_dims, self.input_size, self.hidden_size, self.output_size)
 * 
 *         return desc             # <<<<<<<<<<<<<<
 * 
 *     def _create_sentence_lookup(self, np.ndarray sentence):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_desc);
  __pyx_r = __pyx_v_desc;
  __Pyx_TraceReturnValue(__pyx_r, 30, 0, __PYX_ERR(0, 215, __pyx_L1_error));
  goto __pyx_L0;

  /* "nltkor/tag/libs/network.pyx":200
 *         self.use_learning_rate_decay = False
 * 
 *     def description(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a textual description of the network.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 200, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.description", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_table_dims);
  __Pyx_XDECREF(__pyx_v_desc);
  __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_t);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":217
 *         return desc
 * 
 *     def _create_sentence_lookup(self, np.ndarray sentence):             # <<<<<<<<<<<<<<
 *         """
 *         Create a lookup matrix with the embeddings values for all tokens in a sentence.
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_7_create_sentence_lookup(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_6_create_sentence_lookup, "Network._create_sentence_lookup(self, ndarray sentence)\nCreate a lookup matrix with the embeddings values for all tokens in a sentence.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_7_create_sentence_lookup = {"_create_sentence_lookup", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_7_create_sentence_lookup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_6_create_sentence_lookup};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_7_create_sentence_lookup(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyArrayObject *__pyx_v_sentence = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_create_sentence_lookup (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sentence,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 217, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 217, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_create_sentence_lookup", 0) < 0) __PYX_ERR(0, 217, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_create_sentence_lookup", 1, 1, 1, i); __PYX_ERR(0, 217, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 217, __pyx_L3_error)
    }
    __pyx_v_sentence = ((PyArrayObject *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_create_sentence_lookup", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 217, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._create_sentence_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sentence), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "sentence", 0))) __PYX_ERR(0, 217, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_6_create_sentence_lookup(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), __pyx_v_sentence);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_6_create_sentence_lookup(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyArrayObject *__pyx_v_sentence) {
  PyArrayObject *__pyx_v_padded_sentence = 0;
  PyObject *__pyx_v_ind_from = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_table = NULL;
  PyObject *__pyx_v_num_dims = NULL;
  PyObject *__pyx_v_ind_to = NULL;
  PyObject *__pyx_v_token_indices = NULL;
  PyObject *__pyx_v_embeddings = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7]))
  __Pyx_RefNannySetupContext("_create_sentence_lookup", 0);
  __Pyx_TraceStartFunc("_create_sentence_lookup", __pyx_f[0], 217, 0, 0, 0, __PYX_ERR(0, 217, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":222
 *         """
 *         #print (sentence)
 *         cdef np.ndarray padded_sentence = np.concatenate((self.pre_padding,             # <<<<<<<<<<<<<<
 *                                                           sentence,
 *                                                           self.pos_padding))
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_concatenate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":224
 *         cdef np.ndarray padded_sentence = np.concatenate((self.pre_padding,
 *                                                           sentence,
 *                                                           self.pos_padding))             # <<<<<<<<<<<<<<
 * 
 *         # make sure it works on 32 bit python installations
*/
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pre_padding);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->pre_padding);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self->pre_padding)) != (0)) __PYX_ERR(0, 222, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_sentence);
  __Pyx_GIVEREF((PyObject *)__pyx_v_sentence);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_sentence)) != (0)) __PYX_ERR(0, 222, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pos_padding);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->pos_padding);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_self->pos_padding)) != (0)) __PYX_ERR(0, 222, __pyx_L1_error);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }

  /* "nltkor/tag/libs/network.pyx":222
 *         """
 *         #print (sentence)
 *         cdef np.ndarray padded_sentence = np.concatenate((self.pre_padding,             # <<<<<<<<<<<<<<
 *                                                           sentence,
 *                                                           self.pos_padding))
*/
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 222, __pyx_L1_error)
  __pyx_v_padded_sentence = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":227
 * 
 *         # make sure it works on 32 bit python installations
 *         padded_sentence = padded_sentence.astype(int)             # <<<<<<<<<<<<<<
 *         #padded_sentence = padded_sentence.astype(np.int64)
 * 
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_padded_sentence);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)(&PyLong_Type))};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_astype, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 227, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_padded_sentence, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":230
 *         #padded_sentence = padded_sentence.astype(np.int64)
 * 
 *         self.sentence_lookup = np.empty((len(padded_sentence), self.features_per_token))             # <<<<<<<<<<<<<<
 *         ind_from = 0
 * 
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = PyObject_Length(((PyObject *)__pyx_v_padded_sentence)); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 230, __pyx_L1_error)
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_self->features_per_token); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 230, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 230, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_7 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_8};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 230, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->sentence_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v_self->sentence_lookup);
  __pyx_v_self->sentence_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":231
 * 
 *         self.sentence_lookup = np.empty((len(padded_sentence), self.features_per_token))
 *         ind_from = 0             # <<<<<<<<<<<<<<
 * 
 *         for i, table in enumerate(self.feature_tables):
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_v_ind_from = __pyx_mstate_global->__pyx_int_0;

  /* "nltkor/tag/libs/network.pyx":233
 *         ind_from = 0
 * 
 *         for i, table in enumerate(self.feature_tables):             # <<<<<<<<<<<<<<
 *             num_dims = table.shape[1]
 *             ind_to = ind_from + num_dims
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_t_1 = __pyx_mstate_global->__pyx_int_0;
  __pyx_t_2 = __pyx_v_self->feature_tables; __Pyx_INCREF(__pyx_t_2);
  __pyx_t_6 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 233, __pyx_L1_error)
      #endif
      if (__pyx_t_6 >= __pyx_temp) break;
    }
    __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_6);
    ++__pyx_t_6;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_XDECREF_SET(__pyx_v_table, __pyx_t_8);
    __pyx_t_8 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_8 = __Pyx_PyLong_AddObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "nltkor/tag/libs/network.pyx":234
 * 
 *         for i, table in enumerate(self.feature_tables):
 *             num_dims = table.shape[1]             # <<<<<<<<<<<<<<
 *             ind_to = ind_from + num_dims
 * 
*/
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_table, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_8, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF_SET(__pyx_v_num_dims, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/network.pyx":235
 *         for i, table in enumerate(self.feature_tables):
 *             num_dims = table.shape[1]
 *             ind_to = ind_from + num_dims             # <<<<<<<<<<<<<<
 * 
 *             token_indices = padded_sentence[:, i]
*/
    __pyx_t_4 = PyNumber_Add(__pyx_v_ind_from, __pyx_v_num_dims); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_ind_to, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/network.pyx":237
 *             ind_to = ind_from + num_dims
 * 
 *             token_indices = padded_sentence[:, i]             # <<<<<<<<<<<<<<
 *             embeddings = table.take(token_indices, axis=0)
 *             self.sentence_lookup[:, ind_from:ind_to] = embeddings
*/
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 237, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_i);
    __Pyx_GIVEREF(__pyx_v_i);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_i) != (0)) __PYX_ERR(0, 237, __pyx_L1_error);
    __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_padded_sentence), __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_token_indices, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "nltkor/tag/libs/network.pyx":238
 * 
 *             token_indices = padded_sentence[:, i]
 *             embeddings = table.take(token_indices, axis=0)             # <<<<<<<<<<<<<<
 *             self.sentence_lookup[:, ind_from:ind_to] = embeddings
 * 
*/
    __pyx_t_4 = __pyx_v_table;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_v_token_indices};
      __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_axis, __pyx_mstate_global->__pyx_int_0, __pyx_t_7, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 238, __pyx_L1_error)
      __pyx_t_8 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_take, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
    }
    __Pyx_XDECREF_SET(__pyx_v_embeddings, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "nltkor/tag/libs/network.pyx":239
 *             token_indices = padded_sentence[:, i]
 *             embeddings = table.take(token_indices, axis=0)
 *             self.sentence_lookup[:, ind_from:ind_to] = embeddings             # <<<<<<<<<<<<<<
 * 
 *             ind_from = ind_to
*/
    __pyx_t_8 = PySlice_New(__pyx_v_ind_from, __pyx_v_ind_to, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 239, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 239, __pyx_L1_error);
    __pyx_t_8 = 0;
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->sentence_lookup), __pyx_t_7, __pyx_v_embeddings) < 0))) __PYX_ERR(0, 239, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "nltkor/tag/libs/network.pyx":241
 *             self.sentence_lookup[:, ind_from:ind_to] = embeddings
 * 
 *             ind_from = ind_to             # <<<<<<<<<<<<<<
 * 
 *     property padding_left:
*/
    __Pyx_INCREF(__pyx_v_ind_to);
    __Pyx_DECREF_SET(__pyx_v_ind_from, __pyx_v_ind_to);

    /* "nltkor/tag/libs/network.pyx":233
 *         ind_from = 0
 * 
 *         for i, table in enumerate(self.feature_tables):             # <<<<<<<<<<<<<<
 *             num_dims = table.shape[1]
 *             ind_to = ind_from + num_dims
*/
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":217
 *         return desc
 * 
 *     def _create_sentence_lookup(self, np.ndarray sentence):             # <<<<<<<<<<<<<<
 *         """
 *         Create a lookup matrix with the embeddings values for all tokens in a sentence.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 217, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 217, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._create_sentence_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_padded_sentence);
  __Pyx_XDECREF(__pyx_v_ind_from);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_table);
  __Pyx_XDECREF(__pyx_v_num_dims);
  __Pyx_XDECREF(__pyx_v_ind_to);
  __Pyx_XDECREF(__pyx_v_token_indices);
  __Pyx_XDECREF(__pyx_v_embeddings);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":248
 *         of the sentence.
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.padding_left
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_12padding_left_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_12padding_left_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_12padding_left___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_12padding_left___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[0], 248, 0, 0, 0, __PYX_ERR(0, 248, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":249
 *         """
 *         def __get__(self):
 *             return self.padding_left             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, np.ndarray padding_left):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->padding_left);
  __pyx_r = ((PyObject *)__pyx_v_self->padding_left);
  __Pyx_TraceReturnValue(__pyx_r, 1, 0, __PYX_ERR(0, 249, __pyx_L1_error));
  goto __pyx_L0;

  /* "nltkor/tag/libs/network.pyx":248
 *         of the sentence.
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.padding_left
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 248, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.padding_left.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":251
 *             return self.padding_left
 * 
 *         def __set__(self, np.ndarray padding_left):             # <<<<<<<<<<<<<<
 *             self.padding_left = padding_left
 *             self.pre_padding = np.array((self.word_window_size // 2) * [padding_left])
*/

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_12padding_left_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_padding_left); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_12padding_left_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_padding_left) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_padding_left), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "padding_left", 0))) __PYX_ERR(0, 251, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_12padding_left_2__set__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), ((PyArrayObject *)__pyx_v_padding_left));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  goto __pyx_L5_cleaned_up;
  __pyx_L0:;
  __pyx_L5_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_12padding_left_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyArrayObject *__pyx_v_padding_left) {
  int __pyx_r;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  long __pyx_t_5;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9]))
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_TraceStartFunc("__set__", __pyx_f[0], 251, 0, 0, 0, __PYX_ERR(0, 251, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":252
 * 
 *         def __set__(self, np.ndarray padding_left):
 *             self.padding_left = padding_left             # <<<<<<<<<<<<<<
 *             self.pre_padding = np.array((self.word_window_size // 2) * [padding_left])
 * 
*/
  __Pyx_INCREF((PyObject *)__pyx_v_padding_left);
  __Pyx_GIVEREF((PyObject *)__pyx_v_padding_left);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->padding_left);
  __Pyx_DECREF((PyObject *)__pyx_v_self->padding_left);
  __pyx_v_self->padding_left = __pyx_v_padding_left;

  /* "nltkor/tag/libs/network.pyx":253
 *         def __set__(self, np.ndarray padding_left):
 *             self.padding_left = padding_left
 *             self.pre_padding = np.array((self.word_window_size // 2) * [padding_left])             # <<<<<<<<<<<<<<
 * 
 *     property padding_right:
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_div_long(__pyx_v_self->word_window_size, 2, 1);
  __pyx_t_3 = PyList_New(1 * ((__pyx_t_5<0) ? 0:__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_t_5; __pyx_temp++) {
      __Pyx_INCREF((PyObject *)__pyx_v_padding_left);
      __Pyx_GIVEREF((PyObject *)__pyx_v_padding_left);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_3, __pyx_temp, ((PyObject *)__pyx_v_padding_left)) != (0)) __PYX_ERR(0, 253, __pyx_L1_error);
    }
  }
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 253, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->pre_padding);
  __Pyx_DECREF((PyObject *)__pyx_v_self->pre_padding);
  __pyx_v_self->pre_padding = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":251
 *             return self.padding_left
 * 
 *         def __set__(self, np.ndarray padding_left):             # <<<<<<<<<<<<<<
 *             self.padding_left = padding_left
 *             self.pre_padding = np.array((self.word_window_size // 2) * [padding_left])
*/

  /* function exit code */
  __pyx_r = 0;
  __Pyx_TraceReturnCValue(__pyx_r, __Pyx_Owned_Py_None, 0, 0, __PYX_ERR(0, 251, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 251, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.padding_left.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":260
 *         of the sentence.
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.padding_right
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_13padding_right_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_13padding_right_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_13padding_right___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_13padding_right___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[0], 260, 0, 0, 0, __PYX_ERR(0, 260, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":261
 *         """
 *         def __get__(self):
 *             return self.padding_right             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, np.ndarray padding_right):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->padding_right);
  __pyx_r = ((PyObject *)__pyx_v_self->padding_right);
  __Pyx_TraceReturnValue(__pyx_r, 1, 0, __PYX_ERR(0, 261, __pyx_L1_error));
  goto __pyx_L0;

  /* "nltkor/tag/libs/network.pyx":260
 *         of the sentence.
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.padding_right
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 260, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.padding_right.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":263
 *             return self.padding_right
 * 
 *         def __set__(self, np.ndarray padding_right):             # <<<<<<<<<<<<<<
 *             self.padding_right = padding_right
 *             self.pos_padding = np.array((self.word_window_size // 2) * [padding_right])
*/

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_13padding_right_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_padding_right); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_13padding_right_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_padding_right) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_padding_right), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "padding_right", 0))) __PYX_ERR(0, 263, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_13padding_right_2__set__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), ((PyArrayObject *)__pyx_v_padding_right));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  goto __pyx_L5_cleaned_up;
  __pyx_L0:;
  __pyx_L5_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_13padding_right_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyArrayObject *__pyx_v_padding_right) {
  int __pyx_r;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  long __pyx_t_5;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11]))
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_TraceStartFunc("__set__", __pyx_f[0], 263, 0, 0, 0, __PYX_ERR(0, 263, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":264
 * 
 *         def __set__(self, np.ndarray padding_right):
 *             self.padding_right = padding_right             # <<<<<<<<<<<<<<
 *             self.pos_padding = np.array((self.word_window_size // 2) * [padding_right])
 * 
*/
  __Pyx_INCREF((PyObject *)__pyx_v_padding_right);
  __Pyx_GIVEREF((PyObject *)__pyx_v_padding_right);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->padding_right);
  __Pyx_DECREF((PyObject *)__pyx_v_self->padding_right);
  __pyx_v_self->padding_right = __pyx_v_padding_right;

  /* "nltkor/tag/libs/network.pyx":265
 *         def __set__(self, np.ndarray padding_right):
 *             self.padding_right = padding_right
 *             self.pos_padding = np.array((self.word_window_size // 2) * [padding_right])             # <<<<<<<<<<<<<<
 * 
 *     def tag_sentence(self, np.ndarray sentence):
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_div_long(__pyx_v_self->word_window_size, 2, 1);
  __pyx_t_3 = PyList_New(1 * ((__pyx_t_5<0) ? 0:__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_t_5; __pyx_temp++) {
      __Pyx_INCREF((PyObject *)__pyx_v_padding_right);
      __Pyx_GIVEREF((PyObject *)__pyx_v_padding_right);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_3, __pyx_temp, ((PyObject *)__pyx_v_padding_right)) != (0)) __PYX_ERR(0, 265, __pyx_L1_error);
    }
  }
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->pos_padding);
  __Pyx_DECREF((PyObject *)__pyx_v_self->pos_padding);
  __pyx_v_self->pos_padding = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":263
 *             return self.padding_right
 * 
 *         def __set__(self, np.ndarray padding_right):             # <<<<<<<<<<<<<<
 *             self.padding_right = padding_right
 *             self.pos_padding = np.array((self.word_window_size // 2) * [padding_right])
*/

  /* function exit code */
  __pyx_r = 0;
  __Pyx_TraceReturnCValue(__pyx_r, __Pyx_Owned_Py_None, 0, 0, __PYX_ERR(0, 263, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 263, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.padding_right.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":267
 *             self.pos_padding = np.array((self.word_window_size // 2) * [padding_right])
 * 
 *     def tag_sentence(self, np.ndarray sentence):             # <<<<<<<<<<<<<<
 *         """
 *         Runs the network for each element in the sentence and returns
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_9tag_sentence(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_8tag_sentence, "Network.tag_sentence(self, ndarray sentence)\nRuns the network for each element in the sentence and returns \nthe sequence of tags.\n\n:param sentence: a 2-dim numpy array, where each item encodes a token.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_9tag_sentence = {"tag_sentence", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_9tag_sentence, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_8tag_sentence};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_9tag_sentence(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyArrayObject *__pyx_v_sentence = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tag_sentence (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sentence,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 267, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 267, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "tag_sentence", 0) < 0) __PYX_ERR(0, 267, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("tag_sentence", 1, 1, 1, i); __PYX_ERR(0, 267, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 267, __pyx_L3_error)
    }
    __pyx_v_sentence = ((PyArrayObject *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tag_sentence", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 267, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.tag_sentence", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sentence), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "sentence", 0))) __PYX_ERR(0, 267, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_8tag_sentence(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), __pyx_v_sentence);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_8tag_sentence(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyArrayObject *__pyx_v_sentence) {
  PyObject *__pyx_v_scores = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12]))
  __Pyx_RefNannySetupContext("tag_sentence", 0);
  __Pyx_TraceStartFunc("tag_sentence", __pyx_f[0], 267, 0, 0, 0, __PYX_ERR(0, 267, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":274
 *         :param sentence: a 2-dim numpy array, where each item encodes a token.
 *         """
 *         scores = self._tag_sentence(sentence)             # <<<<<<<<<<<<<<
 *         # computes full score, combining ftheta and A (if SLL)
 *         return self._viterbi(scores)
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_sentence)};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_tag_sentence, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_scores = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":276
 *         scores = self._tag_sentence(sentence)
 *         # computes full score, combining ftheta and A (if SLL)
 *         return self._viterbi(scores)             # <<<<<<<<<<<<<<
 * 
 *     def _tag_sentence(self, np.ndarray sentence, tags=None):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_scores};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_viterbi, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_TraceReturnValue(__pyx_r, 6, 0, __PYX_ERR(0, 276, __pyx_L1_error));
  goto __pyx_L0;

  /* "nltkor/tag/libs/network.pyx":267
 *             self.pos_padding = np.array((self.word_window_size // 2) * [padding_right])
 * 
 *     def tag_sentence(self, np.ndarray sentence):             # <<<<<<<<<<<<<<
 *         """
 *         Runs the network for each element in the sentence and returns
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 267, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.tag_sentence", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_scores);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":278
 *         return self._viterbi(scores)
 * 
 *     def _tag_sentence(self, np.ndarray sentence, tags=None):             # <<<<<<<<<<<<<<
 *         """
 *         Runs the network for each element in the sentence and returns
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11_tag_sentence(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_10_tag_sentence, "Network._tag_sentence(self, ndarray sentence, tags=None)\nRuns the network for each element in the sentence and returns \nthe sequence of tags.\n\n:param sentence: a 2-dim numpy array, where each item encodes a token.\n:param tags: the correct tags (needed when training)\n:return: a (len(sentence), output_size) array with the scores for all tokens");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_11_tag_sentence = {"_tag_sentence", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11_tag_sentence, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_10_tag_sentence};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11_tag_sentence(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyArrayObject *__pyx_v_sentence = 0;
  PyObject *__pyx_v_tags = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_tag_sentence (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sentence,&__pyx_mstate_global->__pyx_n_u_tags,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 278, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 278, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 278, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_tag_sentence", 0) < 0) __PYX_ERR(0, 278, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_tag_sentence", 0, 1, 2, i); __PYX_ERR(0, 278, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 278, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 278, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_sentence = ((PyArrayObject *)values[0]);
    __pyx_v_tags = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_tag_sentence", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 278, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._tag_sentence", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sentence), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "sentence", 0))) __PYX_ERR(0, 278, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_10_tag_sentence(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), __pyx_v_sentence, __pyx_v_tags);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_10_tag_sentence(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyArrayObject *__pyx_v_sentence, PyObject *__pyx_v_tags) {
  PyArrayObject *__pyx_v_input_data = 0;
  PyArrayObject *__pyx_v_scores = 0;
  PyObject *__pyx_v_training = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_output = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  struct __pyx_opt_args_6nltkor_3tag_4libs_7network_hardtanh __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13]))
  __Pyx_RefNannySetupContext("_tag_sentence", 0);
  __Pyx_TraceStartFunc("_tag_sentence", __pyx_f[0], 278, 0, 0, 0, __PYX_ERR(0, 278, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":290
 *         cdef np.ndarray input_data
 *         # scores[t, i] = ftheta_i,t = score for i-th tag, t-th word
 *         cdef np.ndarray scores = np.empty((len(sentence), self.output_size))             # <<<<<<<<<<<<<<
 * 
 *         training = tags is not None
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = PyObject_Length(((PyObject *)__pyx_v_sentence)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 290, __pyx_L1_error)
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_self->output_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 290, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 290, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_6 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 290, __pyx_L1_error)
  __pyx_v_scores = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":292
 *         cdef np.ndarray scores = np.empty((len(sentence), self.output_size))
 * 
 *         training = tags is not None             # <<<<<<<<<<<<<<
 *         if training:
 *             self.input_sent_values = np.empty((len(sentence), self.input_size))
*/
  __pyx_t_9 = (__pyx_v_tags != Py_None);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_training = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":293
 * 
 *         training = tags is not None
 *         if training:             # <<<<<<<<<<<<<<
 *             self.input_sent_values = np.empty((len(sentence), self.input_size))
 *             # layer2_values at each token in the correct path
*/
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_training); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 293, __pyx_L1_error)
  if (__pyx_t_9) {

    /* "nltkor/tag/libs/network.pyx":294
 *         training = tags is not None
 *         if training:
 *             self.input_sent_values = np.empty((len(sentence), self.input_size))             # <<<<<<<<<<<<<<
 *             # layer2_values at each token in the correct path
 *             self.layer2_sent_values = np.empty((len(sentence), self.hidden_size))
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_5 = PyObject_Length(((PyObject *)__pyx_v_sentence)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 294, __pyx_L1_error)
    __pyx_t_7 = PyLong_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_self->input_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_7);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 294, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 294, __pyx_L1_error);
    __pyx_t_7 = 0;
    __pyx_t_6 = 0;
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 294, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->input_sent_values);
    __Pyx_DECREF((PyObject *)__pyx_v_self->input_sent_values);
    __pyx_v_self->input_sent_values = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/network.pyx":296
 *             self.input_sent_values = np.empty((len(sentence), self.input_size))
 *             # layer2_values at each token in the correct path
 *             self.layer2_sent_values = np.empty((len(sentence), self.hidden_size))             # <<<<<<<<<<<<<<
 *             # hidden_values at each token in the correct path
 *             self.hidden_sent_values = np.empty((len(sentence), self.hidden_size))
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = PyObject_Length(((PyObject *)__pyx_v_sentence)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 296, __pyx_L1_error)
    __pyx_t_3 = PyLong_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_self->hidden_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 296, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 296, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_6 = 0;
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_7};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 296, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->layer2_sent_values);
    __Pyx_DECREF((PyObject *)__pyx_v_self->layer2_sent_values);
    __pyx_v_self->layer2_sent_values = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/network.pyx":298
 *             self.layer2_sent_values = np.empty((len(sentence), self.hidden_size))
 *             # hidden_values at each token in the correct path
 *             self.hidden_sent_values = np.empty((len(sentence), self.hidden_size))             # <<<<<<<<<<<<<<
 * 
 *         self._create_sentence_lookup(sentence)
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_5 = PyObject_Length(((PyObject *)__pyx_v_sentence)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 298, __pyx_L1_error)
    __pyx_t_7 = PyLong_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_self->hidden_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_7);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 298, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 298, __pyx_L1_error);
    __pyx_t_7 = 0;
    __pyx_t_6 = 0;
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 298, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden_sent_values);
    __Pyx_DECREF((PyObject *)__pyx_v_self->hidden_sent_values);
    __pyx_v_self->hidden_sent_values = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/network.pyx":293
 * 
 *         training = tags is not None
 *         if training:             # <<<<<<<<<<<<<<
 *             self.input_sent_values = np.empty((len(sentence), self.input_size))
 *             # layer2_values at each token in the correct path
*/
  }

  /* "nltkor/tag/libs/network.pyx":300
 *             self.hidden_sent_values = np.empty((len(sentence), self.hidden_size))
 * 
 *         self._create_sentence_lookup(sentence)             # <<<<<<<<<<<<<<
 * 
 *         # run through all windows in the sentence
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_8 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_sentence)};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_create_sentence_lookup, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":303
 * 
 *         # run through all windows in the sentence
 *         for i in range(len(sentence)):             # <<<<<<<<<<<<<<
 *             input_data = self.sentence_lookup[i:i + self.word_window_size].flatten()
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_builtin_range);
  __pyx_t_3 = __pyx_builtin_range; 
  __pyx_t_5 = PyObject_Length(((PyObject *)__pyx_v_sentence)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 303, __pyx_L1_error)
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5 = 0;
    __pyx_t_10 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 303, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 303, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_10)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 303, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_5);
        ++__pyx_t_5;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 303, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5));
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5);
        #endif
        ++__pyx_t_5;
      }
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
    } else {
      __pyx_t_1 = __pyx_t_10(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 303, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/network.pyx":304
 *         # run through all windows in the sentence
 *         for i in range(len(sentence)):
 *             input_data = self.sentence_lookup[i:i + self.word_window_size].flatten()             # <<<<<<<<<<<<<<
 * 
 *             # (hidden_size, input_size) . input_size = hidden_size
*/
    __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_self->word_window_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyNumber_Add(__pyx_v_i, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->sentence_lookup), 0, 0, &__pyx_v_i, &__pyx_t_6, NULL, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_4 = __pyx_t_2;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_flatten, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 304, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_input_data, ((PyArrayObject *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/network.pyx":307
 * 
 *             # (hidden_size, input_size) . input_size = hidden_size
 *             self.layer2_values = self.hidden_weights.dot(input_data) + self.hidden_bias             # <<<<<<<<<<<<<<
 *             self.hidden_values = hardtanh(self.layer2_values, inplace=not training)
 *             output = self.output_weights.dot(self.hidden_values) + self.output_bias
*/
    __pyx_t_2 = ((PyObject *)__pyx_v_self->hidden_weights);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_input_data)};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_dot, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_2 = PyNumber_Add(__pyx_t_1, ((PyObject *)__pyx_v_self->hidden_bias)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 307, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->layer2_values);
    __Pyx_DECREF((PyObject *)__pyx_v_self->layer2_values);
    __pyx_v_self->layer2_values = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/network.pyx":308
 *             # (hidden_size, input_size) . input_size = hidden_size
 *             self.layer2_values = self.hidden_weights.dot(input_data) + self.hidden_bias
 *             self.hidden_values = hardtanh(self.layer2_values, inplace=not training)             # <<<<<<<<<<<<<<
 *             output = self.output_weights.dot(self.hidden_values) + self.output_bias
 *             scores[i] = output
*/
    __pyx_t_2 = ((PyObject *)__pyx_v_self->layer2_values);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_training); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 308, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_9)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_11.__pyx_n = 1;
    __pyx_t_11.inplace = __pyx_t_1;
    __pyx_t_4 = __pyx_f_6nltkor_3tag_4libs_7network_hardtanh(((PyArrayObject *)__pyx_t_2), &__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 308, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden_values);
    __Pyx_DECREF((PyObject *)__pyx_v_self->hidden_values);
    __pyx_v_self->hidden_values = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/network.pyx":309
 *             self.layer2_values = self.hidden_weights.dot(input_data) + self.hidden_bias
 *             self.hidden_values = hardtanh(self.layer2_values, inplace=not training)
 *             output = self.output_weights.dot(self.hidden_values) + self.output_bias             # <<<<<<<<<<<<<<
 *             scores[i] = output
 * 
*/
    __pyx_t_1 = ((PyObject *)__pyx_v_self->output_weights);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_v_self->hidden_values)};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_dot, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_1 = PyNumber_Add(__pyx_t_4, ((PyObject *)__pyx_v_self->output_bias)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_output, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/network.pyx":310
 *             self.hidden_values = hardtanh(self.layer2_values, inplace=not training)
 *             output = self.output_weights.dot(self.hidden_values) + self.output_bias
 *             scores[i] = output             # <<<<<<<<<<<<<<
 * 
 *             if training:
*/
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_scores), __pyx_v_i, __pyx_v_output) < 0))) __PYX_ERR(0, 310, __pyx_L1_error)

    /* "nltkor/tag/libs/network.pyx":312
 *             scores[i] = output
 * 
 *             if training:             # <<<<<<<<<<<<<<
 *                 self.input_sent_values[i] = input_data
 *                 self.layer2_sent_values[i] = self.layer2_values
*/
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_training); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 312, __pyx_L1_error)
    if (__pyx_t_9) {

      /* "nltkor/tag/libs/network.pyx":313
 * 
 *             if training:
 *                 self.input_sent_values[i] = input_data             # <<<<<<<<<<<<<<
 *                 self.layer2_sent_values[i] = self.layer2_values
 *                 self.hidden_sent_values[i] = self.hidden_values
*/
      if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->input_sent_values), __pyx_v_i, ((PyObject *)__pyx_v_input_data)) < 0))) __PYX_ERR(0, 313, __pyx_L1_error)

      /* "nltkor/tag/libs/network.pyx":314
 *             if training:
 *                 self.input_sent_values[i] = input_data
 *                 self.layer2_sent_values[i] = self.layer2_values             # <<<<<<<<<<<<<<
 *                 self.hidden_sent_values[i] = self.hidden_values
 * 
*/
      __pyx_t_1 = ((PyObject *)__pyx_v_self->layer2_values);
      __Pyx_INCREF(__pyx_t_1);
      if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->layer2_sent_values), __pyx_v_i, __pyx_t_1) < 0))) __PYX_ERR(0, 314, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "nltkor/tag/libs/network.pyx":315
 *                 self.input_sent_values[i] = input_data
 *                 self.layer2_sent_values[i] = self.layer2_values
 *                 self.hidden_sent_values[i] = self.hidden_values             # <<<<<<<<<<<<<<
 * 
 *         if training:
*/
      __pyx_t_1 = ((PyObject *)__pyx_v_self->hidden_values);
      __Pyx_INCREF(__pyx_t_1);
      if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->hidden_sent_values), __pyx_v_i, __pyx_t_1) < 0))) __PYX_ERR(0, 315, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "nltkor/tag/libs/network.pyx":312
 *             scores[i] = output
 * 
 *             if training:             # <<<<<<<<<<<<<<
 *                 self.input_sent_values[i] = input_data
 *                 self.layer2_sent_values[i] = self.layer2_values
*/
    }

    /* "nltkor/tag/libs/network.pyx":303
 * 
 *         # run through all windows in the sentence
 *         for i in range(len(sentence)):             # <<<<<<<<<<<<<<
 *             input_data = self.sentence_lookup[i:i + self.word_window_size].flatten()
 * 
*/
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":317
 *                 self.hidden_sent_values[i] = self.hidden_values
 * 
 *         if training:             # <<<<<<<<<<<<<<
 *             if self._calculate_gradients_sll(tags, scores):
 *                 self._backpropagate(sentence)
*/
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_training); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 317, __pyx_L1_error)
  if (__pyx_t_9) {

    /* "nltkor/tag/libs/network.pyx":318
 * 
 *         if training:
 *             if self._calculate_gradients_sll(tags, scores):             # <<<<<<<<<<<<<<
 *                 self._backpropagate(sentence)
 * 
*/
    __pyx_t_1 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_tags, ((PyObject *)__pyx_v_scores)};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_calculate_gradients_sll, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 318, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_9) {

      /* "nltkor/tag/libs/network.pyx":319
 *         if training:
 *             if self._calculate_gradients_sll(tags, scores):
 *                 self._backpropagate(sentence)             # <<<<<<<<<<<<<<
 * 
 *         return scores
*/
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_8 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_v_sentence)};
        __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_backpropagate, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "nltkor/tag/libs/network.pyx":318
 * 
 *         if training:
 *             if self._calculate_gradients_sll(tags, scores):             # <<<<<<<<<<<<<<
 *                 self._backpropagate(sentence)
 * 
*/
    }

    /* "nltkor/tag/libs/network.pyx":317
 *                 self.hidden_sent_values[i] = self.hidden_values
 * 
 *         if training:             # <<<<<<<<<<<<<<
 *             if self._calculate_gradients_sll(tags, scores):
 *                 self._backpropagate(sentence)
*/
  }

  /* "nltkor/tag/libs/network.pyx":321
 *                 self._backpropagate(sentence)
 * 
 *         return scores             # <<<<<<<<<<<<<<
 * 
 *     def _calculate_delta(self, scores):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_scores);
  __pyx_r = ((PyObject *)__pyx_v_scores);
  __Pyx_TraceReturnValue(__pyx_r, 132, 0, __PYX_ERR(0, 321, __pyx_L1_error));
  goto __pyx_L0;

  /* "nltkor/tag/libs/network.pyx":278
 *         return self._viterbi(scores)
 * 
 *     def _tag_sentence(self, np.ndarray sentence, tags=None):             # <<<<<<<<<<<<<<
 *         """
 *         Runs the network for each element in the sentence and returns
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 278, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._tag_sentence", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_input_data);
  __Pyx_XDECREF((PyObject *)__pyx_v_scores);
  __Pyx_XDECREF(__pyx_v_training);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_output);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":323
 *         return scores
 * 
 *     def _calculate_delta(self, scores):             # <<<<<<<<<<<<<<
 *         """
 *         Calculates a matrix with the scores for all possible paths at all given
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_13_calculate_delta(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_12_calculate_delta, "Network._calculate_delta(self, scores)\nCalculates a matrix with the scores for all possible paths at all given\npoints (tokens).\nIn the returned matrix, delta[i][j] means the sum of all scores \nending in token i with tag j (delta_i(j) in eq. 14 in the paper)");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_13_calculate_delta = {"_calculate_delta", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_13_calculate_delta, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_12_calculate_delta};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_13_calculate_delta(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_scores = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_calculate_delta (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_scores,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 323, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 323, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_calculate_delta", 0) < 0) __PYX_ERR(0, 323, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_calculate_delta", 1, 1, 1, i); __PYX_ERR(0, 323, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 323, __pyx_L3_error)
    }
    __pyx_v_scores = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_calculate_delta", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 323, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._calculate_delta", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_12_calculate_delta(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), __pyx_v_scores);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_12_calculate_delta(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_scores) {
  PyObject *__pyx_v_delta = NULL;
  PyObject *__pyx_v_transitions = NULL;
  PyObject *__pyx_v_token = NULL;
  PyObject *__pyx_v_logadd = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  struct __pyx_opt_args_6nltkor_3tag_4libs_7network_logsumexp __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14]))
  __Pyx_RefNannySetupContext("_calculate_delta", 0);
  __Pyx_TraceStartFunc("_calculate_delta", __pyx_f[0], 323, 0, 0, 0, __PYX_ERR(0, 323, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":334
 *         # (use long double because taking exp's leads to very very big numbers)
 *         # scores[t][k] = ftheta_k,t
 *         delta = scores             # <<<<<<<<<<<<<<
 * 
 *         # transitions[-1] represents initial transition, A_0,i in paper (mispelled as A_i,0)
*/
  __Pyx_INCREF(__pyx_v_scores);
  __pyx_v_delta = __pyx_v_scores;

  /* "nltkor/tag/libs/network.pyx":338
 *         # transitions[-1] represents initial transition, A_0,i in paper (mispelled as A_i,0)
 *         # delta_0(k) = ftheta_k,0 + A_0,i
 *         delta[0] += self.transitions[-1]             # <<<<<<<<<<<<<<
 * 
 *         # logadd for the remaining tokens
*/
  __pyx_t_1 = 0;
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_delta, __pyx_t_1, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->transitions), -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely((__Pyx_SetItemInt(__pyx_v_delta, __pyx_t_1, __pyx_t_4, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1) < 0))) __PYX_ERR(0, 338, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "nltkor/tag/libs/network.pyx":343
 *         # delta_t(k) = ftheta_k,t + logadd_i(delta_t-1(i) + A_i,k)
 *         #            = ftheta_k,t + log(Sum_i(exp(delta_t-1(i) + A_i,k)))
 *         transitions = self.transitions[:-1].T # A_k,i             # <<<<<<<<<<<<<<
 * 
 *         for token in xrange(1, len(delta)):
*/
  __pyx_t_4 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->transitions), 0, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_T); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_transitions = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":345
 *         transitions = self.transitions[:-1].T # A_k,i
 * 
 *         for token in xrange(1, len(delta)):             # <<<<<<<<<<<<<<
 *             # sum by rows
 *             logadd = logsumexp(delta[token - 1] + transitions, 1)
*/
  __pyx_t_4 = NULL;
  __Pyx_INCREF(__pyx_builtin_xrange);
  __pyx_t_2 = __pyx_builtin_xrange; 
  __pyx_t_1 = PyObject_Length(__pyx_v_delta); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 345, __pyx_L1_error)
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_mstate_global->__pyx_int_1, __pyx_t_5};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 345, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_1 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 345, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 345, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 345, __pyx_L1_error)
          #endif
          if (__pyx_t_1 >= __pyx_temp) break;
        }
        __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_1);
        ++__pyx_t_1;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 345, __pyx_L1_error)
          #endif
          if (__pyx_t_1 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1));
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_1);
        #endif
        ++__pyx_t_1;
      }
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 345, __pyx_L1_error)
    } else {
      __pyx_t_3 = __pyx_t_7(__pyx_t_2);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 345, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_token, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/network.pyx":347
 *         for token in xrange(1, len(delta)):
 *             # sum by rows
 *             logadd = logsumexp(delta[token - 1] + transitions, 1)             # <<<<<<<<<<<<<<
 *             delta[token] += logadd
 * 
*/
    __pyx_t_3 = __Pyx_PyLong_SubtractObjC(__pyx_v_token, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 347, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_delta, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 347, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Add(__pyx_t_5, __pyx_v_transitions); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 347, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 347, __pyx_L1_error)
    __pyx_t_8.__pyx_n = 1;
    __pyx_t_8.axis = __pyx_mstate_global->__pyx_int_1;
    __pyx_t_5 = __pyx_f_6nltkor_3tag_4libs_7network_logsumexp(((PyArrayObject *)__pyx_t_3), &__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 347, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_logadd, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "nltkor/tag/libs/network.pyx":348
 *             # sum by rows
 *             logadd = logsumexp(delta[token - 1] + transitions, 1)
 *             delta[token] += logadd             # <<<<<<<<<<<<<<
 * 
 *         return delta
*/
    __Pyx_INCREF(__pyx_v_token);
    __pyx_t_5 = __pyx_v_token;
    __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_delta, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_v_logadd); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 348, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely((PyObject_SetItem(__pyx_v_delta, __pyx_t_5, __pyx_t_4) < 0))) __PYX_ERR(0, 348, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "nltkor/tag/libs/network.pyx":345
 *         transitions = self.transitions[:-1].T # A_k,i
 * 
 *         for token in xrange(1, len(delta)):             # <<<<<<<<<<<<<<
 *             # sum by rows
 *             logadd = logsumexp(delta[token - 1] + transitions, 1)
*/
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":350
 *             delta[token] += logadd
 * 
 *         return delta             # <<<<<<<<<<<<<<
 * 
 *     @cython.boundscheck(False)
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_delta);
  __pyx_r = __pyx_v_delta;
  __Pyx_TraceReturnValue(__pyx_r, 39, 0, __PYX_ERR(0, 350, __pyx_L1_error));
  goto __pyx_L0;

  /* "nltkor/tag/libs/network.pyx":323
 *         return scores
 * 
 *     def _calculate_delta(self, scores):             # <<<<<<<<<<<<<<
 *         """
 *         Calculates a matrix with the scores for all possible paths at all given
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 323, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._calculate_delta", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_delta);
  __Pyx_XDECREF(__pyx_v_transitions);
  __Pyx_XDECREF(__pyx_v_token);
  __Pyx_XDECREF(__pyx_v_logadd);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":352
 *         return delta
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     def _calculate_gradients_sll(self, tags, scores):
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_15_calculate_gradients_sll(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_14_calculate_gradients_sll, "Network._calculate_gradients_sll(self, tags, scores)\nCalculates the output and transition deltas for each token, using Sentence Level Likelihood.\nThe aim is to minimize the cost:\nC(theta,A) = logadd(scores for all possible paths) - score(correct path)\n\n:returns: if True, normal gradient calculation was performed.\n    If False, the error was too low and weight correction should be\n    skipped.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_15_calculate_gradients_sll = {"_calculate_gradients_sll", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_15_calculate_gradients_sll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_14_calculate_gradients_sll};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_15_calculate_gradients_sll(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_tags = 0;
  PyObject *__pyx_v_scores = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_calculate_gradients_sll (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_tags,&__pyx_mstate_global->__pyx_n_u_scores,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 352, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 352, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 352, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_calculate_gradients_sll", 0) < 0) __PYX_ERR(0, 352, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_calculate_gradients_sll", 1, 2, 2, i); __PYX_ERR(0, 352, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 352, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 352, __pyx_L3_error)
    }
    __pyx_v_tags = values[0];
    __pyx_v_scores = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_calculate_gradients_sll", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 352, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._calculate_gradients_sll", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_14_calculate_gradients_sll(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), __pyx_v_tags, __pyx_v_scores);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_14_calculate_gradients_sll(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_tags, PyObject *__pyx_v_scores) {
  PyArrayObject *__pyx_v_delta = 0;
  PyArrayObject *__pyx_v_delta_softmax = 0;
  PyObject *__pyx_v_correct_path_score = NULL;
  PyObject *__pyx_v_last_tag = NULL;
  PyObject *__pyx_v_tag = NULL;
  PyObject *__pyx_v_net_scores = NULL;
  PyObject *__pyx_v_trans = NULL;
  PyObject *__pyx_v_error = NULL;
  PyObject *__pyx_v_sumlogadd = NULL;
  PyObject *__pyx_v_transitions_t = NULL;
  PyObject *__pyx_v_t = NULL;
  PyObject *__pyx_v_path_scores = NULL;
  PyObject *__pyx_v_log_sum_scores = NULL;
  PyObject *__pyx_v_grad_times_softmax = NULL;
  PyObject *__pyx_v_token = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_delta;
  __Pyx_Buffer __pyx_pybuffer_delta;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_delta_softmax;
  __Pyx_Buffer __pyx_pybuffer_delta_softmax;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  float __pyx_t_20;
  struct __pyx_opt_args_6nltkor_3tag_4libs_7network_logsumexp __pyx_t_21;
  PyArrayObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15]))
  __Pyx_RefNannySetupContext("_calculate_gradients_sll", 0);
  __Pyx_TraceStartFunc("_calculate_gradients_sll", __pyx_f[0], 352, 0, 0, 0, __PYX_ERR(0, 352, __pyx_L1_error));
  __pyx_pybuffer_delta.pybuffer.buf = NULL;
  __pyx_pybuffer_delta.refcount = 0;
  __pyx_pybuffernd_delta.data = NULL;
  __pyx_pybuffernd_delta.rcbuffer = &__pyx_pybuffer_delta;
  __pyx_pybuffer_delta_softmax.pybuffer.buf = NULL;
  __pyx_pybuffer_delta_softmax.refcount = 0;
  __pyx_pybuffernd_delta_softmax.data = NULL;
  __pyx_pybuffernd_delta_softmax.rcbuffer = &__pyx_pybuffer_delta_softmax;

  /* "nltkor/tag/libs/network.pyx":368
 *         # ftheta_i,t = network output for i-th tag, at t-th word
 *         # s = Sum_i(A_tags[i-1],tags[i] + ftheta_i,i), i < len(sentence)   (12)
 *         correct_path_score = 0             # <<<<<<<<<<<<<<
 *         last_tag = self.output_size
 *         for tag, net_scores in zip(tags[:-2], scores[:-2]):
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_v_correct_path_score = __pyx_mstate_global->__pyx_int_0;

  /* "nltkor/tag/libs/network.pyx":369
 *         # s = Sum_i(A_tags[i-1],tags[i] + ftheta_i,i), i < len(sentence)   (12)
 *         correct_path_score = 0
 *         last_tag = self.output_size             # <<<<<<<<<<<<<<
 *         for tag, net_scores in zip(tags[:-2], scores[:-2]):
 *             #print(tags, last_tag, tag, self.transitions)
*/
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->output_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_last_tag = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":370
 *         correct_path_score = 0
 *         last_tag = self.output_size
 *         for tag, net_scores in zip(tags[:-2], scores[:-2]):             # <<<<<<<<<<<<<<
 *             #print(tags, last_tag, tag, self.transitions)
 *             trans = 0 if self.transitions is None else self.transitions[last_tag, tag]
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_builtin_zip);
  __pyx_t_3 = __pyx_builtin_zip; 
  __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_tags, 0, -2L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[2], 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_scores, 0, -2L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[2], 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_4, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3);
    __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 370, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 370, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_7);
        ++__pyx_t_7;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 370, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7));
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7);
        #endif
        ++__pyx_t_7;
      }
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error)
    } else {
      __pyx_t_1 = __pyx_t_8(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 370, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_1);
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 370, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_4);
      } else {
        __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 0);
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 370, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_5);
        __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 370, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
      }
      #else
      __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 370, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 370, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2);
      index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_2); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_4 = __pyx_t_9(__pyx_t_2); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_2), 2) < 0) __PYX_ERR(0, 370, __pyx_L1_error)
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 370, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_tag, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_net_scores, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/network.pyx":372
 *         for tag, net_scores in zip(tags[:-2], scores[:-2]):
 *             #print(tags, last_tag, tag, self.transitions)
 *             trans = 0 if self.transitions is None else self.transitions[last_tag, tag]             # <<<<<<<<<<<<<<
 *             #print ('trans:',trans)
 *             #print ('net:',tag, net_scores[tag])
*/
    __pyx_t_10 = (((PyObject *)__pyx_v_self->transitions) == Py_None);
    if (__pyx_t_10) {
      __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
      __pyx_t_1 = __pyx_mstate_global->__pyx_int_0;
    } else {
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 372, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_last_tag);
      __Pyx_GIVEREF(__pyx_v_last_tag);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_last_tag) != (0)) __PYX_ERR(0, 372, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_tag);
      __Pyx_GIVEREF(__pyx_v_tag);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_tag) != (0)) __PYX_ERR(0, 372, __pyx_L1_error);
      __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->transitions), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 372, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_1 = __pyx_t_5;
      __pyx_t_5 = 0;
    }
    __Pyx_XDECREF_SET(__pyx_v_trans, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/network.pyx":376
 *             #print ('net:',tag, net_scores[tag])
 *             #print
 *             correct_path_score += trans + net_scores[tag]             # <<<<<<<<<<<<<<
 *             last_tag = tag
 * 
*/
    __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_net_scores, __pyx_v_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyNumber_Add(__pyx_v_trans, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_correct_path_score, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_correct_path_score, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/network.pyx":377
 *             #print
 *             correct_path_score += trans + net_scores[tag]
 *             last_tag = tag             # <<<<<<<<<<<<<<
 * 
 *         # delta[t] = delta_t in equation (14)
*/
    __Pyx_INCREF(__pyx_v_tag);
    __Pyx_DECREF_SET(__pyx_v_last_tag, __pyx_v_tag);

    /* "nltkor/tag/libs/network.pyx":370
 *         correct_path_score = 0
 *         last_tag = self.output_size
 *         for tag, net_scores in zip(tags[:-2], scores[:-2]):             # <<<<<<<<<<<<<<
 *             #print(tags, last_tag, tag, self.transitions)
 *             trans = 0 if self.transitions is None else self.transitions[last_tag, tag]
*/
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":380
 * 
 *         # delta[t] = delta_t in equation (14)
 *         delta = self._calculate_delta(scores)             # <<<<<<<<<<<<<<
 *         # logadd_i(delta_T(i)) = log(Sum_i(exp(delta_T(i))))
 *         # Sentence-level Log-Likelihood (SLL)
*/
  __pyx_t_1 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_scores};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_calculate_delta, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 380, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_delta.rcbuffer->pybuffer);
    __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_delta.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_DOUBLE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_11 < 0)) {
      PyErr_Fetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_delta.rcbuffer->pybuffer, (PyObject*)__pyx_v_delta, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_DOUBLE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      }
      __pyx_t_12 = __pyx_t_13 = __pyx_t_14 = 0;
    }
    __pyx_pybuffernd_delta.diminfo[0].strides = __pyx_pybuffernd_delta.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_delta.diminfo[0].shape = __pyx_pybuffernd_delta.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_delta.diminfo[1].strides = __pyx_pybuffernd_delta.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_delta.diminfo[1].shape = __pyx_pybuffernd_delta.rcbuffer->pybuffer.shape[1];
    if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 380, __pyx_L1_error)
  }
  __pyx_v_delta = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":386
 *         #print ': ', np.log(np.sum(np.exp(delta[-1])))
 *         #print '> ', correct_path_score
 *         error = np.log(np.sum(np.exp(delta[-1]))) - correct_path_score             # <<<<<<<<<<<<<<
 *         #print error
 *         #error = logsumexp(delta[-1]) - correct_path_score
*/
  __pyx_t_1 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_log); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_sum); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __pyx_t_17 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_exp); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __pyx_t_18 = __Pyx_GetItemInt(((PyObject *)__pyx_v_delta), -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 0); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_19))) {
    __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_19);
    assert(__pyx_t_17);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_19);
    __Pyx_INCREF(__pyx_t_17);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_19, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_17, __pyx_t_18};
    __pyx_t_15 = __Pyx_PyObject_FastCall(__pyx_t_19, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 386, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
  }
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_16))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_16);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_16);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_16, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_15};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 386, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_5};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 386, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_v_correct_path_score); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_error = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/network.pyx":389
 *         #print error
 *         #error = logsumexp(delta[-1]) - correct_path_score
 *         self.error += error             # <<<<<<<<<<<<<<
 * 
 *         # if the error is too low, don't bother training (saves time and avoids
*/
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_v_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_20 = __Pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_20 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->error = __pyx_t_20;

  /* "nltkor/tag/libs/network.pyx":397
 *         # error 0.22 -> 80%
 *         # error 0.1  -> 90%
 *         if error <= 0.01:             # <<<<<<<<<<<<<<
 *             self.skips += 1
 *             return False
*/
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_error, __pyx_mstate_global->__pyx_float_0_01, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error)
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 397, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_10) {

    /* "nltkor/tag/libs/network.pyx":398
 *         # error 0.1  -> 90%
 *         if error <= 0.01:
 *             self.skips += 1             # <<<<<<<<<<<<<<
 *             return False
 * 
*/
    __pyx_v_self->skips = (__pyx_v_self->skips + 1);

    /* "nltkor/tag/libs/network.pyx":399
 *         if error <= 0.01:
 *             self.skips += 1
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         # initialize gradients
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    __Pyx_TraceReturnValue(__pyx_r, 66, 0, __PYX_ERR(0, 399, __pyx_L1_error));
    goto __pyx_L0;

    /* "nltkor/tag/libs/network.pyx":397
 *         # error 0.22 -> 80%
 *         # error 0.1  -> 90%
 *         if error <= 0.01:             # <<<<<<<<<<<<<<
 *             self.skips += 1
 *             return False
*/
  }

  /* "nltkor/tag/libs/network.pyx":403
 *         # initialize gradients
 *         # dC / dftheta
 *         self.net_gradients = np.zeros((len(tags), self.output_size))             # <<<<<<<<<<<<<<
 *         # dC / dA
 *         #self.trans_gradients = np.zeros_like(self.transitions, float)
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = PyObject_Length(__pyx_v_tags); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 403, __pyx_L1_error)
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_16 = __Pyx_PyLong_From_int(__pyx_v_self->output_size); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 403, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_16);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_16) != (0)) __PYX_ERR(0, 403, __pyx_L1_error);
  __pyx_t_5 = 0;
  __pyx_t_16 = 0;
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_15};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 403, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 403, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->net_gradients);
  __Pyx_DECREF((PyObject *)__pyx_v_self->net_gradients);
  __pyx_v_self->net_gradients = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":406
 *         # dC / dA
 *         #self.trans_gradients = np.zeros_like(self.transitions, float)
 *         self.trans_gradients = np.zeros_like(self.transitions, np.float64)             # <<<<<<<<<<<<<<
 * 
 *         # things get nasty from here
*/
  __pyx_t_1 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_zeros_like); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_1, ((PyObject *)__pyx_v_self->transitions), __pyx_t_16};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 406, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->trans_gradients);
  __Pyx_DECREF((PyObject *)__pyx_v_self->trans_gradients);
  __pyx_v_self->trans_gradients = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":418
 *         # delta_T(i) - logsumexp(delta_T(k))
 *         # dC_logadd / ddelta_T(i) = e(delta_T(i) - logsumexp(delta_T(k)))
 *         sumlogadd = logsumexp(delta[-1])             # <<<<<<<<<<<<<<
 *         # negative gradients
 *         self.net_gradients[-1] = -np.exp(delta[-1] - sumlogadd)
*/
  __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_delta), -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 418, __pyx_L1_error)
  __pyx_t_4 = __pyx_f_6nltkor_3tag_4libs_7network_logsumexp(((PyArrayObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_sumlogadd = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/network.pyx":420
 *         sumlogadd = logsumexp(delta[-1])
 *         # negative gradients
 *         self.net_gradients[-1] = -np.exp(delta[-1] - sumlogadd)             # <<<<<<<<<<<<<<
 * 
 *         transitions_t = 0 if self.transitions is None else self.transitions[:-1].T
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_exp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_t_16 = __Pyx_GetItemInt(((PyObject *)__pyx_v_delta), -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_15 = PyNumber_Subtract(__pyx_t_16, __pyx_v_sumlogadd); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_15};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 420, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_1 = PyNumber_Negative(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_v_self->net_gradients), -1L, __pyx_t_1, long, 1, __Pyx_PyLong_From_long, 0, 1, 0) < 0))) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":422
 *         self.net_gradients[-1] = -np.exp(delta[-1] - sumlogadd)
 * 
 *         transitions_t = 0 if self.transitions is None else self.transitions[:-1].T             # <<<<<<<<<<<<<<
 * 
 *         # delta[i][j]: sum of scores of all path that assign tag j to ith-token
*/
  __pyx_t_10 = (((PyObject *)__pyx_v_self->transitions) == Py_None);
  if (__pyx_t_10) {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __pyx_t_1 = __pyx_mstate_global->__pyx_int_0;
  } else {
    __pyx_t_4 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->transitions), 0, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 422, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_T); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 422, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_15;
    __pyx_t_15 = 0;
  }
  __pyx_v_transitions_t = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":427
 * 
 *         # now compute the gradients for the other tokens, from last to first
 *         for t in range(len(scores) - 2, -1, -1):             # <<<<<<<<<<<<<<
 * 
 *             # sum the scores for all paths ending with each tag i at token t
*/
  __pyx_t_15 = NULL;
  __Pyx_INCREF(__pyx_builtin_range);
  __pyx_t_4 = __pyx_builtin_range; 
  __pyx_t_7 = PyObject_Length(__pyx_v_scores); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 427, __pyx_L1_error)
  __pyx_t_3 = PyLong_FromSsize_t((__pyx_t_7 - 2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_15, __pyx_t_3, __pyx_mstate_global->__pyx_int_neg_1, __pyx_mstate_global->__pyx_int_neg_1};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (4-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 427, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4);
    __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 427, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 427, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 427, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_7);
        ++__pyx_t_7;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 427, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7));
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7);
        #endif
        ++__pyx_t_7;
      }
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 427, __pyx_L1_error)
    } else {
      __pyx_t_1 = __pyx_t_8(__pyx_t_4);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 427, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/network.pyx":433
 *             # Obtained by transposing twice
 *             # [delta_t-1(i)+A_j,i]T
 *             path_scores = (delta[t] + transitions_t).T             # <<<<<<<<<<<<<<
 * 
 *             # normalize over all possible tag paths using a softmax,
*/
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_delta), __pyx_v_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 433, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_v_transitions_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 433, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_T); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 433, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_path_scores, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/network.pyx":438
 *             # computed using log.
 *             # the log of the sums of exps, summed by column
 *             log_sum_scores = logsumexp(path_scores, 0)             # <<<<<<<<<<<<<<
 * 
 *             # softmax is the division of an exponential by the sum of all exponentials
*/
    if (!(likely(((__pyx_v_path_scores) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_path_scores, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 438, __pyx_L1_error)
    __pyx_t_21.__pyx_n = 1;
    __pyx_t_21.axis = __pyx_mstate_global->__pyx_int_0;
    __pyx_t_1 = __pyx_f_6nltkor_3tag_4libs_7network_logsumexp(((PyArrayObject *)__pyx_v_path_scores), &__pyx_t_21); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_log_sum_scores, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/network.pyx":443
 *             # (yields a probability)
 *             # e(delta_t-1(i)+A_i,j) / Sum_k e(delta_t-1(k)+A_k,j)
 *             delta_softmax = np.exp(path_scores - log_sum_scores)             # <<<<<<<<<<<<<<
 * 
 *             # multiply each value in the softmax by the gradient at the next tag
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 443, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_exp); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 443, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __pyx_t_15 = PyNumber_Subtract(__pyx_v_path_scores, __pyx_v_log_sum_scores); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 443, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_16))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_16);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_16);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_16, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_15};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 443, __pyx_L1_error)
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_delta_softmax.rcbuffer->pybuffer);
      __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_delta_softmax.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_DOUBLE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_11 < 0)) {
        PyErr_Fetch(&__pyx_t_14, &__pyx_t_13, &__pyx_t_12);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_delta_softmax.rcbuffer->pybuffer, (PyObject*)__pyx_v_delta_softmax, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_DOUBLE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_14, __pyx_t_13, __pyx_t_12);
        }
        __pyx_t_14 = __pyx_t_13 = __pyx_t_12 = 0;
      }
      __pyx_pybuffernd_delta_softmax.diminfo[0].strides = __pyx_pybuffernd_delta_softmax.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_delta_softmax.diminfo[0].shape = __pyx_pybuffernd_delta_softmax.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_delta_softmax.diminfo[1].strides = __pyx_pybuffernd_delta_softmax.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_delta_softmax.diminfo[1].shape = __pyx_pybuffernd_delta_softmax.rcbuffer->pybuffer.shape[1];
      if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 443, __pyx_L1_error)
    }
    __Pyx_XDECREF_SET(__pyx_v_delta_softmax, ((PyArrayObject *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/network.pyx":448
 *             # dC_logadd / ddelta_t(i) * delta_softmax
 *             # Attardi: negative since net_gradients[t + 1] already negative
 *             grad_times_softmax = self.net_gradients[t + 1] * delta_softmax             # <<<<<<<<<<<<<<
 *             # dC / dA_i,j
 *             self.trans_gradients[:-1, :] += grad_times_softmax
*/
    __pyx_t_1 = __Pyx_PyLong_AddObjC(__pyx_v_t, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_16 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->net_gradients), __pyx_t_1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 448, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Multiply(__pyx_t_16, ((PyObject *)__pyx_v_delta_softmax)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_XDECREF_SET(__pyx_v_grad_times_softmax, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/network.pyx":450
 *             grad_times_softmax = self.net_gradients[t + 1] * delta_softmax
 *             # dC / dA_i,j
 *             self.trans_gradients[:-1, :] += grad_times_softmax             # <<<<<<<<<<<<<<
 * 
 *             # sum all transition gradients by row to find the network gradients
*/
    __Pyx_INCREF((PyObject *)__pyx_v_self->trans_gradients);
    __pyx_t_22 = __pyx_v_self->trans_gradients;
    __Pyx_INCREF(__pyx_mstate_global->__pyx_tuple[0]);
    __pyx_t_23 = __pyx_mstate_global->__pyx_tuple[0];
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_t_22), __pyx_t_23); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_16 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_grad_times_softmax); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_t_22), __pyx_t_23, __pyx_t_16) < 0))) __PYX_ERR(0, 450, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
    __Pyx_DECREF((PyObject *)__pyx_t_22); __pyx_t_22 = 0;

    /* "nltkor/tag/libs/network.pyx":455
 *             # Sum_j(dC_logadd / ddelta_t(j) * delta_softmax)
 *             # Attardi: negative since grad_times_softmax already negative
 *             self.net_gradients[t] = np.sum(grad_times_softmax, 1)             # <<<<<<<<<<<<<<
 * 
 *         # find the gradients for the starting transition
*/
    __pyx_t_1 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 455, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_sum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 455, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_grad_times_softmax, __pyx_mstate_global->__pyx_int_1};
      __pyx_t_16 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 455, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
    }
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->net_gradients), __pyx_v_t, __pyx_t_16) < 0))) __PYX_ERR(0, 455, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

    /* "nltkor/tag/libs/network.pyx":427
 * 
 *         # now compute the gradients for the other tokens, from last to first
 *         for t in range(len(scores) - 2, -1, -1):             # <<<<<<<<<<<<<<
 * 
 *             # sum the scores for all paths ending with each tag i at token t
*/
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "nltkor/tag/libs/network.pyx":459
 *         # find the gradients for the starting transition
 *         # there is only one possibility to come from, which is the sentence start
 *         self.trans_gradients[-1] = self.net_gradients[0]             # <<<<<<<<<<<<<<
 * 
 *         # now, add +1 to the correct path
*/
  __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->net_gradients), 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_v_self->trans_gradients), -1L, __pyx_t_4, long, 1, __Pyx_PyLong_From_long, 0, 1, 0) < 0))) __PYX_ERR(0, 459, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "nltkor/tag/libs/network.pyx":462
 * 
 *         # now, add +1 to the correct path
 *         last_tag = self.output_size             # <<<<<<<<<<<<<<
 *         for token, tag in enumerate(tags):
 *             self.net_gradients[token][tag] += 1 # negative gradient
*/
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_self->output_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF_SET(__pyx_v_last_tag, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/network.pyx":463
 *         # now, add +1 to the correct path
 *         last_tag = self.output_size
 *         for token, tag in enumerate(tags):             # <<<<<<<<<<<<<<
 *             self.net_gradients[token][tag] += 1 # negative gradient
 *             if self.transitions is not None:
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_t_4 = __pyx_mstate_global->__pyx_int_0;
  if (likely(PyList_CheckExact(__pyx_v_tags)) || PyTuple_CheckExact(__pyx_v_tags)) {
    __pyx_t_16 = __pyx_v_tags; __Pyx_INCREF(__pyx_t_16);
    __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_16 = PyObject_GetIter(__pyx_v_tags); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 463, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 463, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_16))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_16);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 463, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_16, __pyx_t_7);
        ++__pyx_t_7;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_16);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 463, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_16, __pyx_t_7));
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_16, __pyx_t_7);
        #endif
        ++__pyx_t_7;
      }
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 463, __pyx_L1_error)
    } else {
      __pyx_t_3 = __pyx_t_8(__pyx_t_16);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 463, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_tag, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_token, __pyx_t_4);
    __pyx_t_3 = __Pyx_PyLong_AddObjC(__pyx_t_4, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 463, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4);
    __pyx_t_4 = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/network.pyx":464
 *         last_tag = self.output_size
 *         for token, tag in enumerate(tags):
 *             self.net_gradients[token][tag] += 1 # negative gradient             # <<<<<<<<<<<<<<
 *             if self.transitions is not None:
 *                 self.trans_gradients[last_tag][tag] += 1 # negative gradient
*/
    __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->net_gradients), __pyx_v_token); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 464, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_tag);
    __pyx_t_1 = __pyx_v_tag;
    __pyx_t_15 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 464, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_5 = __Pyx_PyLong_AddObjC(__pyx_t_15, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 464, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    if (unlikely((PyObject_SetItem(__pyx_t_3, __pyx_t_1, __pyx_t_5) < 0))) __PYX_ERR(0, 464, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "nltkor/tag/libs/network.pyx":465
 *         for token, tag in enumerate(tags):
 *             self.net_gradients[token][tag] += 1 # negative gradient
 *             if self.transitions is not None:             # <<<<<<<<<<<<<<
 *                 self.trans_gradients[last_tag][tag] += 1 # negative gradient
 *             last_tag = tag
*/
    __pyx_t_10 = (((PyObject *)__pyx_v_self->transitions) != Py_None);
    if (__pyx_t_10) {

      /* "nltkor/tag/libs/network.pyx":466
 *             self.net_gradients[token][tag] += 1 # negative gradient
 *             if self.transitions is not None:
 *                 self.trans_gradients[last_tag][tag] += 1 # negative gradient             # <<<<<<<<<<<<<<
 *             last_tag = tag
 * 
*/
      __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->trans_gradients), __pyx_v_last_tag); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_tag);
      __pyx_t_1 = __pyx_v_tag;
      __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 466, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_15 = __Pyx_PyLong_AddObjC(__pyx_t_5, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 466, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely((PyObject_SetItem(__pyx_t_3, __pyx_t_1, __pyx_t_15) < 0))) __PYX_ERR(0, 466, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "nltkor/tag/libs/network.pyx":465
 *         for token, tag in enumerate(tags):
 *             self.net_gradients[token][tag] += 1 # negative gradient
 *             if self.transitions is not None:             # <<<<<<<<<<<<<<
 *                 self.trans_gradients[last_tag][tag] += 1 # negative gradient
 *             last_tag = tag
*/
    }

    /* "nltkor/tag/libs/network.pyx":467
 *             if self.transitions is not None:
 *                 self.trans_gradients[last_tag][tag] += 1 # negative gradient
 *             last_tag = tag             # <<<<<<<<<<<<<<
 * 
 *         return True
*/
    __Pyx_INCREF(__pyx_v_tag);
    __Pyx_DECREF_SET(__pyx_v_last_tag, __pyx_v_tag);

    /* "nltkor/tag/libs/network.pyx":463
 *         # now, add +1 to the correct path
 *         last_tag = self.output_size
 *         for token, tag in enumerate(tags):             # <<<<<<<<<<<<<<
 *             self.net_gradients[token][tag] += 1 # negative gradient
 *             if self.transitions is not None:
*/
  }
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "nltkor/tag/libs/network.pyx":469
 *             last_tag = tag
 * 
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     @cython.boundscheck(False)
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  __Pyx_TraceReturnValue(__pyx_r, 208, 0, __PYX_ERR(0, 469, __pyx_L1_error));
  goto __pyx_L0;

  /* "nltkor/tag/libs/network.pyx":352
 *         return delta
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     def _calculate_gradients_sll(self, tags, scores):
 *         """
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF((PyObject *)__pyx_t_22);
  __Pyx_XDECREF(__pyx_t_23);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_delta.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_delta_softmax.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 352, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._calculate_gradients_sll", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_delta.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_delta_softmax.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_delta);
  __Pyx_XDECREF((PyObject *)__pyx_v_delta_softmax);
  __Pyx_XDECREF(__pyx_v_correct_path_score);
  __Pyx_XDECREF(__pyx_v_last_tag);
  __Pyx_XDECREF(__pyx_v_tag);
  __Pyx_XDECREF(__pyx_v_net_scores);
  __Pyx_XDECREF(__pyx_v_trans);
  __Pyx_XDECREF(__pyx_v_error);
  __Pyx_XDECREF(__pyx_v_sumlogadd);
  __Pyx_XDECREF(__pyx_v_transitions_t);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_XDECREF(__pyx_v_path_scores);
  __Pyx_XDECREF(__pyx_v_log_sum_scores);
  __Pyx_XDECREF(__pyx_v_grad_times_softmax);
  __Pyx_XDECREF(__pyx_v_token);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":471
 *         return True
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     def _calculate_gradients_wll(self, tags, scores):
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_17_calculate_gradients_wll(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_16_calculate_gradients_wll, "Network._calculate_gradients_wll(self, tags, scores)\nCalculates the output for each token, using Word Level Likelihood.\nThe aim is to minimize the word-level log-likelihood:\nC(ftheta) = logadd_j(ftheta_j) - ftheta_y,\nwhere y is the sequence of correct tags\n\n:returns: if True, normal gradient calculation was performed.\n    If False, the error was too low and weight correction should be\n    skipped.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_17_calculate_gradients_wll = {"_calculate_gradients_wll", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_17_calculate_gradients_wll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_16_calculate_gradients_wll};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_17_calculate_gradients_wll(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_tags = 0;
  PyObject *__pyx_v_scores = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_calculate_gradients_wll (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_tags,&__pyx_mstate_global->__pyx_n_u_scores,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 471, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 471, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 471, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_calculate_gradients_wll", 0) < 0) __PYX_ERR(0, 471, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_calculate_gradients_wll", 1, 2, 2, i); __PYX_ERR(0, 471, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 471, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 471, __pyx_L3_error)
    }
    __pyx_v_tags = values[0];
    __pyx_v_scores = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_calculate_gradients_wll", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 471, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._calculate_gradients_wll", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_16_calculate_gradients_wll(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), __pyx_v_tags, __pyx_v_scores);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_16_calculate_gradients_wll(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_tags, PyObject *__pyx_v_scores) {
  PyObject *__pyx_v_exponentials = NULL;
  PyObject *__pyx_v_correct_path_score = NULL;
  PyObject *__pyx_v_token = NULL;
  PyObject *__pyx_v_tag = NULL;
  PyObject *__pyx_v_net_scores = NULL;
  PyObject *__pyx_v_error = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  float __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16]))
  __Pyx_RefNannySetupContext("_calculate_gradients_wll", 0);
  __Pyx_TraceStartFunc("_calculate_gradients_wll", __pyx_f[0], 471, 0, 0, 0, __PYX_ERR(0, 471, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":485
 *         # compute the negative gradient with respect to ftheta
 *         # dC / dftheta_i = e(ftheta_i)/Sum_k(e(ftheta_k))
 *         exponentials = np.exp(scores)             # <<<<<<<<<<<<<<
 *         # FIXME: use logsumexp
 *         # ((len(sentence), self.output_size))
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_exp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_scores};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 485, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_exponentials = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":488
 *         # FIXME: use logsumexp
 *         # ((len(sentence), self.output_size))
 *         self.net_gradients = -(exponentials.T / exponentials.sum(1)).T             # <<<<<<<<<<<<<<
 * 
 *         # correct path and its gradient
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_exponentials, __pyx_mstate_global->__pyx_n_u_T); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_v_exponentials;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_int_1};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_sum, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 488, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_T); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Negative(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 488, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->net_gradients);
  __Pyx_DECREF((PyObject *)__pyx_v_self->net_gradients);
  __pyx_v_self->net_gradients = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":491
 * 
 *         # correct path and its gradient
 *         correct_path_score = 0             # <<<<<<<<<<<<<<
 *         token = 0
 *         for tag, net_scores in zip(tags, scores):
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_v_correct_path_score = __pyx_mstate_global->__pyx_int_0;

  /* "nltkor/tag/libs/network.pyx":492
 *         # correct path and its gradient
 *         correct_path_score = 0
 *         token = 0             # <<<<<<<<<<<<<<
 *         for tag, net_scores in zip(tags, scores):
 *             self.net_gradients[token][tag] += 1 # negative gradient
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_v_token = __pyx_mstate_global->__pyx_int_0;

  /* "nltkor/tag/libs/network.pyx":493
 *         correct_path_score = 0
 *         token = 0
 *         for tag, net_scores in zip(tags, scores):             # <<<<<<<<<<<<<<
 *             self.net_gradients[token][tag] += 1 # negative gradient
 *             token += 1
*/
  __pyx_t_4 = NULL;
  __Pyx_INCREF(__pyx_builtin_zip);
  __pyx_t_1 = __pyx_builtin_zip; 
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_tags, __pyx_v_scores};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 493, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 493, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6);
        ++__pyx_t_6;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 493, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6));
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6);
        #endif
        ++__pyx_t_6;
      }
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 493, __pyx_L1_error)
    } else {
      __pyx_t_2 = __pyx_t_7(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 493, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_2);
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 493, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_3);
      } else {
        __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 493, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
        __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1);
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_3);
      }
      #else
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 493, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 493, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
      index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 493, __pyx_L1_error)
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 493, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_tag, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_net_scores, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/network.pyx":494
 *         token = 0
 *         for tag, net_scores in zip(tags, scores):
 *             self.net_gradients[token][tag] += 1 # negative gradient             # <<<<<<<<<<<<<<
 *             token += 1
 *             correct_path_score += net_scores[tag]
*/
    __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->net_gradients), __pyx_v_token); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_tag);
    __pyx_t_3 = __pyx_v_tag;
    __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 494, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = __Pyx_PyLong_AddObjC(__pyx_t_4, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 494, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely((PyObject_SetItem(__pyx_t_2, __pyx_t_3, __pyx_t_8) < 0))) __PYX_ERR(0, 494, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "nltkor/tag/libs/network.pyx":495
 *         for tag, net_scores in zip(tags, scores):
 *             self.net_gradients[token][tag] += 1 # negative gradient
 *             token += 1             # <<<<<<<<<<<<<<
 *             correct_path_score += net_scores[tag]
 * 
*/
    __pyx_t_2 = __Pyx_PyLong_AddObjC(__pyx_v_token, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_token, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/network.pyx":496
 *             self.net_gradients[token][tag] += 1 # negative gradient
 *             token += 1
 *             correct_path_score += net_scores[tag]             # <<<<<<<<<<<<<<
 * 
 *         # C(ftheta) = logadd_j(ftheta_j) - score(correct path)
*/
    __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_net_scores, __pyx_v_tag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_correct_path_score, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_correct_path_score, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/network.pyx":493
 *         correct_path_score = 0
 *         token = 0
 *         for tag, net_scores in zip(tags, scores):             # <<<<<<<<<<<<<<
 *             self.net_gradients[token][tag] += 1 # negative gradient
 *             token += 1
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":500
 *         # C(ftheta) = logadd_j(ftheta_j) - score(correct path)
 *         #error = np.log(np.sum(np.exp(scores))) - correct_path_score
 *         error = logsumexp(scores) - correct_path_score             # <<<<<<<<<<<<<<
 *         # approximate
 *         #error = np.max(scores) - correct_path_score
*/
  if (!(likely(((__pyx_v_scores) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_scores, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 500, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_6nltkor_3tag_4libs_7network_logsumexp(((PyArrayObject *)__pyx_v_scores), NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_v_correct_path_score); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_error = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":503
 *         # approximate
 *         #error = np.max(scores) - correct_path_score
 *         self.error += error             # <<<<<<<<<<<<<<
 * 
 *         return True
*/
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_v_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_10 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_10 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->error = __pyx_t_10;

  /* "nltkor/tag/libs/network.pyx":505
 *         self.error += error
 * 
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     @cython.boundscheck(False)
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  __Pyx_TraceReturnValue(__pyx_r, 50, 0, __PYX_ERR(0, 505, __pyx_L1_error));
  goto __pyx_L0;

  /* "nltkor/tag/libs/network.pyx":471
 *         return True
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     def _calculate_gradients_wll(self, tags, scores):
 *         """
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 471, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._calculate_gradients_wll", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_exponentials);
  __Pyx_XDECREF(__pyx_v_correct_path_score);
  __Pyx_XDECREF(__pyx_v_token);
  __Pyx_XDECREF(__pyx_v_tag);
  __Pyx_XDECREF(__pyx_v_net_scores);
  __Pyx_XDECREF(__pyx_v_error);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":507
 *         return True
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     def _viterbi(self, np.ndarray[FLOAT_t, ndim=2] scores):
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_19_viterbi(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_18_viterbi, "Network._viterbi(self, ndarray scores)\nPerforms a Viterbi search over the scores for each tag using\nthe transitions matrix. If a matrix wasn't supplied, \nit will return the tags with the highest scores individually.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_19_viterbi = {"_viterbi", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_19_viterbi, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_18_viterbi};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_19_viterbi(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyArrayObject *__pyx_v_scores = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_viterbi (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_scores,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 507, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 507, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_viterbi", 0) < 0) __PYX_ERR(0, 507, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_viterbi", 1, 1, 1, i); __PYX_ERR(0, 507, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 507, __pyx_L3_error)
    }
    __pyx_v_scores = ((PyArrayObject *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_viterbi", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 507, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._viterbi", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_scores), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "scores", 0))) __PYX_ERR(0, 508, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_18_viterbi(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), __pyx_v_scores);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_18_viterbi(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyArrayObject *__pyx_v_scores) {
  PyObject *__pyx_v_path_scores = NULL;
  PyObject *__pyx_v_path_backtrack = NULL;
  PyObject *__pyx_v_output_range = NULL;
  PyObject *__pyx_v_transitions = NULL;
  int __pyx_v_i;
  PyObject *__pyx_v_prev_score_and_trans = NULL;
  PyObject *__pyx_v_answer = NULL;
  PyObject *__pyx_v_previous_tag = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_scores;
  __Pyx_Buffer __pyx_pybuffer_scores;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  long __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  float __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[17]))
  __Pyx_RefNannySetupContext("_viterbi", 0);
  __Pyx_TraceStartFunc("_viterbi", __pyx_f[0], 507, 0, 0, 0, __PYX_ERR(0, 507, __pyx_L1_error));
  __pyx_pybuffer_scores.pybuffer.buf = NULL;
  __pyx_pybuffer_scores.refcount = 0;
  __pyx_pybuffernd_scores.data = NULL;
  __pyx_pybuffernd_scores.rcbuffer = &__pyx_pybuffer_scores;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_scores.rcbuffer->pybuffer, (PyObject*)__pyx_v_scores, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 507, __pyx_L1_error)
  }
  __pyx_pybuffernd_scores.diminfo[0].strides = __pyx_pybuffernd_scores.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_scores.diminfo[0].shape = __pyx_pybuffernd_scores.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_scores.diminfo[1].strides = __pyx_pybuffernd_scores.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_scores.diminfo[1].shape = __pyx_pybuffernd_scores.rcbuffer->pybuffer.shape[1];

  /* "nltkor/tag/libs/network.pyx":515
 *         """
 *         # pretty straightforward
 *         if self.transitions is None or len(scores) == 1:             # <<<<<<<<<<<<<<
 *             return scores.argmax(1)
 * 
*/
  __pyx_t_2 = (((PyObject *)__pyx_v_self->transitions) == Py_None);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_scores)); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 515, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_3 == 1);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "nltkor/tag/libs/network.pyx":516
 *         # pretty straightforward
 *         if self.transitions is None or len(scores) == 1:
 *             return scores.argmax(1)             # <<<<<<<<<<<<<<
 * 
 *         path_scores = np.empty_like(scores)
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = ((PyObject *)__pyx_v_scores);
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_int_1};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_argmax, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 516, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_TraceReturnValue(__pyx_r, 12, 0, __PYX_ERR(0, 516, __pyx_L1_error));
    goto __pyx_L0;

    /* "nltkor/tag/libs/network.pyx":515
 *         """
 *         # pretty straightforward
 *         if self.transitions is None or len(scores) == 1:             # <<<<<<<<<<<<<<
 *             return scores.argmax(1)
 * 
*/
  }

  /* "nltkor/tag/libs/network.pyx":518
 *             return scores.argmax(1)
 * 
 *         path_scores = np.empty_like(scores)             # <<<<<<<<<<<<<<
 *         #path_backtrack = np.empty_like(scores, np.int64)
 *         path_backtrack = np.empty_like(scores, int)
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_empty_like); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_v_scores)};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_v_path_scores = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/network.pyx":520
 *         path_scores = np.empty_like(scores)
 *         #path_backtrack = np.empty_like(scores, np.int64)
 *         path_backtrack = np.empty_like(scores, int)             # <<<<<<<<<<<<<<
 * 
 *         # now the actual Viterbi algorithm
*/
  __pyx_t_8 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty_like); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
    assert(__pyx_t_8);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_8, ((PyObject *)__pyx_v_scores), ((PyObject *)(&PyLong_Type))};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_v_path_backtrack = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/network.pyx":525
 *         # first, get the scores for each tag at token 0
 *         # the last row of the transitions table has the scores for the first tag
 *         path_scores[0] = scores[0] + self.transitions[-1]             # <<<<<<<<<<<<<<
 * 
 *         output_range = np.arange(self.output_size) # outside loop. Attardi
*/
  __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_scores), 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->transitions), -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyNumber_Add(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely((__Pyx_SetItemInt(__pyx_v_path_scores, 0, __pyx_t_8, long, 1, __Pyx_PyLong_From_long, 0, 0, 0) < 0))) __PYX_ERR(0, 525, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "nltkor/tag/libs/network.pyx":527
 *         path_scores[0] = scores[0] + self.transitions[-1]
 * 
 *         output_range = np.arange(self.output_size) # outside loop. Attardi             # <<<<<<<<<<<<<<
 *         transitions = self.transitions[:-1]        # idem
 * 
*/
  __pyx_t_7 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_arange); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_self->output_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_7);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_4};
    __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  __pyx_v_output_range = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "nltkor/tag/libs/network.pyx":528
 * 
 *         output_range = np.arange(self.output_size) # outside loop. Attardi
 *         transitions = self.transitions[:-1]        # idem             # <<<<<<<<<<<<<<
 * 
 *         cdef int i
*/
  __pyx_t_8 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->transitions), 0, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_v_transitions = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "nltkor/tag/libs/network.pyx":531
 * 
 *         cdef int i
 *         for i in xrange(1, len(scores)):             # <<<<<<<<<<<<<<
 * 
 *             # each line contains the score until each tag t plus the transition to each other tag t'
*/
  __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_scores)); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 531, __pyx_L1_error)
  __pyx_t_9 = __pyx_t_3;
  for (__pyx_t_10 = 1; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
    __pyx_v_i = __pyx_t_10;

    /* "nltkor/tag/libs/network.pyx":534
 * 
 *             # each line contains the score until each tag t plus the transition to each other tag t'
 *             prev_score_and_trans = (path_scores[i - 1] + transitions.T).T             # <<<<<<<<<<<<<<
 * 
 *             # find the previous tag that yielded the max score
*/
    __pyx_t_11 = (__pyx_v_i - 1);
    __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_path_scores, __pyx_t_11, long, 1, __Pyx_PyLong_From_long, 0, 1, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 534, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_transitions, __pyx_mstate_global->__pyx_n_u_T); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 534, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyNumber_Add(__pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 534, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_T); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 534, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_prev_score_and_trans, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "nltkor/tag/libs/network.pyx":537
 * 
 *             # find the previous tag that yielded the max score
 *             path_backtrack[i] = prev_score_and_trans.argmax(0)             # <<<<<<<<<<<<<<
 *             path_scores[i] = prev_score_and_trans[path_backtrack[i],
 *                                                   output_range] + scores[i]
*/
    __pyx_t_4 = __pyx_v_prev_score_and_trans;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_int_0};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_argmax, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 537, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    if (unlikely((__Pyx_SetItemInt(__pyx_v_path_backtrack, __pyx_v_i, __pyx_t_5, int, 1, __Pyx_PyLong_From_int, 0, 1, 0) < 0))) __PYX_ERR(0, 537, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "nltkor/tag/libs/network.pyx":538
 *             # find the previous tag that yielded the max score
 *             path_backtrack[i] = prev_score_and_trans.argmax(0)
 *             path_scores[i] = prev_score_and_trans[path_backtrack[i],             # <<<<<<<<<<<<<<
 *                                                   output_range] + scores[i]
 * 
*/
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_path_backtrack, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);

    /* "nltkor/tag/libs/network.pyx":539
 *             path_backtrack[i] = prev_score_and_trans.argmax(0)
 *             path_scores[i] = prev_score_and_trans[path_backtrack[i],
 *                                                   output_range] + scores[i]             # <<<<<<<<<<<<<<
 * 
 *         # now find the maximum score for the last token and follow the backtrack
*/
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 538, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_output_range);
    __Pyx_GIVEREF(__pyx_v_output_range);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_output_range) != (0)) __PYX_ERR(0, 538, __pyx_L1_error);
    __pyx_t_5 = 0;

    /* "nltkor/tag/libs/network.pyx":538
 *             # find the previous tag that yielded the max score
 *             path_backtrack[i] = prev_score_and_trans.argmax(0)
 *             path_scores[i] = prev_score_and_trans[path_backtrack[i],             # <<<<<<<<<<<<<<
 *                                                   output_range] + scores[i]
 * 
*/
    __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_prev_score_and_trans, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "nltkor/tag/libs/network.pyx":539
 *             path_backtrack[i] = prev_score_and_trans.argmax(0)
 *             path_scores[i] = prev_score_and_trans[path_backtrack[i],
 *                                                   output_range] + scores[i]             # <<<<<<<<<<<<<<
 * 
 *         # now find the maximum score for the last token and follow the backtrack
*/
    __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_scores), __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 539, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 539, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "nltkor/tag/libs/network.pyx":538
 *             # find the previous tag that yielded the max score
 *             path_backtrack[i] = prev_score_and_trans.argmax(0)
 *             path_scores[i] = prev_score_and_trans[path_backtrack[i],             # <<<<<<<<<<<<<<
 *                                                   output_range] + scores[i]
 * 
*/
    if (unlikely((__Pyx_SetItemInt(__pyx_v_path_scores, __pyx_v_i, __pyx_t_8, int, 1, __Pyx_PyLong_From_int, 0, 1, 0) < 0))) __PYX_ERR(0, 538, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }

  /* "nltkor/tag/libs/network.pyx":543
 *         # now find the maximum score for the last token and follow the backtrack
 *         #answer = np.empty(len(scores), dtype=np.int64)
 *         answer = np.empty(len(scores), dtype=int)             # <<<<<<<<<<<<<<
 *         answer[-1] = path_scores[-1].argmax()
 *         self.answer_score = path_scores[-1][answer[-1]]
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_scores)); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 543, __pyx_L1_error)
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_12 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, ((PyObject *)(&PyLong_Type)), __pyx_t_12, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 543, __pyx_L1_error)
    __pyx_t_8 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_7, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_12);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  __pyx_v_answer = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "nltkor/tag/libs/network.pyx":544
 *         #answer = np.empty(len(scores), dtype=np.int64)
 *         answer = np.empty(len(scores), dtype=int)
 *         answer[-1] = path_scores[-1].argmax()             # <<<<<<<<<<<<<<
 *         self.answer_score = path_scores[-1][answer[-1]]
 *         previous_tag = path_backtrack[-1][answer[-1]]
*/
  __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_path_scores, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_7 = __pyx_t_12;
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
    __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_argmax, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  if (unlikely((__Pyx_SetItemInt(__pyx_v_answer, -1L, __pyx_t_8, long, 1, __Pyx_PyLong_From_long, 0, 1, 0) < 0))) __PYX_ERR(0, 544, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "nltkor/tag/libs/network.pyx":545
 *         answer = np.empty(len(scores), dtype=int)
 *         answer[-1] = path_scores[-1].argmax()
 *         self.answer_score = path_scores[-1][answer[-1]]             # <<<<<<<<<<<<<<
 *         previous_tag = path_backtrack[-1][answer[-1]]
 * 
*/
  __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_path_scores, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_answer, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_13 = __Pyx_PyFloat_AsFloat(__pyx_t_7); if (unlikely((__pyx_t_13 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 545, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_self->answer_score = __pyx_t_13;

  /* "nltkor/tag/libs/network.pyx":546
 *         answer[-1] = path_scores[-1].argmax()
 *         self.answer_score = path_scores[-1][answer[-1]]
 *         previous_tag = path_backtrack[-1][answer[-1]]             # <<<<<<<<<<<<<<
 * 
 *         for i in range(len(scores) - 2, 0, -1):
*/
  __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_path_backtrack, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_answer, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_t_12); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_v_previous_tag = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "nltkor/tag/libs/network.pyx":548
 *         previous_tag = path_backtrack[-1][answer[-1]]
 * 
 *         for i in range(len(scores) - 2, 0, -1):             # <<<<<<<<<<<<<<
 *             answer[i] = previous_tag
 *             previous_tag = path_backtrack[i][previous_tag]
*/
  __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_scores)); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 548, __pyx_L1_error)
  for (__pyx_t_10 = (__pyx_t_3 - 2); __pyx_t_10 > 0; __pyx_t_10-=1) {
    __pyx_v_i = __pyx_t_10;

    /* "nltkor/tag/libs/network.pyx":549
 * 
 *         for i in range(len(scores) - 2, 0, -1):
 *             answer[i] = previous_tag             # <<<<<<<<<<<<<<
 *             previous_tag = path_backtrack[i][previous_tag]
 * 
*/
    if (unlikely((__Pyx_SetItemInt(__pyx_v_answer, __pyx_v_i, __pyx_v_previous_tag, int, 1, __Pyx_PyLong_From_int, 0, 1, 0) < 0))) __PYX_ERR(0, 549, __pyx_L1_error)

    /* "nltkor/tag/libs/network.pyx":550
 *         for i in range(len(scores) - 2, 0, -1):
 *             answer[i] = previous_tag
 *             previous_tag = path_backtrack[i][previous_tag]             # <<<<<<<<<<<<<<
 * 
 *         answer[0] = previous_tag
*/
    __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_path_backtrack, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 550, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_12 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_v_previous_tag); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 550, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF_SET(__pyx_v_previous_tag, __pyx_t_12);
    __pyx_t_12 = 0;
  }

  /* "nltkor/tag/libs/network.pyx":552
 *             previous_tag = path_backtrack[i][previous_tag]
 * 
 *         answer[0] = previous_tag             # <<<<<<<<<<<<<<
 *         return answer
 * 
*/
  if (unlikely((__Pyx_SetItemInt(__pyx_v_answer, 0, __pyx_v_previous_tag, long, 1, __Pyx_PyLong_From_long, 0, 0, 0) < 0))) __PYX_ERR(0, 552, __pyx_L1_error)

  /* "nltkor/tag/libs/network.pyx":553
 * 
 *         answer[0] = previous_tag
 *         return answer             # <<<<<<<<<<<<<<
 * 
 *     def set_validation_data(self, list validation_sentences=None,
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_answer);
  __pyx_r = __pyx_v_answer;
  __Pyx_TraceReturnValue(__pyx_r, 147, 0, __PYX_ERR(0, 553, __pyx_L1_error));
  goto __pyx_L0;

  /* "nltkor/tag/libs/network.pyx":507
 *         return True
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     def _viterbi(self, np.ndarray[FLOAT_t, ndim=2] scores):
 *         """
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_12);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_scores.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 507, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._viterbi", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_scores.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_path_scores);
  __Pyx_XDECREF(__pyx_v_path_backtrack);
  __Pyx_XDECREF(__pyx_v_output_range);
  __Pyx_XDECREF(__pyx_v_transitions);
  __Pyx_XDECREF(__pyx_v_prev_score_and_trans);
  __Pyx_XDECREF(__pyx_v_answer);
  __Pyx_XDECREF(__pyx_v_previous_tag);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":555
 *         return answer
 * 
 *     def set_validation_data(self, list validation_sentences=None,             # <<<<<<<<<<<<<<
 *                             list validation_tags=None):
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_21set_validation_data(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_20set_validation_data, "Network.set_validation_data(self, list validation_sentences=None, list validation_tags=None)\nSets the data to be used during validation. If this function is not\ncalled before training, the training data is used to measure performance.\n\n:param validation_sentences: sentences to be used in validation.\n:param validation_tags: tags for the validation sentences.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_21set_validation_data = {"set_validation_data", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_21set_validation_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_20set_validation_data};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_21set_validation_data(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_validation_sentences = 0;
  PyObject *__pyx_v_validation_tags = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_validation_data (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_validation_sentences,&__pyx_mstate_global->__pyx_n_u_validation_tags,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 555, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 555, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 555, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_validation_data", 0) < 0) __PYX_ERR(0, 555, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)Py_None));

      /* "nltkor/tag/libs/network.pyx":556
 * 
 *     def set_validation_data(self, list validation_sentences=None,
 *                             list validation_tags=None):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the data to be used during validation. If this function is not
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 555, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 555, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "nltkor/tag/libs/network.pyx":555
 *         return answer
 * 
 *     def set_validation_data(self, list validation_sentences=None,             # <<<<<<<<<<<<<<
 *                             list validation_tags=None):
 *         """
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)Py_None));

      /* "nltkor/tag/libs/network.pyx":556
 * 
 *     def set_validation_data(self, list validation_sentences=None,
 *                             list validation_tags=None):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the data to be used during validation. If this function is not
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)Py_None));
    }
    __pyx_v_validation_sentences = ((PyObject*)values[0]);
    __pyx_v_validation_tags = ((PyObject*)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_validation_data", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 555, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.set_validation_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_validation_sentences), (&PyList_Type), 1, "validation_sentences", 1))) __PYX_ERR(0, 555, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_validation_tags), (&PyList_Type), 1, "validation_tags", 1))) __PYX_ERR(0, 556, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_20set_validation_data(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), __pyx_v_validation_sentences, __pyx_v_validation_tags);

  /* "nltkor/tag/libs/network.pyx":555
 *         return answer
 * 
 *     def set_validation_data(self, list validation_sentences=None,             # <<<<<<<<<<<<<<
 *                             list validation_tags=None):
 *         """
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_20set_validation_data(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_validation_sentences, PyObject *__pyx_v_validation_tags) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[18]))
  __Pyx_RefNannySetupContext("set_validation_data", 0);
  __Pyx_TraceStartFunc("set_validation_data", __pyx_f[0], 555, 0, 0, 0, __PYX_ERR(0, 555, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":564
 *         :param validation_tags: tags for the validation sentences.
 *         """
 *         self.validation_sentences = validation_sentences             # <<<<<<<<<<<<<<
 *         self.validation_tags = validation_tags
 * 
*/
  __Pyx_INCREF(__pyx_v_validation_sentences);
  __Pyx_GIVEREF(__pyx_v_validation_sentences);
  __Pyx_GOTREF(__pyx_v_self->validation_sentences);
  __Pyx_DECREF(__pyx_v_self->validation_sentences);
  __pyx_v_self->validation_sentences = __pyx_v_validation_sentences;

  /* "nltkor/tag/libs/network.pyx":565
 *         """
 *         self.validation_sentences = validation_sentences
 *         self.validation_tags = validation_tags             # <<<<<<<<<<<<<<
 * 
 *     def set_learning_rate_decay(self, float decay_factor=1.0):
*/
  __Pyx_INCREF(__pyx_v_validation_tags);
  __Pyx_GIVEREF(__pyx_v_validation_tags);
  __Pyx_GOTREF(__pyx_v_self->validation_tags);
  __Pyx_DECREF(__pyx_v_self->validation_tags);
  __pyx_v_self->validation_tags = __pyx_v_validation_tags;

  /* "nltkor/tag/libs/network.pyx":555
 *         return answer
 * 
 *     def set_validation_data(self, list validation_sentences=None,             # <<<<<<<<<<<<<<
 *                             list validation_tags=None):
 *         """
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 555, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 555, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.set_validation_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":567
 *         self.validation_tags = validation_tags
 * 
 *     def set_learning_rate_decay(self, float decay_factor=1.0):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the network to use learning rate decay.
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_23set_learning_rate_decay(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_22set_learning_rate_decay, "Network.set_learning_rate_decay(self, float decay_factor=1.0)\nSets the network to use learning rate decay. \n\nThe learning rate at each iteration t is determined as:\ninitial_rate / (1 + t * decay_factor)\n\nwith t starting from 0");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_23set_learning_rate_decay = {"set_learning_rate_decay", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_23set_learning_rate_decay, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_22set_learning_rate_decay};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_23set_learning_rate_decay(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  float __pyx_v_decay_factor;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_learning_rate_decay (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_decay_factor,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 567, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 567, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_learning_rate_decay", 0) < 0) __PYX_ERR(0, 567, __pyx_L3_error)
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 567, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_decay_factor = __Pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_decay_factor == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 567, __pyx_L3_error)
    } else {
      __pyx_v_decay_factor = ((float)1.0);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_learning_rate_decay", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 567, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.set_learning_rate_decay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_22set_learning_rate_decay(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), __pyx_v_decay_factor);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_22set_learning_rate_decay(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, float __pyx_v_decay_factor) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[19]))
  __Pyx_RefNannySetupContext("set_learning_rate_decay", 0);
  __Pyx_TraceStartFunc("set_learning_rate_decay", __pyx_f[0], 567, 0, 0, 0, __PYX_ERR(0, 567, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":576
 *         with t starting from 0
 *         """
 *         self.use_learning_rate_decay = True             # <<<<<<<<<<<<<<
 *         self.decay_factor = decay_factor
 * 
*/
  __Pyx_INCREF(Py_True);
  __Pyx_GIVEREF(Py_True);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->use_learning_rate_decay);
  __Pyx_DECREF((PyObject *)__pyx_v_self->use_learning_rate_decay);
  __pyx_v_self->use_learning_rate_decay = ((PyLongObject *)Py_True);

  /* "nltkor/tag/libs/network.pyx":577
 *         """
 *         self.use_learning_rate_decay = True
 *         self.decay_factor = decay_factor             # <<<<<<<<<<<<<<
 * 
 *     def decrease_learning_rates(self, epoch):
*/
  __pyx_v_self->decay_factor = __pyx_v_decay_factor;

  /* "nltkor/tag/libs/network.pyx":567
 *         self.validation_tags = validation_tags
 * 
 *     def set_learning_rate_decay(self, float decay_factor=1.0):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the network to use learning rate decay.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 567, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 567, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.set_learning_rate_decay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":579
 *         self.decay_factor = decay_factor
 * 
 *     def decrease_learning_rates(self, epoch):             # <<<<<<<<<<<<<<
 *         """
 *         Apply the learning rate decay, if the network was configured to use it.
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_25decrease_learning_rates(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_24decrease_learning_rates, "Network.decrease_learning_rates(self, epoch)\nApply the learning rate decay, if the network was configured to use it.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_25decrease_learning_rates = {"decrease_learning_rates", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_25decrease_learning_rates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_24decrease_learning_rates};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_25decrease_learning_rates(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_epoch = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decrease_learning_rates (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_epoch,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 579, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 579, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "decrease_learning_rates", 0) < 0) __PYX_ERR(0, 579, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("decrease_learning_rates", 1, 1, 1, i); __PYX_ERR(0, 579, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 579, __pyx_L3_error)
    }
    __pyx_v_epoch = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("decrease_learning_rates", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 579, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.decrease_learning_rates", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_24decrease_learning_rates(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), __pyx_v_epoch);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_24decrease_learning_rates(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_epoch) {
  PyObject *__pyx_v_factor = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  float __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[20]))
  __Pyx_RefNannySetupContext("decrease_learning_rates", 0);
  __Pyx_TraceStartFunc("decrease_learning_rates", __pyx_f[0], 579, 0, 0, 0, __PYX_ERR(0, 579, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":583
 *         Apply the learning rate decay, if the network was configured to use it.
 *         """
 *         if not self.use_learning_rate_decay or epoch == 0:             # <<<<<<<<<<<<<<
 *             return
 * 
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->use_learning_rate_decay)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 583, __pyx_L1_error)
  __pyx_t_3 = (!__pyx_t_2);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_epoch, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 583, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "nltkor/tag/libs/network.pyx":584
 *         """
 *         if not self.use_learning_rate_decay or epoch == 0:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         # multiplying the last rate by this adjustment is equivalent to
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "nltkor/tag/libs/network.pyx":583
 *         Apply the learning rate decay, if the network was configured to use it.
 *         """
 *         if not self.use_learning_rate_decay or epoch == 0:             # <<<<<<<<<<<<<<
 *             return
 * 
*/
  }

  /* "nltkor/tag/libs/network.pyx":589
 *         # initial_rate / (1 + t * decay_factor)
 *         # and we don't need to store the initial rates
 *         factor = (1.0 + (epoch - 1) * self.decay_factor) / (1 + epoch * self.decay_factor)             # <<<<<<<<<<<<<<
 *         self.learning_rate *= factor
 *         self.learning_rate_features *= factor
*/
  __pyx_t_4 = __Pyx_PyLong_SubtractObjC(__pyx_v_epoch, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_self->decay_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyNumber_Multiply(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyFloat_AddCObj(__pyx_mstate_global->__pyx_float_1_0, __pyx_t_6, 1.0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_self->decay_factor); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyNumber_Multiply(__pyx_v_epoch, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyLong_AddCObj(__pyx_mstate_global->__pyx_int_1, __pyx_t_4, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_factor = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/network.pyx":590
 *         # and we don't need to store the initial rates
 *         factor = (1.0 + (epoch - 1) * self.decay_factor) / (1 + epoch * self.decay_factor)
 *         self.learning_rate *= factor             # <<<<<<<<<<<<<<
 *         self.learning_rate_features *= factor
 *         if self.transitions is not None:
*/
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->learning_rate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_t_4, __pyx_v_factor); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_PyFloat_AsFloat(__pyx_t_6); if (unlikely((__pyx_t_7 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 590, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_self->learning_rate = __pyx_t_7;

  /* "nltkor/tag/libs/network.pyx":591
 *         factor = (1.0 + (epoch - 1) * self.decay_factor) / (1 + epoch * self.decay_factor)
 *         self.learning_rate *= factor
 *         self.learning_rate_features *= factor             # <<<<<<<<<<<<<<
 *         if self.transitions is not None:
 *             self.learning_rate_trans *= factor
*/
  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_self->learning_rate_features); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyNumber_InPlaceMultiply(__pyx_t_6, __pyx_v_factor); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_7 = __Pyx_PyFloat_AsFloat(__pyx_t_4); if (unlikely((__pyx_t_7 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 591, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_self->learning_rate_features = __pyx_t_7;

  /* "nltkor/tag/libs/network.pyx":592
 *         self.learning_rate *= factor
 *         self.learning_rate_features *= factor
 *         if self.transitions is not None:             # <<<<<<<<<<<<<<
 *             self.learning_rate_trans *= factor
 * 
*/
  __pyx_t_1 = (((PyObject *)__pyx_v_self->transitions) != Py_None);
  if (__pyx_t_1) {

    /* "nltkor/tag/libs/network.pyx":593
 *         self.learning_rate_features *= factor
 *         if self.transitions is not None:
 *             self.learning_rate_trans *= factor             # <<<<<<<<<<<<<<
 * 
 *     def train(self, list sentences, list tags,
*/
    __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->learning_rate_trans); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 593, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_t_4, __pyx_v_factor); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 593, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_7 = __Pyx_PyFloat_AsFloat(__pyx_t_6); if (unlikely((__pyx_t_7 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 593, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_self->learning_rate_trans = __pyx_t_7;

    /* "nltkor/tag/libs/network.pyx":592
 *         self.learning_rate *= factor
 *         self.learning_rate_features *= factor
 *         if self.transitions is not None:             # <<<<<<<<<<<<<<
 *             self.learning_rate_trans *= factor
 * 
*/
  }

  /* "nltkor/tag/libs/network.pyx":579
 *         self.decay_factor = decay_factor
 * 
 *     def decrease_learning_rates(self, epoch):             # <<<<<<<<<<<<<<
 *         """
 *         Apply the learning rate decay, if the network was configured to use it.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 579, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 579, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.decrease_learning_rates", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_factor);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":595
 *             self.learning_rate_trans *= factor
 * 
 *     def train(self, list sentences, list tags,             # <<<<<<<<<<<<<<
 *               int epochs, int epochs_between_reports=0,
 *               float desired_accuracy=0):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_27train(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_26train, "Network.train(self, list sentences, list tags, int epochs, int epochs_between_reports=0, float desired_accuracy=0)\nTrains the network to tag sentences.\n\n:param sentences: a list of 2-dim numpy arrays, where each item \n    encodes a sentence. Each item in a sentence has the \n    indices to its features.\n:param tags: a list of 1-dim numpy arrays, where each item has\n    the tags of the sentences.\n:param epochs: number of training epochs\n:param epochs_between_reports: number of epochs to wait between\n    reports about the training performance. 0 means no reports.\n:param desired_accuracy: training stops if the desired accuracy\n    is reached. Ignored if 0.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_27train = {"train", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_27train, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_26train};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_27train(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_sentences = 0;
  PyObject *__pyx_v_tags = 0;
  int __pyx_v_epochs;
  int __pyx_v_epochs_between_reports;
  float __pyx_v_desired_accuracy;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("train (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sentences,&__pyx_mstate_global->__pyx_n_u_tags,&__pyx_mstate_global->__pyx_n_u_epochs,&__pyx_mstate_global->__pyx_n_u_epochs_between_reports,&__pyx_mstate_global->__pyx_n_u_desired_accuracy,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 595, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 595, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 595, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 595, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 595, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 595, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "train", 0) < 0) __PYX_ERR(0, 595, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("train", 0, 3, 5, i); __PYX_ERR(0, 595, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 595, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 595, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 595, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 595, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 595, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_sentences = ((PyObject*)values[0]);
    __pyx_v_tags = ((PyObject*)values[1]);
    __pyx_v_epochs = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_epochs == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 596, __pyx_L3_error)
    if (values[3]) {
      __pyx_v_epochs_between_reports = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_epochs_between_reports == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 596, __pyx_L3_error)
    } else {
      __pyx_v_epochs_between_reports = ((int)0);
    }
    if (values[4]) {
      __pyx_v_desired_accuracy = __Pyx_PyFloat_AsFloat(values[4]); if (unlikely((__pyx_v_desired_accuracy == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error)
    } else {
      __pyx_v_desired_accuracy = ((float)0.0);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("train", 0, 3, 5, __pyx_nargs); __PYX_ERR(0, 595, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.train", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sentences), (&PyList_Type), 1, "sentences", 1))) __PYX_ERR(0, 595, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tags), (&PyList_Type), 1, "tags", 1))) __PYX_ERR(0, 595, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_26train(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), __pyx_v_sentences, __pyx_v_tags, __pyx_v_epochs, __pyx_v_epochs_between_reports, __pyx_v_desired_accuracy);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6nltkor_3tag_4libs_7network_7Network_5train_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "nltkor/tag/libs/network.pyx":617
 *         last_accuracy = 0
 *         last_error = np.Infinity
 *         self.num_tokens = sum(len(sent) for sent in sentences)             # <<<<<<<<<<<<<<
 * 
 *         if self.validation_sentences is None:
*/

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_5train_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr *)__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 617, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6nltkor_3tag_4libs_7network_7Network_5train_2generator1, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[21]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_train_locals_genexpr, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network); if (unlikely(!gen)) __PYX_ERR(0, 617, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.train.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6nltkor_3tag_4libs_7network_7Network_5train_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsGen
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_TraceStartGen("genexpr", __pyx_f[0], 617, 0, 0, 0, __PYX_ERR(0, 617, __pyx_L1_error));
    __Pyx_TraceReturnValue(Py_None, 0, 0, __PYX_ERR(0, 617, __pyx_L1_error));
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  __Pyx_TraceStartGen("genexpr", __pyx_f[0], 617, 0, 0, 0, __PYX_ERR(0, 617, __pyx_L1_error));
  if (unlikely(__pyx_sent_value != Py_None)) {
    if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started generator");
    __PYX_ERR(0, 617, __pyx_L1_error)
  }
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 617, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_genexpr_arg_0 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 617, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 617, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2);
    ++__pyx_t_2;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 617, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_sent);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_sent, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_4 = PyObject_Length(__pyx_cur_scope->__pyx_v_sent); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 617, __pyx_L1_error)
    __pyx_t_3 = PyLong_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 617, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_TraceYield(__pyx_r, 0, __PYX_ERR(0, 617, __pyx_L1_error));
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __Pyx_TraceResumeGen("genexpr", __pyx_f[0], 617, 0, __PYX_ERR(0, 617, __pyx_L1_error));
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 617, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
  __Pyx_TraceReturnValue(Py_None, 0, 0, __PYX_ERR(0, 617, __pyx_L1_error));

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_TraceException(__pyx_lineno, 0, 0);
    __Pyx_Generator_Replace_StopIteration(0);
    __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_TraceExceptionUnwind(0, 0);
  }
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":595
 *             self.learning_rate_trans *= factor
 * 
 *     def train(self, list sentences, list tags,             # <<<<<<<<<<<<<<
 *               int epochs, int epochs_between_reports=0,
 *               float desired_accuracy=0):
*/

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_26train(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_sentences, PyObject *__pyx_v_tags, int __pyx_v_epochs, int __pyx_v_epochs_between_reports, float __pyx_v_desired_accuracy) {
  PyObject *__pyx_v_logger = NULL;
  double __pyx_v_top_accuracy;
  double __pyx_v_last_accuracy;
  PyObject *__pyx_v_last_error = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_gb_6nltkor_3tag_4libs_7network_7Network_5train_2generator1 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  float __pyx_t_10;
  float __pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[22]))
  __Pyx_RefNannySetupContext("train", 0);
  __Pyx_TraceStartFunc("train", __pyx_f[0], 595, 0, 0, 0, __PYX_ERR(0, 595, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":612
 *             is reached. Ignored if 0.
 *         """
 *         logger = logging.getLogger("Logger")             # <<<<<<<<<<<<<<
 *         logger.info("Training for up to %d epochs" % epochs)
 *         top_accuracy = 0
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_logging); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_getLogger); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Logger};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_logger = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":613
 *         """
 *         logger = logging.getLogger("Logger")
 *         logger.info("Training for up to %d epochs" % epochs)             # <<<<<<<<<<<<<<
 *         top_accuracy = 0
 *         last_accuracy = 0
*/
  __pyx_t_4 = __pyx_v_logger;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_epochs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_Training_for_up_to_d_epochs, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_info, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 613, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":614
 *         logger = logging.getLogger("Logger")
 *         logger.info("Training for up to %d epochs" % epochs)
 *         top_accuracy = 0             # <<<<<<<<<<<<<<
 *         last_accuracy = 0
 *         last_error = np.Infinity
*/
  __pyx_v_top_accuracy = 0.0;

  /* "nltkor/tag/libs/network.pyx":615
 *         logger.info("Training for up to %d epochs" % epochs)
 *         top_accuracy = 0
 *         last_accuracy = 0             # <<<<<<<<<<<<<<
 *         last_error = np.Infinity
 *         self.num_tokens = sum(len(sent) for sent in sentences)
*/
  __pyx_v_last_accuracy = 0.0;

  /* "nltkor/tag/libs/network.pyx":616
 *         top_accuracy = 0
 *         last_accuracy = 0
 *         last_error = np.Infinity             # <<<<<<<<<<<<<<
 *         self.num_tokens = sum(len(sent) for sent in sentences)
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Infinity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_last_error = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":617
 *         last_accuracy = 0
 *         last_error = np.Infinity
 *         self.num_tokens = sum(len(sent) for sent in sentences)             # <<<<<<<<<<<<<<
 * 
 *         if self.validation_sentences is None:
*/
  __pyx_t_1 = NULL;
  __Pyx_INCREF(__pyx_builtin_sum);
  __pyx_t_4 = __pyx_builtin_sum; 
  __pyx_t_2 = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_5train_genexpr(NULL, __pyx_v_sentences); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_2};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 617, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_6 = __Pyx_PyLong_As_int(__pyx_t_3); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 617, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->num_tokens = __pyx_t_6;

  /* "nltkor/tag/libs/network.pyx":619
 *         self.num_tokens = sum(len(sent) for sent in sentences)
 * 
 *         if self.validation_sentences is None:             # <<<<<<<<<<<<<<
 *             self.validation_sentences = sentences
 *             self.validation_tags = tags
*/
  __pyx_t_7 = (__pyx_v_self->validation_sentences == ((PyObject*)Py_None));
  if (__pyx_t_7) {

    /* "nltkor/tag/libs/network.pyx":620
 * 
 *         if self.validation_sentences is None:
 *             self.validation_sentences = sentences             # <<<<<<<<<<<<<<
 *             self.validation_tags = tags
 * 
*/
    __Pyx_INCREF(__pyx_v_sentences);
    __Pyx_GIVEREF(__pyx_v_sentences);
    __Pyx_GOTREF(__pyx_v_self->validation_sentences);
    __Pyx_DECREF(__pyx_v_self->validation_sentences);
    __pyx_v_self->validation_sentences = __pyx_v_sentences;

    /* "nltkor/tag/libs/network.pyx":621
 *         if self.validation_sentences is None:
 *             self.validation_sentences = sentences
 *             self.validation_tags = tags             # <<<<<<<<<<<<<<
 * 
 *         for i in range(epochs):
*/
    __Pyx_INCREF(__pyx_v_tags);
    __Pyx_GIVEREF(__pyx_v_tags);
    __Pyx_GOTREF(__pyx_v_self->validation_tags);
    __Pyx_DECREF(__pyx_v_self->validation_tags);
    __pyx_v_self->validation_tags = __pyx_v_tags;

    /* "nltkor/tag/libs/network.pyx":619
 *         self.num_tokens = sum(len(sent) for sent in sentences)
 * 
 *         if self.validation_sentences is None:             # <<<<<<<<<<<<<<
 *             self.validation_sentences = sentences
 *             self.validation_tags = tags
*/
  }

  /* "nltkor/tag/libs/network.pyx":623
 *             self.validation_tags = tags
 * 
 *         for i in range(epochs):             # <<<<<<<<<<<<<<
 *             self.decrease_learning_rates(i)
 *             self._train_epoch(sentences, tags)
*/
  __pyx_t_4 = NULL;
  __Pyx_INCREF(__pyx_builtin_range);
  __pyx_t_2 = __pyx_builtin_range; 
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_epochs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_1};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 623, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 623, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 623, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 623, __pyx_L1_error)
          #endif
          if (__pyx_t_8 >= __pyx_temp) break;
        }
        __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_8);
        ++__pyx_t_8;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 623, __pyx_L1_error)
          #endif
          if (__pyx_t_8 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8));
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8);
        #endif
        ++__pyx_t_8;
      }
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 623, __pyx_L1_error)
    } else {
      __pyx_t_3 = __pyx_t_9(__pyx_t_2);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 623, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/network.pyx":624
 * 
 *         for i in range(epochs):
 *             self.decrease_learning_rates(i)             # <<<<<<<<<<<<<<
 *             self._train_epoch(sentences, tags)
 *             self._validate()
*/
    __pyx_t_1 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_i};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_decrease_learning_rates, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 624, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "nltkor/tag/libs/network.pyx":625
 *         for i in range(epochs):
 *             self.decrease_learning_rates(i)
 *             self._train_epoch(sentences, tags)             # <<<<<<<<<<<<<<
 *             self._validate()
 * 
*/
    __pyx_t_1 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_sentences, __pyx_v_tags};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_train_epoch, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 625, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "nltkor/tag/libs/network.pyx":626
 *             self.decrease_learning_rates(i)
 *             self._train_epoch(sentences, tags)
 *             self._validate()             # <<<<<<<<<<<<<<
 * 
 *             # normalize error
*/
    __pyx_t_1 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_validate, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 626, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "nltkor/tag/libs/network.pyx":629
 * 
 *             # normalize error
 *             self.error = self.error / self.num_tokens if self.num_tokens else np.Infinity             # <<<<<<<<<<<<<<
 * 
 *             # Attardi: save model
*/
    __pyx_t_7 = (__pyx_v_self->num_tokens != 0);
    if (__pyx_t_7) {
      if (unlikely(__pyx_v_self->num_tokens == 0)) {
        PyErr_SetString(PyExc_ZeroDivisionError, "float division");
        __PYX_ERR(0, 629, __pyx_L1_error)
      }
      __pyx_t_10 = (__pyx_v_self->error / ((float)__pyx_v_self->num_tokens));
    } else {
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Infinity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_11 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_11 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_10 = __pyx_t_11;
    }
    __pyx_v_self->error = __pyx_t_10;

    /* "nltkor/tag/libs/network.pyx":632
 * 
 *             # Attardi: save model
 *             if self.accuracy > top_accuracy:             # <<<<<<<<<<<<<<
 *                 top_accuracy = self.accuracy
 *                 self.save()
*/
    __pyx_t_7 = (__pyx_v_self->accuracy > __pyx_v_top_accuracy);
    if (__pyx_t_7) {

      /* "nltkor/tag/libs/network.pyx":633
 *             # Attardi: save model
 *             if self.accuracy > top_accuracy:
 *                 top_accuracy = self.accuracy             # <<<<<<<<<<<<<<
 *                 self.save()
 *                 logger.debug("Saved model")
*/
      __pyx_t_10 = __pyx_v_self->accuracy;
      __pyx_v_top_accuracy = __pyx_t_10;

      /* "nltkor/tag/libs/network.pyx":634
 *             if self.accuracy > top_accuracy:
 *                 top_accuracy = self.accuracy
 *                 self.save()             # <<<<<<<<<<<<<<
 *                 logger.debug("Saved model")
 *             elif self.use_learning_rate_decay:
*/
      __pyx_t_3 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_save, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "nltkor/tag/libs/network.pyx":635
 *                 top_accuracy = self.accuracy
 *                 self.save()
 *                 logger.debug("Saved model")             # <<<<<<<<<<<<<<
 *             elif self.use_learning_rate_decay:
 *                 # this iteration didn't bring improvements; load the last saved model
*/
      __pyx_t_3 = __pyx_v_logger;
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Saved_model};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_debug, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "nltkor/tag/libs/network.pyx":632
 * 
 *             # Attardi: save model
 *             if self.accuracy > top_accuracy:             # <<<<<<<<<<<<<<
 *                 top_accuracy = self.accuracy
 *                 self.save()
*/
      goto __pyx_L6;
    }

    /* "nltkor/tag/libs/network.pyx":636
 *                 self.save()
 *                 logger.debug("Saved model")
 *             elif self.use_learning_rate_decay:             # <<<<<<<<<<<<<<
 *                 # this iteration didn't bring improvements; load the last saved model
 *                 # before continuing training with a lower rate
*/
    __pyx_t_7 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->use_learning_rate_decay)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 636, __pyx_L1_error)
    if (__pyx_t_7) {

      /* "nltkor/tag/libs/network.pyx":639
 *                 # this iteration didn't bring improvements; load the last saved model
 *                 # before continuing training with a lower rate
 *                 self._load_parameters()             # <<<<<<<<<<<<<<
 * 
 *             if (epochs_between_reports > 0 and i % epochs_between_reports == 0) \
*/
      __pyx_t_3 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_load_parameters, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 639, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "nltkor/tag/libs/network.pyx":636
 *                 self.save()
 *                 logger.debug("Saved model")
 *             elif self.use_learning_rate_decay:             # <<<<<<<<<<<<<<
 *                 # this iteration didn't bring improvements; load the last saved model
 *                 # before continuing training with a lower rate
*/
    }
    __pyx_L6:;

    /* "nltkor/tag/libs/network.pyx":641
 *                 self._load_parameters()
 * 
 *             if (epochs_between_reports > 0 and i % epochs_between_reports == 0) \             # <<<<<<<<<<<<<<
 *                 or self.accuracy >= desired_accuracy > 0 \
 *                 or (self.accuracy < last_accuracy and self.error > last_error):
*/
    __pyx_t_12 = (__pyx_v_epochs_between_reports > 0);
    if (!__pyx_t_12) {
      goto __pyx_L9_next_or;
    } else {
    }
    __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_epochs_between_reports); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 641, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyNumber_Remainder(__pyx_v_i, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_12 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_3, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 641, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!__pyx_t_12) {
    } else {
      __pyx_t_7 = __pyx_t_12;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_L9_next_or:;

    /* "nltkor/tag/libs/network.pyx":642
 * 
 *             if (epochs_between_reports > 0 and i % epochs_between_reports == 0) \
 *                 or self.accuracy >= desired_accuracy > 0 \             # <<<<<<<<<<<<<<
 *                 or (self.accuracy < last_accuracy and self.error > last_error):
 * 
*/
    __pyx_t_12 = (__pyx_v_self->accuracy >= __pyx_v_desired_accuracy);
    if (__pyx_t_12) {
      __pyx_t_12 = (__pyx_v_desired_accuracy > 0.0);
    }
    if (!__pyx_t_12) {
    } else {
      __pyx_t_7 = __pyx_t_12;
      goto __pyx_L8_bool_binop_done;
    }

    /* "nltkor/tag/libs/network.pyx":643
 *             if (epochs_between_reports > 0 and i % epochs_between_reports == 0) \
 *                 or self.accuracy >= desired_accuracy > 0 \
 *                 or (self.accuracy < last_accuracy and self.error > last_error):             # <<<<<<<<<<<<<<
 * 
 *                 self._print_epoch_report(i + 1)
*/
    __pyx_t_12 = (__pyx_v_self->accuracy < __pyx_v_last_accuracy);
    if (__pyx_t_12) {
    } else {
      __pyx_t_7 = __pyx_t_12;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 643, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_v_last_error, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 643, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 643, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = __pyx_t_12;
    __pyx_L8_bool_binop_done:;

    /* "nltkor/tag/libs/network.pyx":641
 *                 self._load_parameters()
 * 
 *             if (epochs_between_reports > 0 and i % epochs_between_reports == 0) \             # <<<<<<<<<<<<<<
 *                 or self.accuracy >= desired_accuracy > 0 \
 *                 or (self.accuracy < last_accuracy and self.error > last_error):
*/
    if (__pyx_t_7) {

      /* "nltkor/tag/libs/network.pyx":645
 *                 or (self.accuracy < last_accuracy and self.error > last_error):
 * 
 *                 self._print_epoch_report(i + 1)             # <<<<<<<<<<<<<<
 * 
 *                 if self.accuracy >= desired_accuracy > 0\
*/
      __pyx_t_3 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyLong_AddObjC(__pyx_v_i, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 645, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_print_epoch_report, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 645, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "nltkor/tag/libs/network.pyx":647
 *                 self._print_epoch_report(i + 1)
 * 
 *                 if self.accuracy >= desired_accuracy > 0\             # <<<<<<<<<<<<<<
 *                         or (self.error > last_error and self.accuracy < last_accuracy):
 *                     break
*/
      __pyx_t_12 = (__pyx_v_self->accuracy >= __pyx_v_desired_accuracy);
      if (__pyx_t_12) {
        __pyx_t_12 = (__pyx_v_desired_accuracy > 0.0);
      }
      if (!__pyx_t_12) {
      } else {
        __pyx_t_7 = __pyx_t_12;
        goto __pyx_L14_bool_binop_done;
      }

      /* "nltkor/tag/libs/network.pyx":648
 * 
 *                 if self.accuracy >= desired_accuracy > 0\
 *                         or (self.error > last_error and self.accuracy < last_accuracy):             # <<<<<<<<<<<<<<
 *                     break
 * 
*/
      __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 648, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_v_last_error, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 648, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 648, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_12) {
      } else {
        __pyx_t_7 = __pyx_t_12;
        goto __pyx_L14_bool_binop_done;
      }
      __pyx_t_12 = (__pyx_v_self->accuracy < __pyx_v_last_accuracy);
      __pyx_t_7 = __pyx_t_12;
      __pyx_L14_bool_binop_done:;

      /* "nltkor/tag/libs/network.pyx":647
 *                 self._print_epoch_report(i + 1)
 * 
 *                 if self.accuracy >= desired_accuracy > 0\             # <<<<<<<<<<<<<<
 *                         or (self.error > last_error and self.accuracy < last_accuracy):
 *                     break
*/
      if (__pyx_t_7) {

        /* "nltkor/tag/libs/network.pyx":649
 *                 if self.accuracy >= desired_accuracy > 0\
 *                         or (self.error > last_error and self.accuracy < last_accuracy):
 *                     break             # <<<<<<<<<<<<<<
 * 
 *             last_accuracy = self.accuracy
*/
        goto __pyx_L5_break;

        /* "nltkor/tag/libs/network.pyx":647
 *                 self._print_epoch_report(i + 1)
 * 
 *                 if self.accuracy >= desired_accuracy > 0\             # <<<<<<<<<<<<<<
 *                         or (self.error > last_error and self.accuracy < last_accuracy):
 *                     break
*/
      }

      /* "nltkor/tag/libs/network.pyx":641
 *                 self._load_parameters()
 * 
 *             if (epochs_between_reports > 0 and i % epochs_between_reports == 0) \             # <<<<<<<<<<<<<<
 *                 or self.accuracy >= desired_accuracy > 0 \
 *                 or (self.accuracy < last_accuracy and self.error > last_error):
*/
    }

    /* "nltkor/tag/libs/network.pyx":651
 *                     break
 * 
 *             last_accuracy = self.accuracy             # <<<<<<<<<<<<<<
 *             last_error = self.error
 * 
*/
    __pyx_t_10 = __pyx_v_self->accuracy;
    __pyx_v_last_accuracy = __pyx_t_10;

    /* "nltkor/tag/libs/network.pyx":652
 * 
 *             last_accuracy = self.accuracy
 *             last_error = self.error             # <<<<<<<<<<<<<<
 * 
 *         self.num_tokens = 0
*/
    __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_last_error, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/network.pyx":623
 *             self.validation_tags = tags
 * 
 *         for i in range(epochs):             # <<<<<<<<<<<<<<
 *             self.decrease_learning_rates(i)
 *             self._train_epoch(sentences, tags)
*/
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  goto __pyx_L17_for_end;
  __pyx_L5_break:;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  goto __pyx_L17_for_end;
  __pyx_L17_for_end:;

  /* "nltkor/tag/libs/network.pyx":654
 *             last_error = self.error
 * 
 *         self.num_tokens = 0             # <<<<<<<<<<<<<<
 * 
 *     def _print_epoch_report(self, int num):
*/
  __pyx_v_self->num_tokens = 0;

  /* "nltkor/tag/libs/network.pyx":595
 *             self.learning_rate_trans *= factor
 * 
 *     def train(self, list sentences, list tags,             # <<<<<<<<<<<<<<
 *               int epochs, int epochs_between_reports=0,
 *               float desired_accuracy=0):
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 595, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 595, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.train", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_logger);
  __Pyx_XDECREF(__pyx_v_last_error);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_gb_6nltkor_3tag_4libs_7network_7Network_5train_2generator1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":656
 *         self.num_tokens = 0
 * 
 *     def _print_epoch_report(self, int num):             # <<<<<<<<<<<<<<
 *         """
 *         Reports the status of the network in the given training
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_29_print_epoch_report(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_28_print_epoch_report, "Network._print_epoch_report(self, int num)\nReports the status of the network in the given training\nepoch, including error and accuracy.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_29_print_epoch_report = {"_print_epoch_report", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_29_print_epoch_report, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_28_print_epoch_report};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_29_print_epoch_report(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  int __pyx_v_num;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_print_epoch_report (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_num,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 656, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 656, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_print_epoch_report", 0) < 0) __PYX_ERR(0, 656, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_print_epoch_report", 1, 1, 1, i); __PYX_ERR(0, 656, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 656, __pyx_L3_error)
    }
    __pyx_v_num = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_num == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 656, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_print_epoch_report", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 656, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._print_epoch_report", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_28_print_epoch_report(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), __pyx_v_num);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_28_print_epoch_report(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, int __pyx_v_num) {
  PyObject *__pyx_v_logger = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10[9];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[23]))
  __Pyx_RefNannySetupContext("_print_epoch_report", 0);
  __Pyx_TraceStartFunc("_print_epoch_report", __pyx_f[0], 656, 0, 0, 0, __PYX_ERR(0, 656, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":661
 *         epoch, including error and accuracy.
 *         """
 *         logger = logging.getLogger("Logger")             # <<<<<<<<<<<<<<
 *         logger.info("%d epochs   Error: %f   Accuracy: %f   " \
 *             "%d corrections skipped   " \
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_logging); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_getLogger); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Logger};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_logger = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":662
 *         """
 *         logger = logging.getLogger("Logger")
 *         logger.info("%d epochs   Error: %f   Accuracy: %f   " \             # <<<<<<<<<<<<<<
 *             "%d corrections skipped   " \
 *             "learning rate: %f" % (num,
*/
  __pyx_t_4 = __pyx_v_logger;
  __Pyx_INCREF(__pyx_t_4);

  /* "nltkor/tag/libs/network.pyx":664
 *         logger.info("%d epochs   Error: %f   Accuracy: %f   " \
 *             "%d corrections skipped   " \
 *             "learning rate: %f" % (num,             # <<<<<<<<<<<<<<
 *                                    self.error,
 *                                    self.accuracy,
*/
  __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_num, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "nltkor/tag/libs/network.pyx":665
 *             "%d corrections skipped   " \
 *             "learning rate: %f" % (num,
 *                                    self.error,             # <<<<<<<<<<<<<<
 *                                    self.accuracy,
 *                                    self.skips,
*/
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_Format(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_f); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":666
 *             "learning rate: %f" % (num,
 *                                    self.error,
 *                                    self.accuracy,             # <<<<<<<<<<<<<<
 *                                    self.skips,
 *                                    self.learning_rate))
*/
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->accuracy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyObject_Format(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_f); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":667
 *                                    self.error,
 *                                    self.accuracy,
 *                                    self.skips,             # <<<<<<<<<<<<<<
 *                                    self.learning_rate))
 * 
*/
  __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_v_self->skips, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "nltkor/tag/libs/network.pyx":668
 *                                    self.accuracy,
 *                                    self.skips,
 *                                    self.learning_rate))             # <<<<<<<<<<<<<<
 * 
 *     def _train_epoch(self, list sentences, list tags):
*/
  __pyx_t_8 = PyFloat_FromDouble(__pyx_v_self->learning_rate); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_Format(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_f); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_10[0] = __pyx_t_2;
  __pyx_t_10[1] = __pyx_mstate_global->__pyx_kp_u_epochs_Error;
  __pyx_t_10[2] = __pyx_t_6;
  __pyx_t_10[3] = __pyx_mstate_global->__pyx_kp_u_Accuracy;
  __pyx_t_10[4] = __pyx_t_7;
  __pyx_t_10[5] = __pyx_mstate_global->__pyx_kp_u__3;
  __pyx_t_10[6] = __pyx_t_3;
  __pyx_t_10[7] = __pyx_mstate_global->__pyx_kp_u_corrections_skipped_learning_ra;
  __pyx_t_10[8] = __pyx_t_9;

  /* "nltkor/tag/libs/network.pyx":662
 *         """
 *         logger = logging.getLogger("Logger")
 *         logger.info("%d epochs   Error: %f   Accuracy: %f   " \             # <<<<<<<<<<<<<<
 *             "%d corrections skipped   " \
 *             "learning rate: %f" % (num,
*/
  __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_10, 9, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 17 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 3 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 38 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9));
  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_8};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_info, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":656
 *         self.num_tokens = 0
 * 
 *     def _print_epoch_report(self, int num):             # <<<<<<<<<<<<<<
 *         """
 *         Reports the status of the network in the given training
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 656, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 656, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._print_epoch_report", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_logger);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":670
 *                                    self.learning_rate))
 * 
 *     def _train_epoch(self, list sentences, list tags):             # <<<<<<<<<<<<<<
 *         """
 *         Trains for one epoch with all examples.
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_31_train_epoch(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_30_train_epoch, "Network._train_epoch(self, list sentences, list tags)\nTrains for one epoch with all examples.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_31_train_epoch = {"_train_epoch", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_31_train_epoch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_30_train_epoch};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_31_train_epoch(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_sentences = 0;
  PyObject *__pyx_v_tags = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_train_epoch (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sentences,&__pyx_mstate_global->__pyx_n_u_tags,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 670, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 670, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 670, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_train_epoch", 0) < 0) __PYX_ERR(0, 670, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_train_epoch", 1, 2, 2, i); __PYX_ERR(0, 670, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 670, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 670, __pyx_L3_error)
    }
    __pyx_v_sentences = ((PyObject*)values[0]);
    __pyx_v_tags = ((PyObject*)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_train_epoch", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 670, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._train_epoch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sentences), (&PyList_Type), 1, "sentences", 1))) __PYX_ERR(0, 670, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tags), (&PyList_Type), 1, "tags", 1))) __PYX_ERR(0, 670, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_30_train_epoch(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), __pyx_v_sentences, __pyx_v_tags);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_30_train_epoch(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_sentences, PyObject *__pyx_v_tags) {
  PyObject *__pyx_v_random_state = NULL;
  PyObject *__pyx_v_sent = NULL;
  PyObject *__pyx_v_sent_tags = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[24]))
  __Pyx_RefNannySetupContext("_train_epoch", 0);
  __Pyx_TraceStartFunc("_train_epoch", __pyx_f[0], 670, 0, 0, 0, __PYX_ERR(0, 670, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":674
 *         Trains for one epoch with all examples.
 *         """
 *         self.error = 0             # <<<<<<<<<<<<<<
 *         self.skips = 0
 *         self.float_errors = 0
*/
  __pyx_v_self->error = 0.0;

  /* "nltkor/tag/libs/network.pyx":675
 *         """
 *         self.error = 0
 *         self.skips = 0             # <<<<<<<<<<<<<<
 *         self.float_errors = 0
 * 
*/
  __pyx_v_self->skips = 0;

  /* "nltkor/tag/libs/network.pyx":676
 *         self.error = 0
 *         self.skips = 0
 *         self.float_errors = 0             # <<<<<<<<<<<<<<
 * 
 *         # shuffle data
*/
  __pyx_v_self->float_errors = 0.0;

  /* "nltkor/tag/libs/network.pyx":681
 *         # get the random number generator state in order to shuffle
 *         # sentences and their tags in the same order
 *         random_state = np.random.get_state()             # <<<<<<<<<<<<<<
 *         np.random.shuffle(sentences)
 *         np.random.set_state(random_state)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_get_state, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_random_state = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":682
 *         # sentences and their tags in the same order
 *         random_state = np.random.get_state()
 *         np.random.shuffle(sentences)             # <<<<<<<<<<<<<<
 *         np.random.set_state(random_state)
 *         np.random.shuffle(tags)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 682, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 682, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_sentences};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_shuffle, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":683
 *         random_state = np.random.get_state()
 *         np.random.shuffle(sentences)
 *         np.random.set_state(random_state)             # <<<<<<<<<<<<<<
 *         np.random.shuffle(tags)
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = __pyx_t_2;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_random_state};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_state, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":684
 *         np.random.shuffle(sentences)
 *         np.random.set_state(random_state)
 *         np.random.shuffle(tags)             # <<<<<<<<<<<<<<
 * 
 *         for sent, sent_tags in zip(sentences, tags):
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_tags};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_shuffle, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":686
 *         np.random.shuffle(tags)
 * 
 *         for sent, sent_tags in zip(sentences, tags):             # <<<<<<<<<<<<<<
 *             try:
 *                 self._tag_sentence(sent, sent_tags)
*/
  __pyx_t_4 = NULL;
  __Pyx_INCREF(__pyx_builtin_zip);
  __pyx_t_2 = __pyx_builtin_zip; 
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_sentences, __pyx_v_tags};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 686, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 686, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 686, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_6);
        ++__pyx_t_6;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 686, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6));
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6);
        #endif
        ++__pyx_t_6;
      }
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
    } else {
      __pyx_t_1 = __pyx_t_7(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 686, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_1);
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 686, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_3);
      } else {
        __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
        __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1);
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 686, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_3);
      }
      #else
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
      index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 686, __pyx_L1_error)
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 686, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_sent, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_sent_tags, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/network.pyx":687
 * 
 *         for sent, sent_tags in zip(sentences, tags):
 *             try:             # <<<<<<<<<<<<<<
 *                 self._tag_sentence(sent, sent_tags)
 *             except FloatingPointError:
*/
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      /*try:*/ {

        /* "nltkor/tag/libs/network.pyx":688
 *         for sent, sent_tags in zip(sentences, tags):
 *             try:
 *                 self._tag_sentence(sent, sent_tags)             # <<<<<<<<<<<<<<
 *             except FloatingPointError:
 *                 # just ignore the sentence in case of an overflow
*/
        __pyx_t_3 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_3);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_sent, __pyx_v_sent_tags};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_tag_sentence, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 688, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "nltkor/tag/libs/network.pyx":687
 * 
 *         for sent, sent_tags in zip(sentences, tags):
 *             try:             # <<<<<<<<<<<<<<
 *                 self._tag_sentence(sent, sent_tags)
 *             except FloatingPointError:
*/
      }
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L14_try_end;
      __pyx_L7_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_TraceException(__pyx_lineno, 0, 0);

      /* "nltkor/tag/libs/network.pyx":689
 *             try:
 *                 self._tag_sentence(sent, sent_tags)
 *             except FloatingPointError:             # <<<<<<<<<<<<<<
 *                 # just ignore the sentence in case of an overflow
 *                 self.float_errors += 1
*/
      __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_FloatingPointError);
      if (__pyx_t_13) {
        __Pyx_AddTraceback("nltkor.tag.libs.network.Network._train_epoch", __pyx_clineno, __pyx_lineno, __pyx_filename);
        __Pyx_TraceExceptionHandled(0);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 689, __pyx_L9_except_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __Pyx_XGOTREF(__pyx_t_3);
        __Pyx_XGOTREF(__pyx_t_4);
        __Pyx_TraceExceptionDone();

        /* "nltkor/tag/libs/network.pyx":691
 *             except FloatingPointError:
 *                 # just ignore the sentence in case of an overflow
 *                 self.float_errors += 1             # <<<<<<<<<<<<<<
 * 
 *     def _validate(self):
*/
        __pyx_v_self->float_errors = (__pyx_v_self->float_errors + 1.0);
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        goto __pyx_L8_exception_handled;
      }
      goto __pyx_L9_except_error;

      /* "nltkor/tag/libs/network.pyx":687
 * 
 *         for sent, sent_tags in zip(sentences, tags):
 *             try:             # <<<<<<<<<<<<<<
 *                 self._tag_sentence(sent, sent_tags)
 *             except FloatingPointError:
*/
      __pyx_L9_except_error:;
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      goto __pyx_L1_error;
      __pyx_L8_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      __pyx_L14_try_end:;
    }

    /* "nltkor/tag/libs/network.pyx":686
 *         np.random.shuffle(tags)
 * 
 *         for sent, sent_tags in zip(sentences, tags):             # <<<<<<<<<<<<<<
 *             try:
 *                 self._tag_sentence(sent, sent_tags)
*/
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":670
 *                                    self.learning_rate))
 * 
 *     def _train_epoch(self, list sentences, list tags):             # <<<<<<<<<<<<<<
 *         """
 *         Trains for one epoch with all examples.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 670, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 670, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._train_epoch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_random_state);
  __Pyx_XDECREF(__pyx_v_sent);
  __Pyx_XDECREF(__pyx_v_sent_tags);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":693
 *                 self.float_errors += 1
 * 
 *     def _validate(self):             # <<<<<<<<<<<<<<
 *         """Perform validation on validation data and estimate accuracy"""
 *         hits = 0
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_33_validate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_32_validate, "Network._validate(self)\nPerform validation on validation data and estimate accuracy");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_33_validate = {"_validate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_33_validate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_32_validate};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_33_validate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_validate (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_validate", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_validate", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_32_validate(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6nltkor_3tag_4libs_7network_7Network_9_validate_2generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "nltkor/tag/libs/network.pyx":702
 * 
 *         # self.num_tokens stores number of tokens in training sentences
 *         num_tokens = sum(len(sent) for sent in self.validation_sentences)             # <<<<<<<<<<<<<<
 *         self.accuracy = float(hits) / num_tokens
 * 
*/

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_9_validate_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr *)__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 702, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6nltkor_3tag_4libs_7network_7Network_9_validate_2generator2, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[25]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_validate_locals_genexpr, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network); if (unlikely(!gen)) __PYX_ERR(0, 702, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._validate.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6nltkor_3tag_4libs_7network_7Network_9_validate_2generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsGen
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_TraceStartGen("genexpr", __pyx_f[0], 702, 0, 0, 0, __PYX_ERR(0, 702, __pyx_L1_error));
    __Pyx_TraceReturnValue(Py_None, 0, 0, __PYX_ERR(0, 702, __pyx_L1_error));
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  __Pyx_TraceStartGen("genexpr", __pyx_f[0], 702, 0, 0, 0, __PYX_ERR(0, 702, __pyx_L1_error));
  if (unlikely(__pyx_sent_value != Py_None)) {
    if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started generator");
    __PYX_ERR(0, 702, __pyx_L1_error)
  }
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 702, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_genexpr_arg_0 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 702, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 702, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2);
    ++__pyx_t_2;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 702, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_sent);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_sent, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_4 = PyObject_Length(__pyx_cur_scope->__pyx_v_sent); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 702, __pyx_L1_error)
    __pyx_t_3 = PyLong_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 702, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_TraceYield(__pyx_r, 0, __PYX_ERR(0, 702, __pyx_L1_error));
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __Pyx_TraceResumeGen("genexpr", __pyx_f[0], 702, 0, __PYX_ERR(0, 702, __pyx_L1_error));
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 702, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
  __Pyx_TraceReturnValue(Py_None, 0, 0, __PYX_ERR(0, 702, __pyx_L1_error));

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_TraceException(__pyx_lineno, 0, 0);
    __Pyx_Generator_Replace_StopIteration(0);
    __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_TraceExceptionUnwind(0, 0);
  }
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":693
 *                 self.float_errors += 1
 * 
 *     def _validate(self):             # <<<<<<<<<<<<<<
 *         """Perform validation on validation data and estimate accuracy"""
 *         hits = 0
*/

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_32_validate(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_v_hits = NULL;
  PyObject *__pyx_v_sent = NULL;
  PyObject *__pyx_v_gold_tags = NULL;
  PyObject *__pyx_v_answer = NULL;
  PyObject *__pyx_v_num_tokens = NULL;
  PyObject *__pyx_gb_6nltkor_3tag_4libs_7network_7Network_9_validate_2generator2 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  float __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[26]))
  __Pyx_RefNannySetupContext("_validate", 0);
  __Pyx_TraceStartFunc("_validate", __pyx_f[0], 693, 0, 0, 0, __PYX_ERR(0, 693, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":695
 *     def _validate(self):
 *         """Perform validation on validation data and estimate accuracy"""
 *         hits = 0             # <<<<<<<<<<<<<<
 * 
 *         for sent, gold_tags in zip(self.validation_sentences, self.validation_tags):
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_v_hits = __pyx_mstate_global->__pyx_int_0;

  /* "nltkor/tag/libs/network.pyx":697
 *         hits = 0
 * 
 *         for sent, gold_tags in zip(self.validation_sentences, self.validation_tags):             # <<<<<<<<<<<<<<
 *             answer = self.tag_sentence(sent)
 *             hits += np.count_nonzero(answer == gold_tags)
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_builtin_zip);
  __pyx_t_3 = __pyx_builtin_zip; 
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_self->validation_sentences, __pyx_v_self->validation_tags};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 697, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_5);
        ++__pyx_t_5;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 697, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5));
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5);
        #endif
        ++__pyx_t_5;
      }
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error)
    } else {
      __pyx_t_1 = __pyx_t_6(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 697, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_1);
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 697, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_7);
      } else {
        __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0);
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_2);
        __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 1);
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 697, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_7);
      }
      #else
      __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 697, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 697, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
      index = 0; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 697, __pyx_L1_error)
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 697, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_sent, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_gold_tags, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "nltkor/tag/libs/network.pyx":698
 * 
 *         for sent, gold_tags in zip(self.validation_sentences, self.validation_tags):
 *             answer = self.tag_sentence(sent)             # <<<<<<<<<<<<<<
 *             hits += np.count_nonzero(answer == gold_tags)
 * 
*/
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_sent};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_tag_sentence_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_answer, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/network.pyx":699
 *         for sent, gold_tags in zip(self.validation_sentences, self.validation_tags):
 *             answer = self.tag_sentence(sent)
 *             hits += np.count_nonzero(answer == gold_tags)             # <<<<<<<<<<<<<<
 * 
 *         # self.num_tokens stores number of tokens in training sentences
*/
    __pyx_t_7 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_count_nonzero); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_answer, __pyx_v_gold_tags, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 699, __pyx_L1_error)
    __pyx_t_4 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
      assert(__pyx_t_7);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
      __pyx_t_4 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_2};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_hits, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_hits, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "nltkor/tag/libs/network.pyx":697
 *         hits = 0
 * 
 *         for sent, gold_tags in zip(self.validation_sentences, self.validation_tags):             # <<<<<<<<<<<<<<
 *             answer = self.tag_sentence(sent)
 *             hits += np.count_nonzero(answer == gold_tags)
*/
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":702
 * 
 *         # self.num_tokens stores number of tokens in training sentences
 *         num_tokens = sum(len(sent) for sent in self.validation_sentences)             # <<<<<<<<<<<<<<
 *         self.accuracy = float(hits) / num_tokens
 * 
*/
  __pyx_t_8 = NULL;
  __Pyx_INCREF(__pyx_builtin_sum);
  __pyx_t_1 = __pyx_builtin_sum; 
  __pyx_t_2 = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_9_validate_genexpr(NULL, __pyx_v_self->validation_sentences); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_2};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 702, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_num_tokens = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":703
 *         # self.num_tokens stores number of tokens in training sentences
 *         num_tokens = sum(len(sent) for sent in self.validation_sentences)
 *         self.accuracy = float(hits) / num_tokens             # <<<<<<<<<<<<<<
 * 
 *     def _backpropagate(self, sentence):
*/
  __pyx_t_3 = __Pyx_PyNumber_Float(__pyx_v_hits); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_v_num_tokens); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_10 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_10 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 703, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->accuracy = __pyx_t_10;

  /* "nltkor/tag/libs/network.pyx":693
 *                 self.float_errors += 1
 * 
 *     def _validate(self):             # <<<<<<<<<<<<<<
 *         """Perform validation on validation data and estimate accuracy"""
 *         hits = 0
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 693, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 693, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._validate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_hits);
  __Pyx_XDECREF(__pyx_v_sent);
  __Pyx_XDECREF(__pyx_v_gold_tags);
  __Pyx_XDECREF(__pyx_v_answer);
  __Pyx_XDECREF(__pyx_v_num_tokens);
  __Pyx_XDECREF(__pyx_gb_6nltkor_3tag_4libs_7network_7Network_9_validate_2generator2);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":705
 *         self.accuracy = float(hits) / num_tokens
 * 
 *     def _backpropagate(self, sentence):             # <<<<<<<<<<<<<<
 *         """
 *         Backpropagate the gradients of the cost.
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_35_backpropagate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_34_backpropagate, "Network._backpropagate(self, sentence)\nBackpropagate the gradients of the cost.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_35_backpropagate = {"_backpropagate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_35_backpropagate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_34_backpropagate};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_35_backpropagate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_sentence = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_backpropagate (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sentence,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 705, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 705, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_backpropagate", 0) < 0) __PYX_ERR(0, 705, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_backpropagate", 1, 1, 1, i); __PYX_ERR(0, 705, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 705, __pyx_L3_error)
    }
    __pyx_v_sentence = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_backpropagate", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 705, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._backpropagate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_34_backpropagate(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), __pyx_v_sentence);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_34_backpropagate(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_sentence) {
  PyArrayObject *__pyx_v_output_deltas = 0;
  PyObject *__pyx_v_output_bias_deltas = NULL;
  PyObject *__pyx_v_dCdf_3 = NULL;
  PyObject *__pyx_v_dCdf_2 = NULL;
  PyArrayObject *__pyx_v_hidden_deltas = 0;
  PyObject *__pyx_v_hidden_bias_deltas = NULL;
  PyArrayObject *__pyx_v_input_gradients = 0;
  PyArrayObject *__pyx_v_input_deltas = 0;
  PyObject *__pyx_v_padded_sentence = NULL;
  PyArrayObject *__pyx_v_features = 0;
  PyArrayObject *__pyx_v_table = 0;
  int __pyx_v_start;
  int __pyx_v_end;
  int __pyx_v_t;
  int __pyx_v_i;
  PyObject *__pyx_v_w_deltas = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_features;
  __Pyx_Buffer __pyx_pybuffer_features;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_hidden_deltas;
  __Pyx_Buffer __pyx_pybuffer_hidden_deltas;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_input_deltas;
  __Pyx_Buffer __pyx_pybuffer_input_deltas;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_input_gradients;
  __Pyx_Buffer __pyx_pybuffer_input_gradients;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_output_deltas;
  __Pyx_Buffer __pyx_pybuffer_output_deltas;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_table;
  __Pyx_Buffer __pyx_pybuffer_table;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  int __pyx_t_16;
  npy_intp *__pyx_t_17;
  Py_ssize_t __pyx_t_18;
  __pyx_t_6nltkor_3tag_4libs_7network_INT_t __pyx_t_19;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  int __pyx_t_22;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[27]))
  __Pyx_RefNannySetupContext("_backpropagate", 0);
  __Pyx_TraceStartFunc("_backpropagate", __pyx_f[0], 705, 0, 0, 0, __PYX_ERR(0, 705, __pyx_L1_error));
  __pyx_pybuffer_output_deltas.pybuffer.buf = NULL;
  __pyx_pybuffer_output_deltas.refcount = 0;
  __pyx_pybuffernd_output_deltas.data = NULL;
  __pyx_pybuffernd_output_deltas.rcbuffer = &__pyx_pybuffer_output_deltas;
  __pyx_pybuffer_hidden_deltas.pybuffer.buf = NULL;
  __pyx_pybuffer_hidden_deltas.refcount = 0;
  __pyx_pybuffernd_hidden_deltas.data = NULL;
  __pyx_pybuffernd_hidden_deltas.rcbuffer = &__pyx_pybuffer_hidden_deltas;
  __pyx_pybuffer_input_gradients.pybuffer.buf = NULL;
  __pyx_pybuffer_input_gradients.refcount = 0;
  __pyx_pybuffernd_input_gradients.data = NULL;
  __pyx_pybuffernd_input_gradients.rcbuffer = &__pyx_pybuffer_input_gradients;
  __pyx_pybuffer_input_deltas.pybuffer.buf = NULL;
  __pyx_pybuffer_input_deltas.refcount = 0;
  __pyx_pybuffernd_input_deltas.data = NULL;
  __pyx_pybuffernd_input_deltas.rcbuffer = &__pyx_pybuffer_input_deltas;
  __pyx_pybuffer_features.pybuffer.buf = NULL;
  __pyx_pybuffer_features.refcount = 0;
  __pyx_pybuffernd_features.data = NULL;
  __pyx_pybuffernd_features.rcbuffer = &__pyx_pybuffer_features;
  __pyx_pybuffer_table.pybuffer.buf = NULL;
  __pyx_pybuffer_table.refcount = 0;
  __pyx_pybuffernd_table.data = NULL;
  __pyx_pybuffernd_table.rcbuffer = &__pyx_pybuffer_table;

  /* "nltkor/tag/libs/network.pyx":725
 *         # (len, output_size).T (len, hidden_size) = (output_size, hidden_size)
 *         cdef np.ndarray[FLOAT_t, ndim=2] output_deltas
 *         output_deltas = self.net_gradients.T.dot(self.hidden_sent_values)             # <<<<<<<<<<<<<<
 * 
 *         # dC / db_4 = dC / df_4					(22)
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->net_gradients), __pyx_mstate_global->__pyx_n_u_T); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self->hidden_sent_values)};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_dot, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 725, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 725, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output_deltas.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output_deltas.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_v_output_deltas, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      }
      __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
    }
    __pyx_pybuffernd_output_deltas.diminfo[0].strides = __pyx_pybuffernd_output_deltas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output_deltas.diminfo[0].shape = __pyx_pybuffernd_output_deltas.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_output_deltas.diminfo[1].strides = __pyx_pybuffernd_output_deltas.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_output_deltas.diminfo[1].shape = __pyx_pybuffernd_output_deltas.rcbuffer->pybuffer.shape[1];
    if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 725, __pyx_L1_error)
  }
  __pyx_v_output_deltas = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":730
 *         # (output_size) += ((len(sentence), output_size))
 *         # sum by column, i.e. all changes through the sentence
 *         output_bias_deltas = self.net_gradients.sum(0)             # <<<<<<<<<<<<<<
 * 
 *         # dC / df_3 = M_2.T dC / df_4				(23)
*/
  __pyx_t_3 = ((PyObject *)__pyx_v_self->net_gradients);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_int_0};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_sum, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_output_bias_deltas = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":734
 *         # dC / df_3 = M_2.T dC / df_4				(23)
 *         #  (len, output_size) (output_size, hidden_size) = (len, hidden_size)
 *         dCdf_3 = self.net_gradients.dot(self.output_weights)             # <<<<<<<<<<<<<<
 * 
 *         # layer 3: HardTanh layer
*/
  __pyx_t_3 = ((PyObject *)__pyx_v_self->net_gradients);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_self->output_weights)};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_dot, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 734, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_dCdf_3 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":742
 *         # (len, hidden_size) (len, hidden_size)
 *         # FIXME: this goes quickly to 0.
 *         dCdf_2 = hardtanhd(self.layer2_sent_values) * dCdf_3             # <<<<<<<<<<<<<<
 * 
 *         # df_2 / df_1 = M_1
*/
  __pyx_t_1 = ((PyObject *)__pyx_v_self->layer2_sent_values);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_3 = __pyx_f_6nltkor_3tag_4libs_7network_hardtanhd(((PyArrayObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_v_dCdf_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_dCdf_2 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":750
 *         cdef np.ndarray[FLOAT_t, ndim=2] hidden_deltas
 *         # (len, hidden_size).T (len, input_size) = (hidden_size, input_size)
 *         hidden_deltas = dCdf_2.T.dot(self.input_sent_values)             # <<<<<<<<<<<<<<
 * 
 *         # dC / db_2 = dC / df_2					(22)
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dCdf_2, __pyx_mstate_global->__pyx_n_u_T); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_t_2;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_self->input_sent_values)};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_dot, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 750, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 750, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_hidden_deltas.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_hidden_deltas.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_hidden_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_v_hidden_deltas, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
      }
      __pyx_t_8 = __pyx_t_7 = __pyx_t_6 = 0;
    }
    __pyx_pybuffernd_hidden_deltas.diminfo[0].strides = __pyx_pybuffernd_hidden_deltas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_hidden_deltas.diminfo[0].shape = __pyx_pybuffernd_hidden_deltas.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_hidden_deltas.diminfo[1].strides = __pyx_pybuffernd_hidden_deltas.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_hidden_deltas.diminfo[1].shape = __pyx_pybuffernd_hidden_deltas.rcbuffer->pybuffer.shape[1];
    if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 750, __pyx_L1_error)
  }
  __pyx_v_hidden_deltas = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":754
 *         # dC / db_2 = dC / df_2					(22)
 *         # sum by column contribution by each token
 *         hidden_bias_deltas = dCdf_2.sum(0)             # <<<<<<<<<<<<<<
 * 
 *         # dC / df_1 = M_1.T dC / df_2
*/
  __pyx_t_2 = __pyx_v_dCdf_2;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_int_0};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_sum, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 754, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_hidden_bias_deltas = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":759
 *         cdef np.ndarray[FLOAT_t, ndim=2] input_gradients
 *         # (len, hidden_size) (hidden_size, input_size) = (len, input_size)
 *         input_gradients = dCdf_2.dot(self.hidden_weights)             # <<<<<<<<<<<<<<
 * 
 *         """
*/
  __pyx_t_2 = __pyx_v_dCdf_2;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self->hidden_weights)};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_dot, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 759, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_gradients.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_gradients.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_gradients.rcbuffer->pybuffer, (PyObject*)__pyx_v_input_gradients, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      }
      __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
    }
    __pyx_pybuffernd_input_gradients.diminfo[0].strides = __pyx_pybuffernd_input_gradients.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input_gradients.diminfo[0].shape = __pyx_pybuffernd_input_gradients.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_input_gradients.diminfo[1].strides = __pyx_pybuffernd_input_gradients.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_input_gradients.diminfo[1].shape = __pyx_pybuffernd_input_gradients.rcbuffer->pybuffer.shape[1];
    if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 759, __pyx_L1_error)
  }
  __pyx_v_input_gradients = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":764
 *         Adjust the weights.
 *         """
 *         self.output_weights += output_deltas * self.learning_rate             # <<<<<<<<<<<<<<
 *         self.output_bias += output_bias_deltas * self.learning_rate
 *         self.hidden_weights += hidden_deltas * self.learning_rate
*/
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->learning_rate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Multiply(((PyObject *)__pyx_v_output_deltas), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_self->output_weights), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 764, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->output_weights);
  __Pyx_DECREF((PyObject *)__pyx_v_self->output_weights);
  __pyx_v_self->output_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":765
 *         """
 *         self.output_weights += output_deltas * self.learning_rate
 *         self.output_bias += output_bias_deltas * self.learning_rate             # <<<<<<<<<<<<<<
 *         self.hidden_weights += hidden_deltas * self.learning_rate
 *         self.hidden_bias += hidden_bias_deltas * self.learning_rate
*/
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->learning_rate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Multiply(__pyx_v_output_bias_deltas, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_self->output_bias), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 765, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->output_bias);
  __Pyx_DECREF((PyObject *)__pyx_v_self->output_bias);
  __pyx_v_self->output_bias = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":766
 *         self.output_weights += output_deltas * self.learning_rate
 *         self.output_bias += output_bias_deltas * self.learning_rate
 *         self.hidden_weights += hidden_deltas * self.learning_rate             # <<<<<<<<<<<<<<
 *         self.hidden_bias += hidden_bias_deltas * self.learning_rate
 * 
*/
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->learning_rate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Multiply(((PyObject *)__pyx_v_hidden_deltas), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_self->hidden_weights), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 766, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden_weights);
  __Pyx_DECREF((PyObject *)__pyx_v_self->hidden_weights);
  __pyx_v_self->hidden_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":767
 *         self.output_bias += output_bias_deltas * self.learning_rate
 *         self.hidden_weights += hidden_deltas * self.learning_rate
 *         self.hidden_bias += hidden_bias_deltas * self.learning_rate             # <<<<<<<<<<<<<<
 * 
 *         """
*/
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->learning_rate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Multiply(__pyx_v_hidden_bias_deltas, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_self->hidden_bias), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 767, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden_bias);
  __Pyx_DECREF((PyObject *)__pyx_v_self->hidden_bias);
  __pyx_v_self->hidden_bias = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":778
 *         cdef np.ndarray[FLOAT_t, ndim=2] input_deltas
 *         # (len, input_size)
 *         input_deltas = input_gradients * self.learning_rate_features             # <<<<<<<<<<<<<<
 * 
 *         padded_sentence = np.concatenate((self.pre_padding,
*/
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->learning_rate_features); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 778, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Multiply(((PyObject *)__pyx_v_input_gradients), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 778, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 778, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_deltas.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_deltas.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_v_input_deltas, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
      }
      __pyx_t_8 = __pyx_t_7 = __pyx_t_6 = 0;
    }
    __pyx_pybuffernd_input_deltas.diminfo[0].strides = __pyx_pybuffernd_input_deltas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input_deltas.diminfo[0].shape = __pyx_pybuffernd_input_deltas.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_input_deltas.diminfo[1].strides = __pyx_pybuffernd_input_deltas.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_input_deltas.diminfo[1].shape = __pyx_pybuffernd_input_deltas.rcbuffer->pybuffer.shape[1];
    if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 778, __pyx_L1_error)
  }
  __pyx_v_input_deltas = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":780
 *         input_deltas = input_gradients * self.learning_rate_features
 * 
 *         padded_sentence = np.concatenate((self.pre_padding,             # <<<<<<<<<<<<<<
 *                                           sentence,
 *                                           self.pos_padding))
*/
  __pyx_t_1 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_concatenate); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":782
 *         padded_sentence = np.concatenate((self.pre_padding,
 *                                           sentence,
 *                                           self.pos_padding))             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[INT_t, ndim=1] features
*/
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pre_padding);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->pre_padding);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self->pre_padding)) != (0)) __PYX_ERR(0, 780, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_sentence);
  __Pyx_GIVEREF(__pyx_v_sentence);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_sentence) != (0)) __PYX_ERR(0, 780, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pos_padding);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->pos_padding);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_self->pos_padding)) != (0)) __PYX_ERR(0, 780, __pyx_L1_error);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_3};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 780, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_padded_sentence = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":789
 *         cdef int i, j
 * 
 *         for i, w_deltas in enumerate(input_deltas):             # <<<<<<<<<<<<<<
 *             # for each window (w_deltas: 300, features: 5)
 *             # this tracks where the deltas for the next table begins
*/
  __pyx_t_5 = 0;
  if (likely(PyList_CheckExact(((PyObject *)__pyx_v_input_deltas))) || PyTuple_CheckExact(((PyObject *)__pyx_v_input_deltas))) {
    __pyx_t_2 = ((PyObject *)__pyx_v_input_deltas); __Pyx_INCREF(__pyx_t_2);
    __pyx_t_10 = 0;
    __pyx_t_11 = NULL;
  } else {
    __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(((PyObject *)__pyx_v_input_deltas)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 789, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_11)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 789, __pyx_L1_error)
          #endif
          if (__pyx_t_10 >= __pyx_temp) break;
        }
        __pyx_t_9 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_10);
        ++__pyx_t_10;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 789, __pyx_L1_error)
          #endif
          if (__pyx_t_10 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_9 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10));
        #else
        __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_10);
        #endif
        ++__pyx_t_10;
      }
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 789, __pyx_L1_error)
    } else {
      __pyx_t_9 = __pyx_t_11(__pyx_t_2);
      if (unlikely(!__pyx_t_9)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 789, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_XDECREF_SET(__pyx_v_w_deltas, __pyx_t_9);
    __pyx_t_9 = 0;
    __pyx_v_i = __pyx_t_5;
    __pyx_t_5 = (__pyx_t_5 + 1);

    /* "nltkor/tag/libs/network.pyx":792
 *             # for each window (w_deltas: 300, features: 5)
 *             # this tracks where the deltas for the next table begins
 *             start = 0             # <<<<<<<<<<<<<<
 *             for features in padded_sentence[i:i+self.word_window_size]:
 *                 # select the columns for each feature_tables (t: 3)
*/
    __pyx_v_start = 0;

    /* "nltkor/tag/libs/network.pyx":793
 *             # this tracks where the deltas for the next table begins
 *             start = 0
 *             for features in padded_sentence[i:i+self.word_window_size]:             # <<<<<<<<<<<<<<
 *                 # select the columns for each feature_tables (t: 3)
 *                 for t, table in enumerate(self.feature_tables):
*/
    __pyx_t_9 = __Pyx_PyObject_GetSlice(__pyx_v_padded_sentence, __pyx_v_i, (__pyx_v_i + __pyx_v_self->word_window_size), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 793, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) {
      __pyx_t_3 = __pyx_t_9; __Pyx_INCREF(__pyx_t_3);
      __pyx_t_12 = 0;
      __pyx_t_13 = NULL;
    } else {
      __pyx_t_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 793, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 793, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    for (;;) {
      if (likely(!__pyx_t_13)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 793, __pyx_L1_error)
            #endif
            if (__pyx_t_12 >= __pyx_temp) break;
          }
          __pyx_t_9 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_12);
          ++__pyx_t_12;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 793, __pyx_L1_error)
            #endif
            if (__pyx_t_12 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_9 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_12));
          #else
          __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_12);
          #endif
          ++__pyx_t_12;
        }
        if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 793, __pyx_L1_error)
      } else {
        __pyx_t_9 = __pyx_t_13(__pyx_t_3);
        if (unlikely(!__pyx_t_9)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 793, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_9);
      if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 793, __pyx_L1_error)
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_features.rcbuffer->pybuffer);
        __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_features.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_9), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_INT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_14 < 0)) {
          PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_features.rcbuffer->pybuffer, (PyObject*)__pyx_v_features, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_INT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
          }
          __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
        }
        __pyx_pybuffernd_features.diminfo[0].strides = __pyx_pybuffernd_features.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_features.diminfo[0].shape = __pyx_pybuffernd_features.rcbuffer->pybuffer.shape[0];
        if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 793, __pyx_L1_error)
      }
      __Pyx_XDECREF_SET(__pyx_v_features, ((PyArrayObject *)__pyx_t_9));
      __pyx_t_9 = 0;

      /* "nltkor/tag/libs/network.pyx":795
 *             for features in padded_sentence[i:i+self.word_window_size]:
 *                 # select the columns for each feature_tables (t: 3)
 *                 for t, table in enumerate(self.feature_tables):             # <<<<<<<<<<<<<<
 *                     end = start + table.shape[1]
 *                     table[features[t]] += w_deltas[start:end]
*/
      __pyx_t_14 = 0;
      __pyx_t_9 = __pyx_v_self->feature_tables; __Pyx_INCREF(__pyx_t_9);
      __pyx_t_15 = 0;
      for (;;) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 795, __pyx_L1_error)
          #endif
          if (__pyx_t_15 >= __pyx_temp) break;
        }
        __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_9, __pyx_t_15);
        ++__pyx_t_15;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 795, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 795, __pyx_L1_error)
        {
          __Pyx_BufFmt_StackElem __pyx_stack[1];
          __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_table.rcbuffer->pybuffer);
          __pyx_t_16 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_table.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
          if (unlikely(__pyx_t_16 < 0)) {
            PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
            if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_table.rcbuffer->pybuffer, (PyObject*)__pyx_v_table, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
              Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
              __Pyx_RaiseBufferFallbackError();
            } else {
              PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
            }
            __pyx_t_8 = __pyx_t_7 = __pyx_t_6 = 0;
          }
          __pyx_pybuffernd_table.diminfo[0].strides = __pyx_pybuffernd_table.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_table.diminfo[0].shape = __pyx_pybuffernd_table.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_table.diminfo[1].strides = __pyx_pybuffernd_table.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_table.diminfo[1].shape = __pyx_pybuffernd_table.rcbuffer->pybuffer.shape[1];
          if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 795, __pyx_L1_error)
        }
        __Pyx_XDECREF_SET(__pyx_v_table, ((PyArrayObject *)__pyx_t_1));
        __pyx_t_1 = 0;
        __pyx_v_t = __pyx_t_14;
        __pyx_t_14 = (__pyx_t_14 + 1);

        /* "nltkor/tag/libs/network.pyx":796
 *                 # select the columns for each feature_tables (t: 3)
 *                 for t, table in enumerate(self.feature_tables):
 *                     end = start + table.shape[1]             # <<<<<<<<<<<<<<
 *                     table[features[t]] += w_deltas[start:end]
 *                     start = end
*/
        __pyx_t_17 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_table)); if (unlikely(__pyx_t_17 == ((npy_intp *)0) && PyErr_Occurred())) __PYX_ERR(0, 796, __pyx_L1_error)
        __pyx_v_end = (__pyx_v_start + (__pyx_t_17[1]));

        /* "nltkor/tag/libs/network.pyx":797
 *                 for t, table in enumerate(self.feature_tables):
 *                     end = start + table.shape[1]
 *                     table[features[t]] += w_deltas[start:end]             # <<<<<<<<<<<<<<
 *                     start = end
 * 
*/
        __pyx_t_18 = __pyx_v_t;
        __pyx_t_16 = -1;
        if (__pyx_t_18 < 0) {
          __pyx_t_18 += __pyx_pybuffernd_features.diminfo[0].shape;
          if (unlikely(__pyx_t_18 < 0)) __pyx_t_16 = 0;
        } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_features.diminfo[0].shape)) __pyx_t_16 = 0;
        if (unlikely(__pyx_t_16 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_16);
          __PYX_ERR(0, 797, __pyx_L1_error)
        }
        __pyx_t_19 = (*__Pyx_BufPtrStrided1d(__pyx_t_6nltkor_3tag_4libs_7network_INT_t *, __pyx_pybuffernd_features.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_features.diminfo[0].strides));
        __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_table), __pyx_t_19, __pyx_t_6nltkor_3tag_4libs_7network_INT_t, 1, __Pyx_PyLong_From_npy_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 797, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_20 = __Pyx_PyObject_GetSlice(__pyx_v_w_deltas, __pyx_v_start, __pyx_v_end, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 797, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_21 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_20); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 797, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_21);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_v_table), __pyx_t_19, __pyx_t_21, __pyx_t_6nltkor_3tag_4libs_7network_INT_t, 1, __Pyx_PyLong_From_npy_long, 0, 1, 1) < 0))) __PYX_ERR(0, 797, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;

        /* "nltkor/tag/libs/network.pyx":798
 *                     end = start + table.shape[1]
 *                     table[features[t]] += w_deltas[start:end]
 *                     start = end             # <<<<<<<<<<<<<<
 * 
 *         # Adjusts the transition scores table with the calculated gradients.
*/
        __pyx_v_start = __pyx_v_end;

        /* "nltkor/tag/libs/network.pyx":795
 *             for features in padded_sentence[i:i+self.word_window_size]:
 *                 # select the columns for each feature_tables (t: 3)
 *                 for t, table in enumerate(self.feature_tables):             # <<<<<<<<<<<<<<
 *                     end = start + table.shape[1]
 *                     table[features[t]] += w_deltas[start:end]
*/
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "nltkor/tag/libs/network.pyx":793
 *             # this tracks where the deltas for the next table begins
 *             start = 0
 *             for features in padded_sentence[i:i+self.word_window_size]:             # <<<<<<<<<<<<<<
 *                 # select the columns for each feature_tables (t: 3)
 *                 for t, table in enumerate(self.feature_tables):
*/
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "nltkor/tag/libs/network.pyx":789
 *         cdef int i, j
 * 
 *         for i, w_deltas in enumerate(input_deltas):             # <<<<<<<<<<<<<<
 *             # for each window (w_deltas: 300, features: 5)
 *             # this tracks where the deltas for the next table begins
*/
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":801
 * 
 *         # Adjusts the transition scores table with the calculated gradients.
 *         if self.transitions is not None:             # <<<<<<<<<<<<<<
 *             self.transitions += self.trans_gradients * self.learning_rate_trans
 * 
*/
  __pyx_t_22 = (((PyObject *)__pyx_v_self->transitions) != Py_None);
  if (__pyx_t_22) {

    /* "nltkor/tag/libs/network.pyx":802
 *         # Adjusts the transition scores table with the calculated gradients.
 *         if self.transitions is not None:
 *             self.transitions += self.trans_gradients * self.learning_rate_trans             # <<<<<<<<<<<<<<
 * 
 *     def _load_parameters(self):
*/
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->learning_rate_trans); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 802, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_Multiply(((PyObject *)__pyx_v_self->trans_gradients), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 802, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_self->transitions), __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 802, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 802, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->transitions);
    __Pyx_DECREF((PyObject *)__pyx_v_self->transitions);
    __pyx_v_self->transitions = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/network.pyx":801
 * 
 *         # Adjusts the transition scores table with the calculated gradients.
 *         if self.transitions is not None:             # <<<<<<<<<<<<<<
 *             self.transitions += self.trans_gradients * self.learning_rate_trans
 * 
*/
  }

  /* "nltkor/tag/libs/network.pyx":705
 *         self.accuracy = float(hits) / num_tokens
 * 
 *     def _backpropagate(self, sentence):             # <<<<<<<<<<<<<<
 *         """
 *         Backpropagate the gradients of the cost.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 705, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_XDECREF(__pyx_t_21);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_features.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_hidden_deltas.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_deltas.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_gradients.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output_deltas.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_table.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 705, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._backpropagate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_features.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_hidden_deltas.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_deltas.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_gradients.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output_deltas.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_table.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_output_deltas);
  __Pyx_XDECREF(__pyx_v_output_bias_deltas);
  __Pyx_XDECREF(__pyx_v_dCdf_3);
  __Pyx_XDECREF(__pyx_v_dCdf_2);
  __Pyx_XDECREF((PyObject *)__pyx_v_hidden_deltas);
  __Pyx_XDECREF(__pyx_v_hidden_bias_deltas);
  __Pyx_XDECREF((PyObject *)__pyx_v_input_gradients);
  __Pyx_XDECREF((PyObject *)__pyx_v_input_deltas);
  __Pyx_XDECREF(__pyx_v_padded_sentence);
  __Pyx_XDECREF((PyObject *)__pyx_v_features);
  __Pyx_XDECREF((PyObject *)__pyx_v_table);
  __Pyx_XDECREF(__pyx_v_w_deltas);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":804
 *             self.transitions += self.trans_gradients * self.learning_rate_trans
 * 
 *     def _load_parameters(self):             # <<<<<<<<<<<<<<
 *         """
 *         Loads weights, feature tables and transition tables previously saved.
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_37_load_parameters(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_36_load_parameters, "Network._load_parameters(self)\nLoads weights, feature tables and transition tables previously saved.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_37_load_parameters = {"_load_parameters", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_37_load_parameters, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_36_load_parameters};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_37_load_parameters(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_load_parameters (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_load_parameters", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_load_parameters", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_36_load_parameters(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_36_load_parameters(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[28]))
  __Pyx_RefNannySetupContext("_load_parameters", 0);
  __Pyx_TraceStartFunc("_load_parameters", __pyx_f[0], 804, 0, 0, 0, __PYX_ERR(0, 804, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":808
 *         Loads weights, feature tables and transition tables previously saved.
 *         """
 *         data = np.load(self.network_filename)             # <<<<<<<<<<<<<<
 *         self.hidden_weights = data['hidden_weights']
 *         self.hidden_bias = data['hidden_bias']
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_load); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self->network_filename};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 808, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_data = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":809
 *         """
 *         data = np.load(self.network_filename)
 *         self.hidden_weights = data['hidden_weights']             # <<<<<<<<<<<<<<
 *         self.hidden_bias = data['hidden_bias']
 *         self.output_weights = data['output_weights']
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_hidden_weights); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 809, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden_weights);
  __Pyx_DECREF((PyObject *)__pyx_v_self->hidden_weights);
  __pyx_v_self->hidden_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":810
 *         data = np.load(self.network_filename)
 *         self.hidden_weights = data['hidden_weights']
 *         self.hidden_bias = data['hidden_bias']             # <<<<<<<<<<<<<<
 *         self.output_weights = data['output_weights']
 *         self.output_bias = data['output_bias']
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_hidden_bias); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 810, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden_bias);
  __Pyx_DECREF((PyObject *)__pyx_v_self->hidden_bias);
  __pyx_v_self->hidden_bias = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":811
 *         self.hidden_weights = data['hidden_weights']
 *         self.hidden_bias = data['hidden_bias']
 *         self.output_weights = data['output_weights']             # <<<<<<<<<<<<<<
 *         self.output_bias = data['output_bias']
 *         self.feature_tables = list(data['feature_tables'])
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_output_weights); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 811, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->output_weights);
  __Pyx_DECREF((PyObject *)__pyx_v_self->output_weights);
  __pyx_v_self->output_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":812
 *         self.hidden_bias = data['hidden_bias']
 *         self.output_weights = data['output_weights']
 *         self.output_bias = data['output_bias']             # <<<<<<<<<<<<<<
 *         self.feature_tables = list(data['feature_tables'])
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_output_bias); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 812, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->output_bias);
  __Pyx_DECREF((PyObject *)__pyx_v_self->output_bias);
  __pyx_v_self->output_bias = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":813
 *         self.output_weights = data['output_weights']
 *         self.output_bias = data['output_bias']
 *         self.feature_tables = list(data['feature_tables'])             # <<<<<<<<<<<<<<
 * 
 *         # check if transitions isn't None (numpy saves everything as an array)
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_feature_tables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 813, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 813, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->feature_tables);
  __Pyx_DECREF(__pyx_v_self->feature_tables);
  __pyx_v_self->feature_tables = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/network.pyx":816
 * 
 *         # check if transitions isn't None (numpy saves everything as an array)
 *         if data['transitions'].shape != ():             # <<<<<<<<<<<<<<
 *             self.transitions = data['transitions']
 *         else:
*/
  __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_transitions); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 816, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_mstate_global->__pyx_empty_tuple, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 816, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 816, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_6) {

    /* "nltkor/tag/libs/network.pyx":817
 *         # check if transitions isn't None (numpy saves everything as an array)
 *         if data['transitions'].shape != ():
 *             self.transitions = data['transitions']             # <<<<<<<<<<<<<<
 *         else:
 *             self.transitions = None
*/
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_transitions); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 817, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->transitions);
    __Pyx_DECREF((PyObject *)__pyx_v_self->transitions);
    __pyx_v_self->transitions = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/network.pyx":816
 * 
 *         # check if transitions isn't None (numpy saves everything as an array)
 *         if data['transitions'].shape != ():             # <<<<<<<<<<<<<<
 *             self.transitions = data['transitions']
 *         else:
*/
    goto __pyx_L3;
  }

  /* "nltkor/tag/libs/network.pyx":819
 *             self.transitions = data['transitions']
 *         else:
 *             self.transitions = None             # <<<<<<<<<<<<<<
 * 
 *     def save(self):
*/
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->transitions);
    __Pyx_DECREF((PyObject *)__pyx_v_self->transitions);
    __pyx_v_self->transitions = ((PyArrayObject *)Py_None);
  }
  __pyx_L3:;

  /* "nltkor/tag/libs/network.pyx":804
 *             self.transitions += self.trans_gradients * self.learning_rate_trans
 * 
 *     def _load_parameters(self):             # <<<<<<<<<<<<<<
 *         """
 *         Loads weights, feature tables and transition tables previously saved.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 804, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 804, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network._load_parameters", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":821
 *             self.transitions = None
 * 
 *     def save(self):             # <<<<<<<<<<<<<<
 *         """
 *         Saves the neural network to a file.
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_39save(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_38save, "Network.save(self)\nSaves the neural network to a file.\nIt will save the weights, biases, sizes, padding, \nand feature tables.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_39save = {"save", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_39save, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_38save};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_39save(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("save", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("save", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_38save(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_38save(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[29]))
  __Pyx_RefNannySetupContext("save", 0);
  __Pyx_TraceStartFunc("save", __pyx_f[0], 821, 0, 0, 0, __PYX_ERR(0, 821, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":827
 *         and feature tables.
 *         """
 *         np.savez(self.network_filename, hidden_weights=self.hidden_weights,             # <<<<<<<<<<<<<<
 *                  output_weights=self.output_weights,
 *                  hidden_bias=self.hidden_bias, output_bias=self.output_bias,
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_savez); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":830
 *                  output_weights=self.output_weights,
 *                  hidden_bias=self.hidden_bias, output_bias=self.output_bias,
 *                  word_window_size=self.word_window_size,             # <<<<<<<<<<<<<<
 *                  input_size=self.input_size, hidden_size=self.hidden_size,
 *                  output_size=self.output_size, padding_left=self.padding_left,
*/
  __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_self->word_window_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "nltkor/tag/libs/network.pyx":831
 *                  hidden_bias=self.hidden_bias, output_bias=self.output_bias,
 *                  word_window_size=self.word_window_size,
 *                  input_size=self.input_size, hidden_size=self.hidden_size,             # <<<<<<<<<<<<<<
 *                  output_size=self.output_size, padding_left=self.padding_left,
 *                  padding_right=self.padding_right, transitions=self.transitions,
*/
  __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_self->input_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_self->hidden_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "nltkor/tag/libs/network.pyx":832
 *                  word_window_size=self.word_window_size,
 *                  input_size=self.input_size, hidden_size=self.hidden_size,
 *                  output_size=self.output_size, padding_left=self.padding_left,             # <<<<<<<<<<<<<<
 *                  padding_right=self.padding_right, transitions=self.transitions,
 *                  feature_tables=self.feature_tables)
*/
  __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_self->output_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "nltkor/tag/libs/network.pyx":834
 *                  output_size=self.output_size, padding_left=self.padding_left,
 *                  padding_right=self.padding_right, transitions=self.transitions,
 *                  feature_tables=self.feature_tables)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 12 : 0)] = {__pyx_t_2, __pyx_v_self->network_filename};
    __pyx_t_9 = __Pyx_MakeVectorcallBuilderKwds(12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 827, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_hidden_weights, ((PyObject *)__pyx_v_self->hidden_weights), __pyx_t_9, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 827, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_output_weights, ((PyObject *)__pyx_v_self->output_weights), __pyx_t_9, __pyx_callargs+2, 1) < 0) __PYX_ERR(0, 827, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_hidden_bias, ((PyObject *)__pyx_v_self->hidden_bias), __pyx_t_9, __pyx_callargs+2, 2) < 0) __PYX_ERR(0, 827, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_output_bias, ((PyObject *)__pyx_v_self->output_bias), __pyx_t_9, __pyx_callargs+2, 3) < 0) __PYX_ERR(0, 827, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_word_window_size, __pyx_t_3, __pyx_t_9, __pyx_callargs+2, 4) < 0) __PYX_ERR(0, 827, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_input_size, __pyx_t_5, __pyx_t_9, __pyx_callargs+2, 5) < 0) __PYX_ERR(0, 827, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_hidden_size, __pyx_t_6, __pyx_t_9, __pyx_callargs+2, 6) < 0) __PYX_ERR(0, 827, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_output_size, __pyx_t_7, __pyx_t_9, __pyx_callargs+2, 7) < 0) __PYX_ERR(0, 827, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_padding_left, ((PyObject *)__pyx_v_self->padding_left), __pyx_t_9, __pyx_callargs+2, 8) < 0) __PYX_ERR(0, 827, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_padding_right, ((PyObject *)__pyx_v_self->padding_right), __pyx_t_9, __pyx_callargs+2, 9) < 0) __PYX_ERR(0, 827, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_transitions, ((PyObject *)__pyx_v_self->transitions), __pyx_t_9, __pyx_callargs+2, 10) < 0) __PYX_ERR(0, 827, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_feature_tables, __pyx_v_self->feature_tables, __pyx_t_9, __pyx_callargs+2, 11) < 0) __PYX_ERR(0, 827, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 827, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":821
 *             self.transitions = None
 * 
 *     def save(self):             # <<<<<<<<<<<<<<
 *         """
 *         Saves the neural network to a file.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 821, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 821, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.save", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":837
 * 
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def load_from_file(cls, filename):
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_41load_from_file(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_40load_from_file, "Network.load_from_file(cls, filename)\nLoads the neural network from a file.\nIt will load weights, biases, sizes, padding, \nand feature tables.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_41load_from_file = {"load_from_file", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_41load_from_file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_40load_from_file};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_41load_from_file(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_filename = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("load_from_file (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_filename,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 837, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 837, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "load_from_file", 0) < 0) __PYX_ERR(0, 837, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("load_from_file", 1, 1, 1, i); __PYX_ERR(0, 837, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 837, __pyx_L3_error)
    }
    __pyx_v_filename = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("load_from_file", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 837, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.load_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_40load_from_file(((PyTypeObject*)__pyx_v_cls), __pyx_v_filename);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_40load_from_file(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_filename) {
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_hidden_weights = NULL;
  PyObject *__pyx_v_hidden_bias = NULL;
  PyObject *__pyx_v_output_weights = NULL;
  PyObject *__pyx_v_output_bias = NULL;
  PyObject *__pyx_v_word_window_size = NULL;
  PyObject *__pyx_v_input_size = NULL;
  PyObject *__pyx_v_hidden_size = NULL;
  PyObject *__pyx_v_output_size = NULL;
  PyObject *__pyx_v_transitions = NULL;
  struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_nn = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  long __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[30]))
  __Pyx_RefNannySetupContext("load_from_file", 0);
  __Pyx_TraceStartFunc("load_from_file", __pyx_f[0], 837, 0, 0, 0, __PYX_ERR(0, 837, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":844
 *         and feature tables.
 *         """
 *         data = np.load(filename)             # <<<<<<<<<<<<<<
 *         #print filename
 *         # cython classes don't have the __dict__ attribute
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_load); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_filename};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 844, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_data = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":848
 *         # cython classes don't have the __dict__ attribute
 *         # so we can't do an elegant self.__dict__.update(data)
 *         hidden_weights = data['hidden_weights']             # <<<<<<<<<<<<<<
 *         hidden_bias = data['hidden_bias']
 *         output_weights = data['output_weights']
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_hidden_weights); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 848, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_hidden_weights = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":849
 *         # so we can't do an elegant self.__dict__.update(data)
 *         hidden_weights = data['hidden_weights']
 *         hidden_bias = data['hidden_bias']             # <<<<<<<<<<<<<<
 *         output_weights = data['output_weights']
 *         output_bias = data['output_bias']
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_hidden_bias); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_hidden_bias = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":850
 *         hidden_weights = data['hidden_weights']
 *         hidden_bias = data['hidden_bias']
 *         output_weights = data['output_weights']             # <<<<<<<<<<<<<<
 *         output_bias = data['output_bias']
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_output_weights); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_output_weights = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":851
 *         hidden_bias = data['hidden_bias']
 *         output_weights = data['output_weights']
 *         output_bias = data['output_bias']             # <<<<<<<<<<<<<<
 * 
 *         word_window_size = data['word_window_size']
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_output_bias); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_output_bias = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":853
 *         output_bias = data['output_bias']
 * 
 *         word_window_size = data['word_window_size']             # <<<<<<<<<<<<<<
 *         input_size = data['input_size']
 *         hidden_size = data['hidden_size']
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_word_window_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_word_window_size = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":854
 * 
 *         word_window_size = data['word_window_size']
 *         input_size = data['input_size']             # <<<<<<<<<<<<<<
 *         hidden_size = data['hidden_size']
 *         output_size = data['output_size']
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_input_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_input_size = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":855
 *         word_window_size = data['word_window_size']
 *         input_size = data['input_size']
 *         hidden_size = data['hidden_size']             # <<<<<<<<<<<<<<
 *         output_size = data['output_size']
 *         if 'transitions' in data:
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_hidden_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_hidden_size = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":856
 *         input_size = data['input_size']
 *         hidden_size = data['hidden_size']
 *         output_size = data['output_size']             # <<<<<<<<<<<<<<
 *         if 'transitions' in data:
 *             transitions = data['transitions']
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_output_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_output_size = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":857
 *         hidden_size = data['hidden_size']
 *         output_size = data['output_size']
 *         if 'transitions' in data:             # <<<<<<<<<<<<<<
 *             transitions = data['transitions']
 *         else:
*/
  __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_n_u_transitions, __pyx_v_data, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 857, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "nltkor/tag/libs/network.pyx":858
 *         output_size = data['output_size']
 *         if 'transitions' in data:
 *             transitions = data['transitions']             # <<<<<<<<<<<<<<
 *         else:
 *             transitions = None
*/
    __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_transitions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_transitions = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/network.pyx":857
 *         hidden_size = data['hidden_size']
 *         output_size = data['output_size']
 *         if 'transitions' in data:             # <<<<<<<<<<<<<<
 *             transitions = data['transitions']
 *         else:
*/
    goto __pyx_L3;
  }

  /* "nltkor/tag/libs/network.pyx":860
 *             transitions = data['transitions']
 *         else:
 *             transitions = None             # <<<<<<<<<<<<<<
 * 
 *         nn = Network(word_window_size, input_size, hidden_size, output_size,
*/
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __pyx_v_transitions = Py_None;
  }
  __pyx_L3:;

  /* "nltkor/tag/libs/network.pyx":862
 *             transitions = None
 * 
 *         nn = Network(word_window_size, input_size, hidden_size, output_size,             # <<<<<<<<<<<<<<
 *                      hidden_weights, hidden_bias, output_weights, output_bias,
 *                      transitions)
*/
  __pyx_t_4 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network);
  __pyx_t_2 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network); 

  /* "nltkor/tag/libs/network.pyx":864
 *         nn = Network(word_window_size, input_size, hidden_size, output_size,
 *                      hidden_weights, hidden_bias, output_weights, output_bias,
 *                      transitions)             # <<<<<<<<<<<<<<
 * 
 *         nn.padding_left = data['padding_left']
*/
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[10] = {__pyx_t_4, __pyx_v_word_window_size, __pyx_v_input_size, __pyx_v_hidden_size, __pyx_v_output_size, __pyx_v_hidden_weights, __pyx_v_hidden_bias, __pyx_v_output_weights, __pyx_v_output_bias, __pyx_v_transitions};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (10-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 862, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_nn = ((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":866
 *                      transitions)
 * 
 *         nn.padding_left = data['padding_left']             # <<<<<<<<<<<<<<
 *         nn.padding_right = data['padding_right']
 *         nn.pre_padding = np.array((nn.word_window_size // 2) * [nn.padding_left])
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_padding_left); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_nn->padding_left);
  __Pyx_DECREF((PyObject *)__pyx_v_nn->padding_left);
  __pyx_v_nn->padding_left = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":867
 * 
 *         nn.padding_left = data['padding_left']
 *         nn.padding_right = data['padding_right']             # <<<<<<<<<<<<<<
 *         nn.pre_padding = np.array((nn.word_window_size // 2) * [nn.padding_left])
 *         nn.pos_padding = np.array((nn.word_window_size // 2) * [nn.padding_right])
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_padding_right); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 867, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_nn->padding_right);
  __Pyx_DECREF((PyObject *)__pyx_v_nn->padding_right);
  __pyx_v_nn->padding_right = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":868
 *         nn.padding_left = data['padding_left']
 *         nn.padding_right = data['padding_right']
 *         nn.pre_padding = np.array((nn.word_window_size // 2) * [nn.padding_left])             # <<<<<<<<<<<<<<
 *         nn.pos_padding = np.array((nn.word_window_size // 2) * [nn.padding_right])
 *         nn.feature_tables = list(data['feature_tables'])
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_div_long(__pyx_v_nn->word_window_size, 2, 1);
  __pyx_t_4 = PyList_New(1 * ((__pyx_t_7<0) ? 0:__pyx_t_7)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_t_7; __pyx_temp++) {
      __Pyx_INCREF((PyObject *)__pyx_v_nn->padding_left);
      __Pyx_GIVEREF((PyObject *)__pyx_v_nn->padding_left);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_4, __pyx_temp, ((PyObject *)__pyx_v_nn->padding_left)) != (0)) __PYX_ERR(0, 868, __pyx_L1_error);
    }
  }
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 868, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 868, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_nn->pre_padding);
  __Pyx_DECREF((PyObject *)__pyx_v_nn->pre_padding);
  __pyx_v_nn->pre_padding = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":869
 *         nn.padding_right = data['padding_right']
 *         nn.pre_padding = np.array((nn.word_window_size // 2) * [nn.padding_left])
 *         nn.pos_padding = np.array((nn.word_window_size // 2) * [nn.padding_right])             # <<<<<<<<<<<<<<
 *         nn.feature_tables = list(data['feature_tables'])
 *         nn.network_filename = filename
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_div_long(__pyx_v_nn->word_window_size, 2, 1);
  __pyx_t_4 = PyList_New(1 * ((__pyx_t_7<0) ? 0:__pyx_t_7)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_t_7; __pyx_temp++) {
      __Pyx_INCREF((PyObject *)__pyx_v_nn->padding_right);
      __Pyx_GIVEREF((PyObject *)__pyx_v_nn->padding_right);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_4, __pyx_temp, ((PyObject *)__pyx_v_nn->padding_right)) != (0)) __PYX_ERR(0, 869, __pyx_L1_error);
    }
  }
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 869, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 869, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_nn->pos_padding);
  __Pyx_DECREF((PyObject *)__pyx_v_nn->pos_padding);
  __pyx_v_nn->pos_padding = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/network.pyx":870
 *         nn.pre_padding = np.array((nn.word_window_size // 2) * [nn.padding_left])
 *         nn.pos_padding = np.array((nn.word_window_size // 2) * [nn.padding_right])
 *         nn.feature_tables = list(data['feature_tables'])             # <<<<<<<<<<<<<<
 *         nn.network_filename = filename
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_feature_tables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_nn->feature_tables);
  __Pyx_DECREF(__pyx_v_nn->feature_tables);
  __pyx_v_nn->feature_tables = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":871
 *         nn.pos_padding = np.array((nn.word_window_size // 2) * [nn.padding_right])
 *         nn.feature_tables = list(data['feature_tables'])
 *         nn.network_filename = filename             # <<<<<<<<<<<<<<
 * 
 *         return nn
*/
  __pyx_t_2 = __pyx_v_filename;
  __Pyx_INCREF(__pyx_t_2);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 871, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_nn->network_filename);
  __Pyx_DECREF(__pyx_v_nn->network_filename);
  __pyx_v_nn->network_filename = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":873
 *         nn.network_filename = filename
 * 
 *         return nn             # <<<<<<<<<<<<<<
 * 
 * # include the files for other networks
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_nn);
  __pyx_r = ((PyObject *)__pyx_v_nn);
  __Pyx_TraceReturnValue(__pyx_r, 104, 0, __PYX_ERR(0, 873, __pyx_L1_error));
  goto __pyx_L0;

  /* "nltkor/tag/libs/network.pyx":837
 * 
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def load_from_file(cls, filename):
 *         """
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 837, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.load_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_hidden_weights);
  __Pyx_XDECREF(__pyx_v_hidden_bias);
  __Pyx_XDECREF(__pyx_v_output_weights);
  __Pyx_XDECREF(__pyx_v_output_bias);
  __Pyx_XDECREF(__pyx_v_word_window_size);
  __Pyx_XDECREF(__pyx_v_input_size);
  __Pyx_XDECREF(__pyx_v_hidden_size);
  __Pyx_XDECREF(__pyx_v_output_size);
  __Pyx_XDECREF(__pyx_v_transitions);
  __Pyx_XDECREF((PyObject *)__pyx_v_nn);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":82
 * 
 *     # sizes and learning rates
 *     cdef readonly int word_window_size, input_size, hidden_size, output_size             # <<<<<<<<<<<<<<
 *     cdef public float learning_rate, learning_rate_features
 *     cdef public float decay_factor
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_16word_window_size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_16word_window_size_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_16word_window_size___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_16word_window_size___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[31]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[0], 82, 0, 0, 0, __PYX_ERR(0, 82, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->word_window_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 82, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 82, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.word_window_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_10input_size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_10input_size_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_10input_size___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_10input_size___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[32]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[0], 82, 0, 0, 0, __PYX_ERR(0, 82, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->input_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 82, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 82, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.input_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11hidden_size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11hidden_size_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11hidden_size___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_11hidden_size___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[33]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[0], 82, 0, 0, 0, __PYX_ERR(0, 82, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->hidden_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 82, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 82, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.hidden_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11output_size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11output_size_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11output_size___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_11output_size___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[34]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[0], 82, 0, 0, 0, __PYX_ERR(0, 82, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->output_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 82, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 82, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.output_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":83
 *     # sizes and learning rates
 *     cdef readonly int word_window_size, input_size, hidden_size, output_size
 *     cdef public float learning_rate, learning_rate_features             # <<<<<<<<<<<<<<
 *     cdef public float decay_factor
 *     cdef public bool use_learning_rate_decay
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_13learning_rate_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_13learning_rate_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_13learning_rate___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_13learning_rate___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[35]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[0], 83, 0, 0, 0, __PYX_ERR(0, 83, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->learning_rate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 83, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 83, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.learning_rate.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_13learning_rate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_13learning_rate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_13learning_rate_2__set__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_13learning_rate_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarationsFunc
  float __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[36]))
  __Pyx_TraceStartFunc("__set__", __pyx_f[0], 83, 0, 0, 0, __PYX_ERR(0, 83, __pyx_L1_error));
  __pyx_t_1 = __Pyx_PyFloat_AsFloat(__pyx_v_value); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L1_error)
  __pyx_v_self->learning_rate = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_TraceReturnCValue(__pyx_r, __Pyx_Owned_Py_None, 0, 0, __PYX_ERR(0, 83, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 83, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.learning_rate.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_PyMonitoring_ExitScope(0);
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_22learning_rate_features_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_22learning_rate_features_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_22learning_rate_features___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_22learning_rate_features___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[37]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[0], 83, 0, 0, 0, __PYX_ERR(0, 83, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->learning_rate_features); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 83, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 83, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.learning_rate_features.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_22learning_rate_features_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_22learning_rate_features_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_22learning_rate_features_2__set__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_22learning_rate_features_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarationsFunc
  float __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[38]))
  __Pyx_TraceStartFunc("__set__", __pyx_f[0], 83, 0, 0, 0, __PYX_ERR(0, 83, __pyx_L1_error));
  __pyx_t_1 = __Pyx_PyFloat_AsFloat(__pyx_v_value); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L1_error)
  __pyx_v_self->learning_rate_features = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_TraceReturnCValue(__pyx_r, __Pyx_Owned_Py_None, 0, 0, __PYX_ERR(0, 83, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 83, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.learning_rate_features.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_PyMonitoring_ExitScope(0);
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":84
 *     cdef readonly int word_window_size, input_size, hidden_size, output_size
 *     cdef public float learning_rate, learning_rate_features
 *     cdef public float decay_factor             # <<<<<<<<<<<<<<
 *     cdef public bool use_learning_rate_decay
 *     cdef readonly int features_per_token
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_12decay_factor_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_12decay_factor_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_12decay_factor___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_12decay_factor___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[39]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[0], 84, 0, 0, 0, __PYX_ERR(0, 84, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->decay_factor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 84, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 84, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.decay_factor.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_12decay_factor_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_12decay_factor_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_12decay_factor_2__set__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_12decay_factor_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarationsFunc
  float __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[40]))
  __Pyx_TraceStartFunc("__set__", __pyx_f[0], 84, 0, 0, 0, __PYX_ERR(0, 84, __pyx_L1_error));
  __pyx_t_1 = __Pyx_PyFloat_AsFloat(__pyx_v_value); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L1_error)
  __pyx_v_self->decay_factor = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_TraceReturnCValue(__pyx_r, __Pyx_Owned_Py_None, 0, 0, __PYX_ERR(0, 84, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 84, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.decay_factor.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_PyMonitoring_ExitScope(0);
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":85
 *     cdef public float learning_rate, learning_rate_features
 *     cdef public float decay_factor
 *     cdef public bool use_learning_rate_decay             # <<<<<<<<<<<<<<
 *     cdef readonly int features_per_token
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[41]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[0], 85, 0, 0, 0, __PYX_ERR(0, 85, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->use_learning_rate_decay);
  __pyx_r = ((PyObject *)__pyx_v_self->use_learning_rate_decay);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 85, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 85, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.use_learning_rate_decay.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay_2__set__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[42]))
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_TraceStartFunc("__set__", __pyx_f[0], 85, 0, 0, 0, __PYX_ERR(0, 85, __pyx_L1_error));
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool))))) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->use_learning_rate_decay);
  __Pyx_DECREF((PyObject *)__pyx_v_self->use_learning_rate_decay);
  __pyx_v_self->use_learning_rate_decay = ((PyLongObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_TraceReturnCValue(__pyx_r, __Pyx_Owned_Py_None, 0, 0, __PYX_ERR(0, 85, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 85, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.use_learning_rate_decay.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay_4__del__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  int __pyx_r;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[43]))
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_TraceStartFunc("__del__", __pyx_f[0], 85, 0, 0, 0, __PYX_ERR(0, 85, __pyx_L1_error));
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->use_learning_rate_decay);
  __Pyx_DECREF((PyObject *)__pyx_v_self->use_learning_rate_decay);
  __pyx_v_self->use_learning_rate_decay = ((PyLongObject *)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_TraceReturnCValue(__pyx_r, __Pyx_Owned_Py_None, 0, 0, __PYX_ERR(0, 85, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 85, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.use_learning_rate_decay.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":86
 *     cdef public float decay_factor
 *     cdef public bool use_learning_rate_decay
 *     cdef readonly int features_per_token             # <<<<<<<<<<<<<<
 * 
 *     # lookup for fast access to all the token embeddings in a sentence
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_18features_per_token_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_18features_per_token_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_18features_per_token___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_18features_per_token___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[44]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[0], 86, 0, 0, 0, __PYX_ERR(0, 86, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->features_per_token); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 86, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 86, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.features_per_token.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":93
 *     # padding stuff
 *     cdef np.ndarray padding_left, padding_right
 *     cdef public np.ndarray pre_padding, pos_padding             # <<<<<<<<<<<<<<
 * 
 *     # weights, biases, calculated values
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pre_padding_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pre_padding_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pre_padding___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pre_padding___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[45]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[0], 93, 0, 0, 0, __PYX_ERR(0, 93, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pre_padding);
  __pyx_r = ((PyObject *)__pyx_v_self->pre_padding);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 93, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 93, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.pre_padding.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pre_padding_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pre_padding_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pre_padding_2__set__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pre_padding_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[46]))
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_TraceStartFunc("__set__", __pyx_f[0], 93, 0, 0, 0, __PYX_ERR(0, 93, __pyx_L1_error));
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->pre_padding);
  __Pyx_DECREF((PyObject *)__pyx_v_self->pre_padding);
  __pyx_v_self->pre_padding = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_TraceReturnCValue(__pyx_r, __Pyx_Owned_Py_None, 0, 0, __PYX_ERR(0, 93, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 93, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.pre_padding.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pre_padding_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pre_padding_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pre_padding_4__del__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pre_padding_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  int __pyx_r;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[47]))
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_TraceStartFunc("__del__", __pyx_f[0], 93, 0, 0, 0, __PYX_ERR(0, 93, __pyx_L1_error));
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->pre_padding);
  __Pyx_DECREF((PyObject *)__pyx_v_self->pre_padding);
  __pyx_v_self->pre_padding = ((PyArrayObject *)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_TraceReturnCValue(__pyx_r, __Pyx_Owned_Py_None, 0, 0, __PYX_ERR(0, 93, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 93, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.pre_padding.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pos_padding_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pos_padding_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pos_padding___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pos_padding___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[48]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[0], 93, 0, 0, 0, __PYX_ERR(0, 93, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pos_padding);
  __pyx_r = ((PyObject *)__pyx_v_self->pos_padding);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 93, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 93, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.pos_padding.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pos_padding_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pos_padding_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pos_padding_2__set__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pos_padding_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[49]))
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_TraceStartFunc("__set__", __pyx_f[0], 93, 0, 0, 0, __PYX_ERR(0, 93, __pyx_L1_error));
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->pos_padding);
  __Pyx_DECREF((PyObject *)__pyx_v_self->pos_padding);
  __pyx_v_self->pos_padding = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_TraceReturnCValue(__pyx_r, __Pyx_Owned_Py_None, 0, 0, __PYX_ERR(0, 93, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 93, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.pos_padding.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pos_padding_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pos_padding_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pos_padding_4__del__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11pos_padding_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  int __pyx_r;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[50]))
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_TraceStartFunc("__del__", __pyx_f[0], 93, 0, 0, 0, __PYX_ERR(0, 93, __pyx_L1_error));
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->pos_padding);
  __Pyx_DECREF((PyObject *)__pyx_v_self->pos_padding);
  __pyx_v_self->pos_padding = ((PyArrayObject *)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_TraceReturnCValue(__pyx_r, __Pyx_Owned_Py_None, 0, 0, __PYX_ERR(0, 93, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 93, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.pos_padding.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":96
 * 
 *     # weights, biases, calculated values
 *     cdef readonly np.ndarray hidden_weights, output_weights             # <<<<<<<<<<<<<<
 *     cdef readonly np.ndarray hidden_bias, output_bias
 *     cdef readonly np.ndarray input_values, hidden_values, layer2_values
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_14hidden_weights_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_14hidden_weights_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_14hidden_weights___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_14hidden_weights___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[51]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[0], 96, 0, 0, 0, __PYX_ERR(0, 96, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden_weights);
  __pyx_r = ((PyObject *)__pyx_v_self->hidden_weights);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 96, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 96, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.hidden_weights.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_14output_weights_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_14output_weights_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_14output_weights___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_14output_weights___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[52]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[0], 96, 0, 0, 0, __PYX_ERR(0, 96, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->output_weights);
  __pyx_r = ((PyObject *)__pyx_v_self->output_weights);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 96, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 96, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.output_weights.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":97
 *     # weights, biases, calculated values
 *     cdef readonly np.ndarray hidden_weights, output_weights
 *     cdef readonly np.ndarray hidden_bias, output_bias             # <<<<<<<<<<<<<<
 *     cdef readonly np.ndarray input_values, hidden_values, layer2_values
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11hidden_bias_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11hidden_bias_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11hidden_bias___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_11hidden_bias___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[53]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[0], 97, 0, 0, 0, __PYX_ERR(0, 97, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden_bias);
  __pyx_r = ((PyObject *)__pyx_v_self->hidden_bias);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 97, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 97, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.hidden_bias.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11output_bias_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11output_bias_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11output_bias___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_11output_bias___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[54]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[0], 97, 0, 0, 0, __PYX_ERR(0, 97, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->output_bias);
  __pyx_r = ((PyObject *)__pyx_v_self->output_bias);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 97, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 97, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.output_bias.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":98
 *     cdef readonly np.ndarray hidden_weights, output_weights
 *     cdef readonly np.ndarray hidden_bias, output_bias
 *     cdef readonly np.ndarray input_values, hidden_values, layer2_values             # <<<<<<<<<<<<<<
 * 
 *     # feature tables
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_12input_values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_12input_values_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_12input_values___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_12input_values___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[55]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[0], 98, 0, 0, 0, __PYX_ERR(0, 98, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->input_values);
  __pyx_r = ((PyObject *)__pyx_v_self->input_values);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 98, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 98, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.input_values.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_13hidden_values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_13hidden_values_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_13hidden_values___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_13hidden_values___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[56]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[0], 98, 0, 0, 0, __PYX_ERR(0, 98, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden_values);
  __pyx_r = ((PyObject *)__pyx_v_self->hidden_values);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 98, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 98, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.hidden_values.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_13layer2_values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_13layer2_values_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_13layer2_values___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_13layer2_values___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[57]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[0], 98, 0, 0, 0, __PYX_ERR(0, 98, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->layer2_values);
  __pyx_r = ((PyObject *)__pyx_v_self->layer2_values);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 98, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 98, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.layer2_values.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":101
 * 
 *     # feature tables
 *     cdef public list feature_tables             # <<<<<<<<<<<<<<
 * 
 *     # transitions
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_14feature_tables_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_14feature_tables_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_14feature_tables___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_14feature_tables___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[58]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[0], 101, 0, 0, 0, __PYX_ERR(0, 101, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->feature_tables);
  __pyx_r = __pyx_v_self->feature_tables;
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 101, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 101, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.feature_tables.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_14feature_tables_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_14feature_tables_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_14feature_tables_2__set__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_14feature_tables_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[59]))
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_TraceStartFunc("__set__", __pyx_f[0], 101, 0, 0, 0, __PYX_ERR(0, 101, __pyx_L1_error));
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(0, 101, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->feature_tables);
  __Pyx_DECREF(__pyx_v_self->feature_tables);
  __pyx_v_self->feature_tables = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_TraceReturnCValue(__pyx_r, __Pyx_Owned_Py_None, 0, 0, __PYX_ERR(0, 101, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 101, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.feature_tables.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_14feature_tables_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_14feature_tables_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_14feature_tables_4__del__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_14feature_tables_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  int __pyx_r;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[60]))
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_TraceStartFunc("__del__", __pyx_f[0], 101, 0, 0, 0, __PYX_ERR(0, 101, __pyx_L1_error));
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->feature_tables);
  __Pyx_DECREF(__pyx_v_self->feature_tables);
  __pyx_v_self->feature_tables = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_TraceReturnCValue(__pyx_r, __Pyx_Owned_Py_None, 0, 0, __PYX_ERR(0, 101, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 101, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.feature_tables.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":104
 * 
 *     # transitions
 *     cdef public float learning_rate_trans             # <<<<<<<<<<<<<<
 *     cdef public np.ndarray transitions
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_19learning_rate_trans_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_19learning_rate_trans_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_19learning_rate_trans___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_19learning_rate_trans___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[61]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[0], 104, 0, 0, 0, __PYX_ERR(0, 104, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->learning_rate_trans); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 104, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 104, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.learning_rate_trans.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_19learning_rate_trans_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_19learning_rate_trans_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_19learning_rate_trans_2__set__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_19learning_rate_trans_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarationsFunc
  float __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[62]))
  __Pyx_TraceStartFunc("__set__", __pyx_f[0], 104, 0, 0, 0, __PYX_ERR(0, 104, __pyx_L1_error));
  __pyx_t_1 = __Pyx_PyFloat_AsFloat(__pyx_v_value); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error)
  __pyx_v_self->learning_rate_trans = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_TraceReturnCValue(__pyx_r, __Pyx_Owned_Py_None, 0, 0, __PYX_ERR(0, 104, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 104, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.learning_rate_trans.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_PyMonitoring_ExitScope(0);
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":105
 *     # transitions
 *     cdef public float learning_rate_trans
 *     cdef public np.ndarray transitions             # <<<<<<<<<<<<<<
 * 
 *     # the score for a given path
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11transitions_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11transitions_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11transitions___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_11transitions___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[63]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[0], 105, 0, 0, 0, __PYX_ERR(0, 105, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->transitions);
  __pyx_r = ((PyObject *)__pyx_v_self->transitions);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 105, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 105, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.transitions.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11transitions_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11transitions_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11transitions_2__set__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11transitions_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[64]))
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_TraceStartFunc("__set__", __pyx_f[0], 105, 0, 0, 0, __PYX_ERR(0, 105, __pyx_L1_error));
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->transitions);
  __Pyx_DECREF((PyObject *)__pyx_v_self->transitions);
  __pyx_v_self->transitions = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_TraceReturnCValue(__pyx_r, __Pyx_Owned_Py_None, 0, 0, __PYX_ERR(0, 105, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 105, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.transitions.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11transitions_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11transitions_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11transitions_4__del__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_11transitions_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  int __pyx_r;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[65]))
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_TraceStartFunc("__del__", __pyx_f[0], 105, 0, 0, 0, __PYX_ERR(0, 105, __pyx_L1_error));
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->transitions);
  __Pyx_DECREF((PyObject *)__pyx_v_self->transitions);
  __pyx_v_self->transitions = ((PyArrayObject *)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_TraceReturnCValue(__pyx_r, __Pyx_Owned_Py_None, 0, 0, __PYX_ERR(0, 105, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 105, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.transitions.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":108
 * 
 *     # the score for a given path
 *     cdef readonly float answer_score             # <<<<<<<<<<<<<<
 * 
 *     # gradients
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_12answer_score_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_12answer_score_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_12answer_score___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_12answer_score___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[66]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[0], 108, 0, 0, 0, __PYX_ERR(0, 108, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->answer_score); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 108, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 108, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.answer_score.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":111
 * 
 *     # gradients
 *     cdef readonly np.ndarray net_gradients, trans_gradients             # <<<<<<<<<<<<<<
 *     cdef readonly np.ndarray input_sent_values, hidden_sent_values, layer2_sent_values
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_13net_gradients_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_13net_gradients_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_13net_gradients___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_13net_gradients___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[67]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[0], 111, 0, 0, 0, __PYX_ERR(0, 111, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->net_gradients);
  __pyx_r = ((PyObject *)__pyx_v_self->net_gradients);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 111, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 111, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.net_gradients.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_15trans_gradients_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_15trans_gradients_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_15trans_gradients___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_15trans_gradients___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[68]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[0], 111, 0, 0, 0, __PYX_ERR(0, 111, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->trans_gradients);
  __pyx_r = ((PyObject *)__pyx_v_self->trans_gradients);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 111, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 111, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.trans_gradients.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":112
 *     # gradients
 *     cdef readonly np.ndarray net_gradients, trans_gradients
 *     cdef readonly np.ndarray input_sent_values, hidden_sent_values, layer2_sent_values             # <<<<<<<<<<<<<<
 * 
 *     # data for statistics during training.
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_17input_sent_values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_17input_sent_values_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_17input_sent_values___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_17input_sent_values___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[69]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[0], 112, 0, 0, 0, __PYX_ERR(0, 112, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->input_sent_values);
  __pyx_r = ((PyObject *)__pyx_v_self->input_sent_values);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 112, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 112, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.input_sent_values.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_18hidden_sent_values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_18hidden_sent_values_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_18hidden_sent_values___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_18hidden_sent_values___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[70]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[0], 112, 0, 0, 0, __PYX_ERR(0, 112, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden_sent_values);
  __pyx_r = ((PyObject *)__pyx_v_self->hidden_sent_values);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 112, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 112, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.hidden_sent_values.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_18layer2_sent_values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_18layer2_sent_values_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_18layer2_sent_values___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_18layer2_sent_values___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[71]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[0], 112, 0, 0, 0, __PYX_ERR(0, 112, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->layer2_sent_values);
  __pyx_r = ((PyObject *)__pyx_v_self->layer2_sent_values);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 112, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 112, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.layer2_sent_values.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":119
 * 
 *     # file where the network is saved
 *     cdef public str network_filename             # <<<<<<<<<<<<<<
 *     cdef public str network_text_filename
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_16network_filename_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_16network_filename_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_16network_filename___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_16network_filename___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[72]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[0], 119, 0, 0, 0, __PYX_ERR(0, 119, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->network_filename);
  __pyx_r = __pyx_v_self->network_filename;
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 119, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 119, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.network_filename.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_16network_filename_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_16network_filename_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_16network_filename_2__set__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_16network_filename_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[73]))
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_TraceStartFunc("__set__", __pyx_f[0], 119, 0, 0, 0, __PYX_ERR(0, 119, __pyx_L1_error));
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 119, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->network_filename);
  __Pyx_DECREF(__pyx_v_self->network_filename);
  __pyx_v_self->network_filename = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_TraceReturnCValue(__pyx_r, __Pyx_Owned_Py_None, 0, 0, __PYX_ERR(0, 119, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 119, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.network_filename.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_16network_filename_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_16network_filename_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_16network_filename_4__del__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_16network_filename_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  int __pyx_r;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[74]))
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_TraceStartFunc("__del__", __pyx_f[0], 119, 0, 0, 0, __PYX_ERR(0, 119, __pyx_L1_error));
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->network_filename);
  __Pyx_DECREF(__pyx_v_self->network_filename);
  __pyx_v_self->network_filename = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_TraceReturnCValue(__pyx_r, __Pyx_Owned_Py_None, 0, 0, __PYX_ERR(0, 119, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 119, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.network_filename.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/network.pyx":120
 *     # file where the network is saved
 *     cdef public str network_filename
 *     cdef public str network_text_filename             # <<<<<<<<<<<<<<
 * 
 *     # validation
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_21network_text_filename_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_21network_text_filename_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_21network_text_filename___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_21network_text_filename___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[75]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[0], 120, 0, 0, 0, __PYX_ERR(0, 120, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->network_text_filename);
  __pyx_r = __pyx_v_self->network_text_filename;
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(0, 120, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 120, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.network_text_filename.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_21network_text_filename_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_21network_text_filename_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_21network_text_filename_2__set__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_21network_text_filename_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[76]))
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_TraceStartFunc("__set__", __pyx_f[0], 120, 0, 0, 0, __PYX_ERR(0, 120, __pyx_L1_error));
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 120, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->network_text_filename);
  __Pyx_DECREF(__pyx_v_self->network_text_filename);
  __pyx_v_self->network_text_filename = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_TraceReturnCValue(__pyx_r, __Pyx_Owned_Py_None, 0, 0, __PYX_ERR(0, 120, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 120, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.network_text_filename.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_21network_text_filename_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_7Network_21network_text_filename_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_21network_text_filename_4__del__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_7Network_21network_text_filename_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  int __pyx_r;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[77]))
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_TraceStartFunc("__del__", __pyx_f[0], 120, 0, 0, 0, __PYX_ERR(0, 120, __pyx_L1_error));
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->network_text_filename);
  __Pyx_DECREF(__pyx_v_self->network_text_filename);
  __pyx_v_self->network_text_filename = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_TraceReturnCValue(__pyx_r, __Pyx_Owned_Py_None, 0, 0, __PYX_ERR(0, 120, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(0, 120, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.network_text_filename.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_43__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_42__reduce_cython__, "Network.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_43__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_43__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_42__reduce_cython__};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_43__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_42__reduce_cython__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_42__reduce_cython__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_t_18;
  int __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[78]))
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
  __Pyx_TraceStartFunc("__reduce_cython__", __pyx_f[4], 1, 0, 0, 0, __PYX_ERR(4, 1, __pyx_L1_error));

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.accuracy, self.answer_score, self.decay_factor, self.error, self.feature_tables, self.features_per_token, self.float_errors, self.hidden_bias, self.hidden_sent_values, self.hidden_size, self.hidden_values, self.hidden_weights, self.input_sent_values, self.input_size, self.input_values, self.layer2_sent_values, self.layer2_values, self.learning_rate, self.learning_rate_features, self.learning_rate_trans, self.net_gradients, self.network_filename, self.network_text_filename, self.num_tokens, self.output_bias, self.output_size, self.output_weights, self.padding_left, self.padding_right, self.pos_padding, self.pre_padding, self.sentence_accuracy, self.sentence_lookup, self.skips, self.trans_gradients, self.transitions, self.use_learning_rate_decay, self.validation_sentences, self.validation_tags, self.word_window_size)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
*/
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->accuracy); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->answer_score); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->decay_factor); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->error); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_self->features_per_token); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_self->float_errors); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_self->hidden_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_self->input_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = PyFloat_FromDouble(__pyx_v_self->learning_rate); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = PyFloat_FromDouble(__pyx_v_self->learning_rate_features); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = PyFloat_FromDouble(__pyx_v_self->learning_rate_trans); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyLong_From_int(__pyx_v_self->num_tokens); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyLong_From_int(__pyx_v_self->output_size); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = PyFloat_FromDouble(__pyx_v_self->sentence_accuracy); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_15 = __Pyx_PyLong_From_int(__pyx_v_self->skips); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_16 = __Pyx_PyLong_From_int(__pyx_v_self->word_window_size); if (unlikely(!__pyx_t_16)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_17 = PyTuple_New(40); if (unlikely(!__pyx_t_17)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_1) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_2) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_t_3) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 3, __pyx_t_4) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->feature_tables);
  __Pyx_GIVEREF(__pyx_v_self->feature_tables);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 4, __pyx_v_self->feature_tables) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 5, __pyx_t_5) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 6, __pyx_t_6) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden_bias);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->hidden_bias);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 7, ((PyObject *)__pyx_v_self->hidden_bias)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden_sent_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->hidden_sent_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 8, ((PyObject *)__pyx_v_self->hidden_sent_values)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 9, __pyx_t_7) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->hidden_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 10, ((PyObject *)__pyx_v_self->hidden_values)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden_weights);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->hidden_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 11, ((PyObject *)__pyx_v_self->hidden_weights)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->input_sent_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->input_sent_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 12, ((PyObject *)__pyx_v_self->input_sent_values)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 13, __pyx_t_8) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->input_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->input_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 14, ((PyObject *)__pyx_v_self->input_values)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->layer2_sent_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->layer2_sent_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 15, ((PyObject *)__pyx_v_self->layer2_sent_values)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->layer2_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->layer2_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 16, ((PyObject *)__pyx_v_self->layer2_values)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_9);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 17, __pyx_t_9) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_10);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 18, __pyx_t_10) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_11);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 19, __pyx_t_11) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->net_gradients);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->net_gradients);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 20, ((PyObject *)__pyx_v_self->net_gradients)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->network_filename);
  __Pyx_GIVEREF(__pyx_v_self->network_filename);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 21, __pyx_v_self->network_filename) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->network_text_filename);
  __Pyx_GIVEREF(__pyx_v_self->network_text_filename);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 22, __pyx_v_self->network_text_filename) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_12);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 23, __pyx_t_12) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->output_bias);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->output_bias);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 24, ((PyObject *)__pyx_v_self->output_bias)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_13);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 25, __pyx_t_13) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->output_weights);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->output_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 26, ((PyObject *)__pyx_v_self->output_weights)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->padding_left);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->padding_left);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 27, ((PyObject *)__pyx_v_self->padding_left)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->padding_right);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->padding_right);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 28, ((PyObject *)__pyx_v_self->padding_right)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pos_padding);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->pos_padding);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 29, ((PyObject *)__pyx_v_self->pos_padding)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pre_padding);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->pre_padding);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 30, ((PyObject *)__pyx_v_self->pre_padding)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_14);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 31, __pyx_t_14) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->sentence_lookup);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->sentence_lookup);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 32, ((PyObject *)__pyx_v_self->sentence_lookup)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_15);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 33, __pyx_t_15) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->trans_gradients);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->trans_gradients);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 34, ((PyObject *)__pyx_v_self->trans_gradients)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->transitions);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->transitions);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 35, ((PyObject *)__pyx_v_self->transitions)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->use_learning_rate_decay);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->use_learning_rate_decay);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 36, ((PyObject *)__pyx_v_self->use_learning_rate_decay)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->validation_sentences);
  __Pyx_GIVEREF(__pyx_v_self->validation_sentences);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 37, __pyx_v_self->validation_sentences) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->validation_tags);
  __Pyx_GIVEREF(__pyx_v_self->validation_tags);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 38, __pyx_v_self->validation_tags) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_16);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 39, __pyx_t_16) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_9 = 0;
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;
  __pyx_t_13 = 0;
  __pyx_t_14 = 0;
  __pyx_t_15 = 0;
  __pyx_t_16 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_17);
  __pyx_t_17 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.accuracy, self.answer_score, self.decay_factor, self.error, self.feature_tables, self.features_per_token, self.float_errors, self.hidden_bias, self.hidden_sent_values, self.hidden_size, self.hidden_values, self.hidden_weights, self.input_sent_values, self.input_size, self.input_values, self.layer2_sent_values, self.layer2_values, self.learning_rate, self.learning_rate_features, self.learning_rate_trans, self.net_gradients, self.network_filename, self.network_text_filename, self.num_tokens, self.output_bias, self.output_size, self.output_weights, self.padding_left, self.padding_right, self.pos_padding, self.pre_padding, self.sentence_accuracy, self.sentence_lookup, self.skips, self.trans_gradients, self.transitions, self.use_learning_rate_decay, self.validation_sentences, self.validation_tags, self.word_window_size)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
*/
  __pyx_t_17 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_17)) __PYX_ERR(4, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_v__dict = __pyx_t_17;
  __pyx_t_17 = 0;

  /* "(tree fragment)":7
 *     state = (self.accuracy, self.answer_score, self.decay_factor, self.error, self.feature_tables, self.features_per_token, self.float_errors, self.hidden_bias, self.hidden_sent_values, self.hidden_size, self.hidden_values, self.hidden_weights, self.input_sent_values, self.input_size, self.input_values, self.layer2_sent_values, self.layer2_values, self.learning_rate, self.learning_rate_features, self.learning_rate_trans, self.net_gradients, self.network_filename, self.network_text_filename, self.num_tokens, self.output_bias, self.output_size, self.output_weights, self.padding_left, self.padding_right, self.pos_padding, self.pre_padding, self.sentence_accuracy, self.sentence_lookup, self.skips, self.trans_gradients, self.transitions, self.use_learning_rate_decay, self.validation_sentences, self.validation_tags, self.word_window_size)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_18 = (__pyx_v__dict != Py_None);
  if (__pyx_t_18) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) __PYX_ERR(4, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_v__dict) != (0)) __PYX_ERR(4, 8, __pyx_L1_error);
    __pyx_t_16 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_17); if (unlikely(!__pyx_t_16)) __PYX_ERR(4, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_16));
    __pyx_t_16 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.feature_tables is not None or self.hidden_bias is not None or self.hidden_sent_values is not None or self.hidden_values is not None or self.hidden_weights is not None or self.input_sent_values is not None or self.input_values is not None or self.layer2_sent_values is not None or self.layer2_values is not None or self.net_gradients is not None or self.network_filename is not None or self.network_text_filename is not None or self.output_bias is not None or self.output_weights is not None or self.padding_left is not None or self.padding_right is not None or self.pos_padding is not None or self.pre_padding is not None or self.sentence_lookup is not None or self.trans_gradients is not None or self.transitions is not None or self.use_learning_rate_decay is not None or self.validation_sentences is not None or self.validation_tags is not None
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.accuracy, self.answer_score, self.decay_factor, self.error, self.feature_tables, self.features_per_token, self.float_errors, self.hidden_bias, self.hidden_sent_values, self.hidden_size, self.hidden_values, self.hidden_weights, self.input_sent_values, self.input_size, self.input_values, self.layer2_sent_values, self.layer2_values, self.learning_rate, self.learning_rate_features, self.learning_rate_trans, self.net_gradients, self.network_filename, self.network_text_filename, self.num_tokens, self.output_bias, self.output_size, self.output_weights, self.padding_left, self.padding_right, self.pos_padding, self.pre_padding, self.sentence_accuracy, self.sentence_lookup, self.skips, self.trans_gradients, self.transitions, self.use_learning_rate_decay, self.validation_sentences, self.validation_tags, self.word_window_size)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.feature_tables is not None or self.hidden_bias is not None or self.hidden_sent_values is not None or self.hidden_values is not None or self.hidden_weights is not None or self.input_sent_values is not None or self.input_values is not None or self.layer2_sent_values is not None or self.layer2_values is not None or self.net_gradients is not None or self.network_filename is not None or self.network_text_filename is not None or self.output_bias is not None or self.output_weights is not None or self.padding_left is not None or self.padding_right is not None or self.pos_padding is not None or self.pre_padding is not None or self.sentence_lookup is not None or self.trans_gradients is not None or self.transitions is not None or self.use_learning_rate_decay is not None or self.validation_sentences is not None or self.validation_tags is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_Network, (type(self), 0x72479d4, None), state
*/
  /*else*/ {
    __pyx_t_19 = (__pyx_v_self->feature_tables != ((PyObject*)Py_None));
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->hidden_bias) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->hidden_sent_values) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->hidden_values) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->hidden_weights) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->input_sent_values) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->input_values) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->layer2_sent_values) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->layer2_values) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->net_gradients) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (__pyx_v_self->network_filename != ((PyObject*)Py_None));
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (__pyx_v_self->network_text_filename != ((PyObject*)Py_None));
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->output_bias) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->output_weights) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->padding_left) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->padding_right) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->pos_padding) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->pre_padding) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->sentence_lookup) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->trans_gradients) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->transitions) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (((PyObject *)__pyx_v_self->use_learning_rate_decay) != Py_None);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (__pyx_v_self->validation_sentences != ((PyObject*)Py_None));
    if (!__pyx_t_19) {
    } else {
      __pyx_t_18 = __pyx_t_19;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_19 = (__pyx_v_self->validation_tags != ((PyObject*)Py_None));
    __pyx_t_18 = __pyx_t_19;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_18;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.feature_tables is not None or self.hidden_bias is not None or self.hidden_sent_values is not None or self.hidden_values is not None or self.hidden_weights is not None or self.input_sent_values is not None or self.input_values is not None or self.layer2_sent_values is not None or self.layer2_values is not None or self.net_gradients is not None or self.network_filename is not None or self.network_text_filename is not None or self.output_bias is not None or self.output_weights is not None or self.padding_left is not None or self.padding_right is not None or self.pos_padding is not None or self.pre_padding is not None or self.sentence_lookup is not None or self.trans_gradients is not None or self.transitions is not None or self.use_learning_rate_decay is not None or self.validation_sentences is not None or self.validation_tags is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Network, (type(self), 0x72479d4, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = self.feature_tables is not None or self.hidden_bias is not None or self.hidden_sent_values is not None or self.hidden_values is not None or self.hidden_weights is not None or self.input_sent_values is not None or self.input_values is not None or self.layer2_sent_values is not None or self.layer2_values is not None or self.net_gradients is not None or self.network_filename is not None or self.network_text_filename is not None or self.output_bias is not None or self.output_weights is not None or self.padding_left is not None or self.padding_right is not None or self.pos_padding is not None or self.pre_padding is not None or self.sentence_lookup is not None or self.trans_gradients is not None or self.transitions is not None or self.use_learning_rate_decay is not None or self.validation_sentences is not None or self.validation_tags is not None
 *     if use_setstate:
 *         return __pyx_unpickle_Network, (type(self), 0x72479d4, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_Network, (type(self), 0x72479d4, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Network); if (unlikely(!__pyx_t_16)) __PYX_ERR(4, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __pyx_t_17 = PyTuple_New(3); if (unlikely(!__pyx_t_17)) __PYX_ERR(4, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(4, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_119830996);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_119830996);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_mstate_global->__pyx_int_119830996) != (0)) __PYX_ERR(4, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 2, Py_None) != (0)) __PYX_ERR(4, 13, __pyx_L1_error);
    __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_GIVEREF(__pyx_t_16);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_16) != (0)) __PYX_ERR(4, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_17);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_17) != (0)) __PYX_ERR(4, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_v_state) != (0)) __PYX_ERR(4, 13, __pyx_L1_error);
    __pyx_t_16 = 0;
    __pyx_t_17 = 0;
    __pyx_r = __pyx_t_15;
    __pyx_t_15 = 0;
    __Pyx_TraceReturnValue(__pyx_r, 218, 0, __PYX_ERR(4, 13, __pyx_L1_error));
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.feature_tables is not None or self.hidden_bias is not None or self.hidden_sent_values is not None or self.hidden_values is not None or self.hidden_weights is not None or self.input_sent_values is not None or self.input_values is not None or self.layer2_sent_values is not None or self.layer2_values is not None or self.net_gradients is not None or self.network_filename is not None or self.network_text_filename is not None or self.output_bias is not None or self.output_weights is not None or self.padding_left is not None or self.padding_right is not None or self.pos_padding is not None or self.pre_padding is not None or self.sentence_lookup is not None or self.trans_gradients is not None or self.transitions is not None or self.use_learning_rate_decay is not None or self.validation_sentences is not None or self.validation_tags is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Network, (type(self), 0x72479d4, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_Network, (type(self), 0x72479d4, None), state
 *     else:
 *         return __pyx_unpickle_Network, (type(self), 0x72479d4, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Network__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Network); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_17 = PyTuple_New(3); if (unlikely(!__pyx_t_17)) __PYX_ERR(4, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(4, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_119830996);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_119830996);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_mstate_global->__pyx_int_119830996) != (0)) __PYX_ERR(4, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_v_state) != (0)) __PYX_ERR(4, 15, __pyx_L1_error);
    __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(4, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_GIVEREF(__pyx_t_15);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15) != (0)) __PYX_ERR(4, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_17);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_17) != (0)) __PYX_ERR(4, 15, __pyx_L1_error);
    __pyx_t_15 = 0;
    __pyx_t_17 = 0;
    __pyx_r = __pyx_t_16;
    __pyx_t_16 = 0;
    __Pyx_TraceReturnValue(__pyx_r, 226, 0, __PYX_ERR(4, 15, __pyx_L1_error));
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(4, 1, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Network, (type(self), 0x72479d4, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Network__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_45__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_7Network_44__setstate_cython__, "Network.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_7Network_45__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_45__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_44__setstate_cython__};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_7Network_45__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 16, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 16, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < 0) __PYX_ERR(4, 16, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(4, 16, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 16, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(4, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_7Network_44__setstate_cython__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_7Network_44__setstate_cython__(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[79]))
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
  __Pyx_TraceStartFunc("__setstate_cython__", __pyx_f[4], 16, 0, 0, 0, __PYX_ERR(4, 16, __pyx_L1_error));

  /* "(tree fragment)":17
 *         return __pyx_unpickle_Network, (type(self), 0x72479d4, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Network__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(4, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_6nltkor_3tag_4libs_7network___pyx_unpickle_Network__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Network, (type(self), 0x72479d4, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Network__set_state(self, __pyx_state)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(4, 16, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(4, 16, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.Network.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":51
 *     cdef list validation_predicates, validation_arguments
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def create_new(cls, feature_tables, target_dist_table, pred_dist_table,
 *                    int word_window, int hidden1_size, int hidden2_size, int output_size):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_1create_new(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_create_new, "ConvolutionalNetwork.create_new(cls, feature_tables, target_dist_table, pred_dist_table, int word_window, int hidden1_size, int hidden2_size, int output_size)\nCreates a new convolutional neural network.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_1create_new = {"create_new", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_1create_new, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_create_new};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_1create_new(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_feature_tables = 0;
  PyObject *__pyx_v_target_dist_table = 0;
  PyObject *__pyx_v_pred_dist_table = 0;
  int __pyx_v_word_window;
  int __pyx_v_hidden1_size;
  int __pyx_v_hidden2_size;
  int __pyx_v_output_size;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[7] = {0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create_new (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_feature_tables,&__pyx_mstate_global->__pyx_n_u_target_dist_table,&__pyx_mstate_global->__pyx_n_u_pred_dist_table,&__pyx_mstate_global->__pyx_n_u_word_window,&__pyx_mstate_global->__pyx_n_u_hidden1_size,&__pyx_mstate_global->__pyx_n_u_hidden2_size,&__pyx_mstate_global->__pyx_n_u_output_size,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 51, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(1, 51, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(1, 51, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 51, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 51, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 51, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 51, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 51, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create_new", 0) < 0) __PYX_ERR(1, 51, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 7; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("create_new", 1, 7, 7, i); __PYX_ERR(1, 51, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 7)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 51, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 51, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 51, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 51, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 51, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(1, 51, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(1, 51, __pyx_L3_error)
    }
    __pyx_v_feature_tables = values[0];
    __pyx_v_target_dist_table = values[1];
    __pyx_v_pred_dist_table = values[2];
    __pyx_v_word_window = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_word_window == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 53, __pyx_L3_error)
    __pyx_v_hidden1_size = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_hidden1_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 53, __pyx_L3_error)
    __pyx_v_hidden2_size = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_hidden2_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 53, __pyx_L3_error)
    __pyx_v_output_size = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_output_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 53, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create_new", 1, 7, 7, __pyx_nargs); __PYX_ERR(1, 51, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.create_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_create_new(((PyTypeObject*)__pyx_v_cls), __pyx_v_feature_tables, __pyx_v_target_dist_table, __pyx_v_pred_dist_table, __pyx_v_word_window, __pyx_v_hidden1_size, __pyx_v_hidden2_size, __pyx_v_output_size);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_10create_new_2generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "nltkor/tag/libs/networkconv.pyx":56
 *         """Creates a new convolutional neural network."""
 *         # sum the number of features in all tables except for distance
 *         cdef int input_size = sum(table.shape[1] for table in feature_tables)             # <<<<<<<<<<<<<<
 *         input_size *= word_window
 * 
*/

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_10create_new_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr *)__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(1, 56, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_10create_new_2generator3, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[80]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_create_new_locals_genexpr, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network); if (unlikely(!gen)) __PYX_ERR(1, 56, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.create_new.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_10create_new_2generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsGen
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_TraceStartGen("genexpr", __pyx_f[1], 56, 0, 0, 0, __PYX_ERR(1, 56, __pyx_L1_error));
    __Pyx_TraceReturnValue(Py_None, 0, 0, __PYX_ERR(1, 56, __pyx_L1_error));
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  __Pyx_TraceStartGen("genexpr", __pyx_f[1], 56, 0, 0, 0, __PYX_ERR(1, 56, __pyx_L1_error));
  if (unlikely(__pyx_sent_value != Py_None)) {
    if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started generator");
    __PYX_ERR(1, 56, __pyx_L1_error)
  }
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(1, 56, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 56, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 56, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2);
        ++__pyx_t_2;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 56, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
        #endif
        ++__pyx_t_2;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 56, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 56, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_table);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_table, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_table, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_TraceYield(__pyx_r, 0, __PYX_ERR(1, 56, __pyx_L1_error));
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __Pyx_TraceResumeGen("genexpr", __pyx_f[1], 56, 0, __PYX_ERR(1, 56, __pyx_L1_error));
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(1, 56, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
  __Pyx_TraceReturnValue(Py_None, 0, 0, __PYX_ERR(1, 56, __pyx_L1_error));

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_TraceException(__pyx_lineno, 0, 0);
    __Pyx_Generator_Replace_StopIteration(0);
    __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_TraceExceptionUnwind(0, 0);
  }
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":51
 *     cdef list validation_predicates, validation_arguments
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def create_new(cls, feature_tables, target_dist_table, pred_dist_table,
 *                    int word_window, int hidden1_size, int hidden2_size, int output_size):
*/

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_create_new(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_feature_tables, PyObject *__pyx_v_target_dist_table, PyObject *__pyx_v_pred_dist_table, int __pyx_v_word_window, int __pyx_v_hidden1_size, int __pyx_v_hidden2_size, int __pyx_v_output_size) {
  int __pyx_v_input_size;
  PyObject *__pyx_v_dist_features_per_token = NULL;
  PyObject *__pyx_v_input_size_with_distance = NULL;
  PyObject *__pyx_v_high = NULL;
  PyObject *__pyx_v_hidden_weights = NULL;
  PyObject *__pyx_v_num_dist_features = NULL;
  PyObject *__pyx_v_target_dist_weights = NULL;
  PyObject *__pyx_v_pred_dist_weights = NULL;
  PyObject *__pyx_v_hidden_bias = NULL;
  PyObject *__pyx_v_hidden2_weights = NULL;
  PyObject *__pyx_v_hidden2_bias = NULL;
  PyObject *__pyx_v_output_dim = NULL;
  PyObject *__pyx_v_output_weights = NULL;
  PyObject *__pyx_v_output_bias = NULL;
  PyObject *__pyx_v_net = NULL;
  PyObject *__pyx_gb_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_10create_new_2generator3 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[81]))
  __Pyx_RefNannySetupContext("create_new", 0);
  __Pyx_TraceStartFunc("create_new", __pyx_f[1], 51, 0, 0, 0, __PYX_ERR(1, 51, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":56
 *         """Creates a new convolutional neural network."""
 *         # sum the number of features in all tables except for distance
 *         cdef int input_size = sum(table.shape[1] for table in feature_tables)             # <<<<<<<<<<<<<<
 *         input_size *= word_window
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_builtin_sum);
  __pyx_t_3 = __pyx_builtin_sum; 
  __pyx_t_4 = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_10create_new_genexpr(NULL, __pyx_v_feature_tables); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_6 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 56, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_input_size = __pyx_t_6;

  /* "nltkor/tag/libs/networkconv.pyx":57
 *         # sum the number of features in all tables except for distance
 *         cdef int input_size = sum(table.shape[1] for table in feature_tables)
 *         input_size *= word_window             # <<<<<<<<<<<<<<
 * 
 *         dist_features_per_token = target_dist_table.shape[1] + pred_dist_table.shape[1]
*/
  __pyx_v_input_size = (__pyx_v_input_size * __pyx_v_word_window);

  /* "nltkor/tag/libs/networkconv.pyx":59
 *         input_size *= word_window
 * 
 *         dist_features_per_token = target_dist_table.shape[1] + pred_dist_table.shape[1]             # <<<<<<<<<<<<<<
 *         input_size_with_distance = input_size + (word_window * dist_features_per_token)
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_target_dist_table, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pred_dist_table, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_dist_features_per_token = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":60
 * 
 *         dist_features_per_token = target_dist_table.shape[1] + pred_dist_table.shape[1]
 *         input_size_with_distance = input_size + (word_window * dist_features_per_token)             # <<<<<<<<<<<<<<
 * 
 *         # creates the weight matrices
*/
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_input_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_word_window); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_v_dist_features_per_token); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_input_size_with_distance = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":63
 * 
 *         # creates the weight matrices
 *         high = 2.38 / np.sqrt(input_size_with_distance) # [Bottou-88]             # <<<<<<<<<<<<<<
 *         hidden_weights = np.random.uniform(-high, high, (hidden1_size, input_size))
 * 
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_sqrt); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_input_size_with_distance};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 63, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_2 = __Pyx_PyFloat_TrueDivideCObj(__pyx_mstate_global->__pyx_float_2_38, __pyx_t_4, 2.38, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_high = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":64
 *         # creates the weight matrices
 *         high = 2.38 / np.sqrt(input_size_with_distance) # [Bottou-88]
 *         hidden_weights = np.random.uniform(-high, high, (hidden1_size, input_size))             # <<<<<<<<<<<<<<
 * 
 *         num_dist_features = word_window * target_dist_table.shape[1]
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __pyx_t_1;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_3 = PyNumber_Negative(__pyx_v_high); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_hidden1_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_input_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7) != (0)) __PYX_ERR(1, 64, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8) != (0)) __PYX_ERR(1, 64, __pyx_L1_error);
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_t_3, __pyx_v_high, __pyx_t_9};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_uniform, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 64, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_hidden_weights = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":66
 *         hidden_weights = np.random.uniform(-high, high, (hidden1_size, input_size))
 * 
 *         num_dist_features = word_window * target_dist_table.shape[1]             # <<<<<<<<<<<<<<
 *         target_dist_weights = np.random.uniform(-high, high, (num_dist_features, hidden1_size))
 *         num_dist_features = word_window * pred_dist_table.shape[1]
*/
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_word_window); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_target_dist_table, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_v_num_dist_features = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":67
 * 
 *         num_dist_features = word_window * target_dist_table.shape[1]
 *         target_dist_weights = np.random.uniform(-high, high, (num_dist_features, hidden1_size))             # <<<<<<<<<<<<<<
 *         num_dist_features = word_window * pred_dist_table.shape[1]
 *         pred_dist_weights = np.random.uniform(-high, high, (num_dist_features, hidden1_size))
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_9 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_9);
  __pyx_t_2 = PyNumber_Negative(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_hidden1_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_INCREF(__pyx_v_num_dist_features);
  __Pyx_GIVEREF(__pyx_v_num_dist_features);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_num_dist_features) != (0)) __PYX_ERR(1, 67, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4) != (0)) __PYX_ERR(1, 67, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_t_2, __pyx_v_high, __pyx_t_8};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_uniform, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 67, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_target_dist_weights = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":68
 *         num_dist_features = word_window * target_dist_table.shape[1]
 *         target_dist_weights = np.random.uniform(-high, high, (num_dist_features, hidden1_size))
 *         num_dist_features = word_window * pred_dist_table.shape[1]             # <<<<<<<<<<<<<<
 *         pred_dist_weights = np.random.uniform(-high, high, (num_dist_features, hidden1_size))
 * 
*/
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_word_window); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pred_dist_table, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF_SET(__pyx_v_num_dist_features, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":69
 *         target_dist_weights = np.random.uniform(-high, high, (num_dist_features, hidden1_size))
 *         num_dist_features = word_window * pred_dist_table.shape[1]
 *         pred_dist_weights = np.random.uniform(-high, high, (num_dist_features, hidden1_size))             # <<<<<<<<<<<<<<
 * 
 *         high = 2.38 / np.sqrt(hidden1_size)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = __pyx_t_2;
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_1 = PyNumber_Negative(__pyx_v_high); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_9 = __Pyx_PyLong_From_int(__pyx_v_hidden1_size); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_num_dist_features);
  __Pyx_GIVEREF(__pyx_v_num_dist_features);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_num_dist_features) != (0)) __PYX_ERR(1, 69, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_9);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_9) != (0)) __PYX_ERR(1, 69, __pyx_L1_error);
  __pyx_t_9 = 0;
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_8, __pyx_t_1, __pyx_v_high, __pyx_t_4};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_uniform, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 69, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_pred_dist_weights = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":71
 *         pred_dist_weights = np.random.uniform(-high, high, (num_dist_features, hidden1_size))
 * 
 *         high = 2.38 / np.sqrt(hidden1_size)             # <<<<<<<<<<<<<<
 *         hidden_bias = np.random.uniform(-high, high, hidden1_size)
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_hidden1_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 71, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_1 = __Pyx_PyFloat_TrueDivideCObj(__pyx_mstate_global->__pyx_float_2_38, __pyx_t_3, 2.38, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_high, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":72
 * 
 *         high = 2.38 / np.sqrt(hidden1_size)
 *         hidden_bias = np.random.uniform(-high, high, hidden1_size)             # <<<<<<<<<<<<<<
 * 
 *         if hidden2_size > 0:
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = __pyx_t_2;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = PyNumber_Negative(__pyx_v_high); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_hidden1_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_t_4, __pyx_v_high, __pyx_t_8};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_uniform, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 72, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_hidden_bias = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":74
 *         hidden_bias = np.random.uniform(-high, high, hidden1_size)
 * 
 *         if hidden2_size > 0:             # <<<<<<<<<<<<<<
 *             hidden2_weights = np.random.uniform(-high, high, (hidden2_size, hidden1_size))
 *             high = 2.38 / np.sqrt(hidden2_size)
*/
  __pyx_t_10 = (__pyx_v_hidden2_size > 0);
  if (__pyx_t_10) {

    /* "nltkor/tag/libs/networkconv.pyx":75
 * 
 *         if hidden2_size > 0:
 *             hidden2_weights = np.random.uniform(-high, high, (hidden2_size, hidden1_size))             # <<<<<<<<<<<<<<
 *             high = 2.38 / np.sqrt(hidden2_size)
 *             hidden2_bias = np.random.uniform(-high, high, hidden2_size)
*/
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 75, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 75, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_2 = __pyx_t_4;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_8 = PyNumber_Negative(__pyx_v_high); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 75, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_hidden2_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 75, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = __Pyx_PyLong_From_int(__pyx_v_hidden1_size); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 75, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 75, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3) != (0)) __PYX_ERR(1, 75, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_9);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_9) != (0)) __PYX_ERR(1, 75, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_9 = 0;
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_t_8, __pyx_v_high, __pyx_t_7};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_uniform, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 75, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_v_hidden2_weights = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":76
 *         if hidden2_size > 0:
 *             hidden2_weights = np.random.uniform(-high, high, (hidden2_size, hidden1_size))
 *             high = 2.38 / np.sqrt(hidden2_size)             # <<<<<<<<<<<<<<
 *             hidden2_bias = np.random.uniform(-high, high, hidden2_size)
 *             output_dim = (output_size, hidden2_size)
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 76, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_sqrt); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 76, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_hidden2_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 76, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_7};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 76, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_8 = __Pyx_PyFloat_TrueDivideCObj(__pyx_mstate_global->__pyx_float_2_38, __pyx_t_1, 2.38, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 76, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_high, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":77
 *             hidden2_weights = np.random.uniform(-high, high, (hidden2_size, hidden1_size))
 *             high = 2.38 / np.sqrt(hidden2_size)
 *             hidden2_bias = np.random.uniform(-high, high, hidden2_size)             # <<<<<<<<<<<<<<
 *             output_dim = (output_size, hidden2_size)
 *         else:
*/
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 77, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 77, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_1 = __pyx_t_4;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_7 = PyNumber_Negative(__pyx_v_high); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 77, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_hidden2_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 77, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_t_7, __pyx_v_high, __pyx_t_2};
      __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_uniform, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 77, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
    }
    __pyx_v_hidden2_bias = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":78
 *             high = 2.38 / np.sqrt(hidden2_size)
 *             hidden2_bias = np.random.uniform(-high, high, hidden2_size)
 *             output_dim = (output_size, hidden2_size)             # <<<<<<<<<<<<<<
 *         else:
 *             hidden2_weights = None
*/
    __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_output_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 78, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_hidden2_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 78, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 78, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8) != (0)) __PYX_ERR(1, 78, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4) != (0)) __PYX_ERR(1, 78, __pyx_L1_error);
    __pyx_t_8 = 0;
    __pyx_t_4 = 0;
    __pyx_v_output_dim = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":74
 *         hidden_bias = np.random.uniform(-high, high, hidden1_size)
 * 
 *         if hidden2_size > 0:             # <<<<<<<<<<<<<<
 *             hidden2_weights = np.random.uniform(-high, high, (hidden2_size, hidden1_size))
 *             high = 2.38 / np.sqrt(hidden2_size)
*/
    goto __pyx_L3;
  }

  /* "nltkor/tag/libs/networkconv.pyx":80
 *             output_dim = (output_size, hidden2_size)
 *         else:
 *             hidden2_weights = None             # <<<<<<<<<<<<<<
 *             hidden2_bias = None
 *             output_dim = (output_size, hidden1_size)
*/
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __pyx_v_hidden2_weights = Py_None;

    /* "nltkor/tag/libs/networkconv.pyx":81
 *         else:
 *             hidden2_weights = None
 *             hidden2_bias = None             # <<<<<<<<<<<<<<
 *             output_dim = (output_size, hidden1_size)
 * 
*/
    __Pyx_INCREF(Py_None);
    __pyx_v_hidden2_bias = Py_None;

    /* "nltkor/tag/libs/networkconv.pyx":82
 *             hidden2_weights = None
 *             hidden2_bias = None
 *             output_dim = (output_size, hidden1_size)             # <<<<<<<<<<<<<<
 * 
 *         high = 2.38 / np.sqrt(output_dim[1])
*/
    __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_output_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 82, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_hidden1_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 82, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 82, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2) != (0)) __PYX_ERR(1, 82, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4) != (0)) __PYX_ERR(1, 82, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_t_4 = 0;
    __pyx_v_output_dim = __pyx_t_8;
    __pyx_t_8 = 0;
  }
  __pyx_L3:;

  /* "nltkor/tag/libs/networkconv.pyx":84
 *             output_dim = (output_size, hidden1_size)
 * 
 *         high = 2.38 / np.sqrt(output_dim[1])             # <<<<<<<<<<<<<<
 *         output_weights = np.random.uniform(-high, high, output_dim)
 *         high = 2.38 / np.sqrt(output_size)
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_sqrt); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_output_dim, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
    __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 84, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  __pyx_t_7 = __Pyx_PyFloat_TrueDivideCObj(__pyx_mstate_global->__pyx_float_2_38, __pyx_t_8, 2.38, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF_SET(__pyx_v_high, __pyx_t_7);
  __pyx_t_7 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":85
 * 
 *         high = 2.38 / np.sqrt(output_dim[1])
 *         output_weights = np.random.uniform(-high, high, output_dim)             # <<<<<<<<<<<<<<
 *         high = 2.38 / np.sqrt(output_size)
 *         output_bias = np.random.uniform(-high, high, output_size)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_2 = PyNumber_Negative(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_8, __pyx_t_2, __pyx_v_high, __pyx_v_output_dim};
    __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_uniform, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 85, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  }
  __pyx_v_output_weights = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":86
 *         high = 2.38 / np.sqrt(output_dim[1])
 *         output_weights = np.random.uniform(-high, high, output_dim)
 *         high = 2.38 / np.sqrt(output_size)             # <<<<<<<<<<<<<<
 *         output_bias = np.random.uniform(-high, high, output_size)
 * 
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_sqrt); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_output_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
    __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 86, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  }
  __pyx_t_8 = __Pyx_PyFloat_TrueDivideCObj(__pyx_mstate_global->__pyx_float_2_38, __pyx_t_7, 2.38, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF_SET(__pyx_v_high, __pyx_t_8);
  __pyx_t_8 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":87
 *         output_weights = np.random.uniform(-high, high, output_dim)
 *         high = 2.38 / np.sqrt(output_size)
 *         output_bias = np.random.uniform(-high, high, output_size)             # <<<<<<<<<<<<<<
 * 
 *         net = cls(word_window, input_size, hidden1_size, hidden2_size,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_2 = PyNumber_Negative(__pyx_v_high); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_output_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_t_2, __pyx_v_high, __pyx_t_1};
    __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_uniform, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 87, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  __pyx_v_output_bias = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":89
 *         output_bias = np.random.uniform(-high, high, output_size)
 * 
 *         net = cls(word_window, input_size, hidden1_size, hidden2_size,             # <<<<<<<<<<<<<<
 *                   output_size, hidden_weights, hidden_bias,
 *                   target_dist_weights, pred_dist_weights,
*/
  __pyx_t_4 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_v_cls);
  __pyx_t_1 = ((PyObject *)__pyx_v_cls); 
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_word_window); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_input_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_9 = __Pyx_PyLong_From_int(__pyx_v_hidden1_size); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_hidden2_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "nltkor/tag/libs/networkconv.pyx":90
 * 
 *         net = cls(word_window, input_size, hidden1_size, hidden2_size,
 *                   output_size, hidden_weights, hidden_bias,             # <<<<<<<<<<<<<<
 *                   target_dist_weights, pred_dist_weights,
 *                   hidden2_weights, hidden2_bias,
*/
  __pyx_t_11 = __Pyx_PyLong_From_int(__pyx_v_output_size); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);

  /* "nltkor/tag/libs/networkconv.pyx":93
 *                   target_dist_weights, pred_dist_weights,
 *                   hidden2_weights, hidden2_bias,
 *                   output_weights, output_bias)             # <<<<<<<<<<<<<<
 *         net.feature_tables = feature_tables
 *         net.target_dist_table = target_dist_table
*/
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[14] = {__pyx_t_4, __pyx_t_2, __pyx_t_7, __pyx_t_9, __pyx_t_3, __pyx_t_11, __pyx_v_hidden_weights, __pyx_v_hidden_bias, __pyx_v_target_dist_weights, __pyx_v_pred_dist_weights, __pyx_v_hidden2_weights, __pyx_v_hidden2_bias, __pyx_v_output_weights, __pyx_v_output_bias};
    __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_5, (14-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 89, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  __pyx_v_net = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":94
 *                   hidden2_weights, hidden2_bias,
 *                   output_weights, output_bias)
 *         net.feature_tables = feature_tables             # <<<<<<<<<<<<<<
 *         net.target_dist_table = target_dist_table
 *         net.pred_dist_table = pred_dist_table
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_net, __pyx_mstate_global->__pyx_n_u_feature_tables, __pyx_v_feature_tables) < 0) __PYX_ERR(1, 94, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":95
 *                   output_weights, output_bias)
 *         net.feature_tables = feature_tables
 *         net.target_dist_table = target_dist_table             # <<<<<<<<<<<<<<
 *         net.pred_dist_table = pred_dist_table
 * 
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_net, __pyx_mstate_global->__pyx_n_u_target_dist_table, __pyx_v_target_dist_table) < 0) __PYX_ERR(1, 95, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":96
 *         net.feature_tables = feature_tables
 *         net.target_dist_table = target_dist_table
 *         net.pred_dist_table = pred_dist_table             # <<<<<<<<<<<<<<
 * 
 *         return net
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_net, __pyx_mstate_global->__pyx_n_u_pred_dist_table, __pyx_v_pred_dist_table) < 0) __PYX_ERR(1, 96, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":98
 *         net.pred_dist_table = pred_dist_table
 * 
 *         return net             # <<<<<<<<<<<<<<
 * 
 *     def description(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_net);
  __pyx_r = __pyx_v_net;
  __Pyx_TraceReturnValue(__pyx_r, 189, 0, __PYX_ERR(1, 98, __pyx_L1_error));
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkconv.pyx":51
 *     cdef list validation_predicates, validation_arguments
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def create_new(cls, feature_tables, target_dist_table, pred_dist_table,
 *                    int word_window, int hidden1_size, int hidden2_size, int output_size):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 51, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.create_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dist_features_per_token);
  __Pyx_XDECREF(__pyx_v_input_size_with_distance);
  __Pyx_XDECREF(__pyx_v_high);
  __Pyx_XDECREF(__pyx_v_hidden_weights);
  __Pyx_XDECREF(__pyx_v_num_dist_features);
  __Pyx_XDECREF(__pyx_v_target_dist_weights);
  __Pyx_XDECREF(__pyx_v_pred_dist_weights);
  __Pyx_XDECREF(__pyx_v_hidden_bias);
  __Pyx_XDECREF(__pyx_v_hidden2_weights);
  __Pyx_XDECREF(__pyx_v_hidden2_bias);
  __Pyx_XDECREF(__pyx_v_output_dim);
  __Pyx_XDECREF(__pyx_v_output_weights);
  __Pyx_XDECREF(__pyx_v_output_bias);
  __Pyx_XDECREF(__pyx_v_net);
  __Pyx_XDECREF(__pyx_gb_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_10create_new_2generator3);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":100
 *         return net
 * 
 *     def description(self):             # <<<<<<<<<<<<<<
 *         """Returns a textual description of the network."""
 *         hidden2_size = 0 if self.hidden2_weights is None else self.hidden2_size
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_3description(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_2description, "ConvolutionalNetwork.description(self)\nReturns a textual description of the network.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_3description = {"description", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_3description, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_2description};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_3description(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("description (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("description", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("description", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_2description(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_2description(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  long __pyx_v_hidden2_size;
  PyObject *__pyx_v_table_dims = NULL;
  PyObject *__pyx_v_dist_table_dims = NULL;
  PyObject *__pyx_v_desc = NULL;
  PyObject *__pyx_8genexpr5__pyx_v_t = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  long __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  npy_intp *__pyx_t_8;
  PyObject *__pyx_t_9[3];
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12[15];
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[82]))
  __Pyx_RefNannySetupContext("description", 0);
  __Pyx_TraceStartFunc("description", __pyx_f[1], 100, 0, 0, 0, __PYX_ERR(1, 100, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":102
 *     def description(self):
 *         """Returns a textual description of the network."""
 *         hidden2_size = 0 if self.hidden2_weights is None else self.hidden2_size             # <<<<<<<<<<<<<<
 *         table_dims = [str(t.shape[1]) for t in self.feature_tables]
 *         table_dims =  ', '.join(table_dims)
*/
  __pyx_t_2 = (((PyObject *)__pyx_v_self->hidden2_weights) == Py_None);
  if (__pyx_t_2) {
    __pyx_t_1 = 0;
  } else {
    __pyx_t_1 = __pyx_v_self->hidden2_size;
  }
  __pyx_v_hidden2_size = __pyx_t_1;

  /* "nltkor/tag/libs/networkconv.pyx":103
 *         """Returns a textual description of the network."""
 *         hidden2_size = 0 if self.hidden2_weights is None else self.hidden2_size
 *         table_dims = [str(t.shape[1]) for t in self.feature_tables]             # <<<<<<<<<<<<<<
 *         table_dims =  ', '.join(table_dims)
 * 
*/
  { /* enter inner scope */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 103, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(__pyx_v_self->__pyx_base.feature_tables == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(1, 103, __pyx_L5_error)
    }
    __pyx_t_4 = __pyx_v_self->__pyx_base.feature_tables; __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 103, __pyx_L5_error)
        #endif
        if (__pyx_t_5 >= __pyx_temp) break;
      }
      __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_5);
      ++__pyx_t_5;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 103, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_t, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr5__pyx_v_t, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 103, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 103, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Unicode(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 103, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 103, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_t); __pyx_8genexpr5__pyx_v_t = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_t); __pyx_8genexpr5__pyx_v_t = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_v_table_dims = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":104
 *         hidden2_size = 0 if self.hidden2_weights is None else self.hidden2_size
 *         table_dims = [str(t.shape[1]) for t in self.feature_tables]
 *         table_dims =  ', '.join(table_dims)             # <<<<<<<<<<<<<<
 * 
 *         dist_table_dims = '%d, %d' % (self.target_dist_table.shape[1], self.pred_dist_table.shape[1])
*/
  __pyx_t_3 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u_, __pyx_v_table_dims); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_table_dims, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":106
 *         table_dims =  ', '.join(table_dims)
 * 
 *         dist_table_dims = '%d, %d' % (self.target_dist_table.shape[1], self.pred_dist_table.shape[1])             # <<<<<<<<<<<<<<
 * 
 *         desc = """
*/
  __pyx_t_3 = ((PyObject *)__pyx_v_self->target_dist_table);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_8 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_3)); if (unlikely(__pyx_t_8 == ((npy_intp *)0) && PyErr_Occurred())) __PYX_ERR(1, 106, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyLong_From_Py_intptr_t((__pyx_t_8[1])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_3), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = ((PyObject *)__pyx_v_self->pred_dist_table);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_8 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_3)); if (unlikely(__pyx_t_8 == ((npy_intp *)0) && PyErr_Occurred())) __PYX_ERR(1, 106, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyLong_From_Py_intptr_t((__pyx_t_8[1])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_3), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_9[0] = __pyx_t_4;
  __pyx_t_9[1] = __pyx_mstate_global->__pyx_kp_u_;
  __pyx_t_9[2] = __pyx_t_6;
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_9, 3, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6));
  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_dist_table_dims = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":116
 * Second hidden layer size: %d
 * Output size: %d
 * """ % (self.word_window_size, table_dims, dist_table_dims, self.input_size, self.hidden_size,             # <<<<<<<<<<<<<<
 *        hidden2_size, self.output_size)
 * 
*/
  __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_v_self->__pyx_base.word_window_size, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_table_dims), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_v_self->__pyx_base.input_size, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyUnicode_From_int(__pyx_v_self->__pyx_base.hidden_size, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "nltkor/tag/libs/networkconv.pyx":117
 * Output size: %d
 * """ % (self.word_window_size, table_dims, dist_table_dims, self.input_size, self.hidden_size,
 *        hidden2_size, self.output_size)             # <<<<<<<<<<<<<<
 * 
 *         return desc
*/
  __pyx_t_10 = __Pyx_PyUnicode_From_long(__pyx_v_hidden2_size, 0, ' ', 'd'); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_PyUnicode_From_int(__pyx_v_self->__pyx_base.output_size, 0, ' ', 'd'); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12[0] = __pyx_mstate_global->__pyx_kp_u_Word_window_size;
  __pyx_t_12[1] = __pyx_t_3;
  __pyx_t_12[2] = __pyx_mstate_global->__pyx_kp_u_Feature_table_sizes;
  __pyx_t_12[3] = __pyx_t_6;
  __pyx_t_12[4] = __pyx_mstate_global->__pyx_kp_u_Distance_table_sizes_target_and;
  __pyx_t_12[5] = __pyx_v_dist_table_dims;
  __pyx_t_12[6] = __pyx_mstate_global->__pyx_kp_u_Input_layer_size;
  __pyx_t_12[7] = __pyx_t_4;
  __pyx_t_12[8] = __pyx_mstate_global->__pyx_kp_u_Convolution_layer_size;
  __pyx_t_12[9] = __pyx_t_7;
  __pyx_t_12[10] = __pyx_mstate_global->__pyx_kp_u_Second_hidden_layer_size;
  __pyx_t_12[11] = __pyx_t_10;
  __pyx_t_12[12] = __pyx_mstate_global->__pyx_kp_u_Output_size;
  __pyx_t_12[13] = __pyx_t_11;
  __pyx_t_12[14] = __pyx_mstate_global->__pyx_kp_u__2;

  /* "nltkor/tag/libs/networkconv.pyx":108
 *         dist_table_dims = '%d, %d' % (self.target_dist_table.shape[1], self.pred_dist_table.shape[1])
 * 
 *         desc = """             # <<<<<<<<<<<<<<
 * Word window size: %d
 * Feature table sizes: %s
*/
  __pyx_t_13 = __Pyx_PyUnicode_Join(__pyx_t_12, 15, 19 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 22 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 46 + __Pyx_PyUnicode_GET_LENGTH(__pyx_v_dist_table_dims) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 25 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 28 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10) + 14 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_dist_table_dims));
  if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_v_desc = ((PyObject*)__pyx_t_13);
  __pyx_t_13 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":119
 *        hidden2_size, self.output_size)
 * 
 *         return desc             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_desc);
  __pyx_r = __pyx_v_desc;
  __Pyx_TraceReturnValue(__pyx_r, 53, 0, __PYX_ERR(1, 119, __pyx_L1_error));
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkconv.pyx":100
 *         return net
 * 
 *     def description(self):             # <<<<<<<<<<<<<<
 *         """Returns a textual description of the network."""
 *         hidden2_size = 0 if self.hidden2_weights is None else self.hidden2_size
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 100, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.description", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_table_dims);
  __Pyx_XDECREF(__pyx_v_dist_table_dims);
  __Pyx_XDECREF(__pyx_v_desc);
  __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_t);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":122
 * 
 * 
 *     def __init__(self, word_window, input_size, hidden1_size, hidden2_size,             # <<<<<<<<<<<<<<
 *                  output_size, hidden1_weights, hidden1_bias, target_dist_weights,
 *                  pred_dist_weights, hidden2_weights, hidden2_bias,
*/

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_word_window = 0;
  PyObject *__pyx_v_input_size = 0;
  PyObject *__pyx_v_hidden1_size = 0;
  PyObject *__pyx_v_hidden2_size = 0;
  PyObject *__pyx_v_output_size = 0;
  PyObject *__pyx_v_hidden1_weights = 0;
  PyObject *__pyx_v_hidden1_bias = 0;
  PyObject *__pyx_v_target_dist_weights = 0;
  PyObject *__pyx_v_pred_dist_weights = 0;
  PyObject *__pyx_v_hidden2_weights = 0;
  PyObject *__pyx_v_hidden2_bias = 0;
  PyObject *__pyx_v_output_weights = 0;
  PyObject *__pyx_v_output_bias = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_word_window,&__pyx_mstate_global->__pyx_n_u_input_size,&__pyx_mstate_global->__pyx_n_u_hidden1_size,&__pyx_mstate_global->__pyx_n_u_hidden2_size,&__pyx_mstate_global->__pyx_n_u_output_size,&__pyx_mstate_global->__pyx_n_u_hidden1_weights,&__pyx_mstate_global->__pyx_n_u_hidden1_bias,&__pyx_mstate_global->__pyx_n_u_target_dist_weights,&__pyx_mstate_global->__pyx_n_u_pred_dist_weights,&__pyx_mstate_global->__pyx_n_u_hidden2_weights,&__pyx_mstate_global->__pyx_n_u_hidden2_bias,&__pyx_mstate_global->__pyx_n_u_output_weights,&__pyx_mstate_global->__pyx_n_u_output_bias,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 122, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 13:
        values[12] = __Pyx_ArgRef_VARARGS(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(1, 122, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_VARARGS(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(1, 122, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_VARARGS(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(1, 122, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_VARARGS(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(1, 122, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_VARARGS(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(1, 122, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_VARARGS(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(1, 122, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_VARARGS(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(1, 122, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(1, 122, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 122, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 122, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 122, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 122, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 122, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(1, 122, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 13; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 13, 13, i); __PYX_ERR(1, 122, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 13)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 122, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 122, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 122, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 122, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 122, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(1, 122, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_VARARGS(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(1, 122, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_VARARGS(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(1, 122, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_VARARGS(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(1, 122, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_VARARGS(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(1, 122, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_VARARGS(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(1, 122, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_VARARGS(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(1, 122, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_VARARGS(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(1, 122, __pyx_L3_error)
    }
    __pyx_v_word_window = values[0];
    __pyx_v_input_size = values[1];
    __pyx_v_hidden1_size = values[2];
    __pyx_v_hidden2_size = values[3];
    __pyx_v_output_size = values[4];
    __pyx_v_hidden1_weights = values[5];
    __pyx_v_hidden1_bias = values[6];
    __pyx_v_target_dist_weights = values[7];
    __pyx_v_pred_dist_weights = values[8];
    __pyx_v_hidden2_weights = values[9];
    __pyx_v_hidden2_bias = values[10];
    __pyx_v_output_weights = values[11];
    __pyx_v_output_bias = values[12];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 13, 13, __pyx_nargs); __PYX_ERR(1, 122, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_4__init__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v_word_window, __pyx_v_input_size, __pyx_v_hidden1_size, __pyx_v_hidden2_size, __pyx_v_output_size, __pyx_v_hidden1_weights, __pyx_v_hidden1_bias, __pyx_v_target_dist_weights, __pyx_v_pred_dist_weights, __pyx_v_hidden2_weights, __pyx_v_hidden2_bias, __pyx_v_output_weights, __pyx_v_output_bias);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_4__init__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_word_window, PyObject *__pyx_v_input_size, PyObject *__pyx_v_hidden1_size, PyObject *__pyx_v_hidden2_size, PyObject *__pyx_v_output_size, PyObject *__pyx_v_hidden1_weights, PyObject *__pyx_v_hidden1_bias, PyObject *__pyx_v_target_dist_weights, PyObject *__pyx_v_pred_dist_weights, PyObject *__pyx_v_hidden2_weights, PyObject *__pyx_v_hidden2_bias, PyObject *__pyx_v_output_weights, PyObject *__pyx_v_output_bias) {
  int __pyx_r;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[83]))
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_TraceStartFunc("__init__", __pyx_f[1], 122, 0, 0, 0, __PYX_ERR(1, 122, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":126
 *                  pred_dist_weights, hidden2_weights, hidden2_bias,
 *                  output_weights, output_bias):
 *         super(ConvolutionalNetwork, self).__init__(word_window, input_size,             # <<<<<<<<<<<<<<
 *                                                    hidden1_size, output_size,
 *                                                    hidden1_weights, hidden1_bias,
*/
  __pyx_t_4 = NULL;
  __Pyx_INCREF(__pyx_builtin_super);
  __pyx_t_5 = __pyx_builtin_super; 
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, ((PyObject *)__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork), ((PyObject *)__pyx_v_self)};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 126, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);

  /* "nltkor/tag/libs/networkconv.pyx":129
 *                                                    hidden1_size, output_size,
 *                                                    hidden1_weights, hidden1_bias,
 *                                                    output_weights, output_bias)             # <<<<<<<<<<<<<<
 *         self.half_window = word_window / 2
 *         self.features_per_token = self.input_size / word_window
*/
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[9] = {__pyx_t_2, __pyx_v_word_window, __pyx_v_input_size, __pyx_v_hidden1_size, __pyx_v_output_size, __pyx_v_hidden1_weights, __pyx_v_hidden1_bias, __pyx_v_output_weights, __pyx_v_output_bias};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_init, __pyx_callargs+__pyx_t_6, (9-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 126, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":130
 *                                                    hidden1_weights, hidden1_bias,
 *                                                    output_weights, output_bias)
 *         self.half_window = word_window / 2             # <<<<<<<<<<<<<<
 *         self.features_per_token = self.input_size / word_window
 * 
*/
  __pyx_t_1 = __Pyx_PyLong_TrueDivideObjC(__pyx_v_word_window, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 130, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->half_window = __pyx_t_7;

  /* "nltkor/tag/libs/networkconv.pyx":131
 *                                                    output_weights, output_bias)
 *         self.half_window = word_window / 2
 *         self.features_per_token = self.input_size / word_window             # <<<<<<<<<<<<<<
 * 
 *         self.transitions = None
*/
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.input_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_word_window); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = __Pyx_PyLong_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->__pyx_base.features_per_token = __pyx_t_7;

  /* "nltkor/tag/libs/networkconv.pyx":133
 *         self.features_per_token = self.input_size / word_window
 * 
 *         self.transitions = None             # <<<<<<<<<<<<<<
 *         self.target_dist_lookup = None
 *         self.pred_dist_lookup = None
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.transitions);
  __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.transitions);
  __pyx_v_self->__pyx_base.transitions = ((PyArrayObject *)Py_None);

  /* "nltkor/tag/libs/networkconv.pyx":134
 * 
 *         self.transitions = None
 *         self.target_dist_lookup = None             # <<<<<<<<<<<<<<
 *         self.pred_dist_lookup = None
 *         self.target_dist_weights = target_dist_weights
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->target_dist_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v_self->target_dist_lookup);
  __pyx_v_self->target_dist_lookup = ((PyArrayObject *)Py_None);

  /* "nltkor/tag/libs/networkconv.pyx":135
 *         self.transitions = None
 *         self.target_dist_lookup = None
 *         self.pred_dist_lookup = None             # <<<<<<<<<<<<<<
 *         self.target_dist_weights = target_dist_weights
 *         self.pred_dist_weights = pred_dist_weights
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->pred_dist_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v_self->pred_dist_lookup);
  __pyx_v_self->pred_dist_lookup = ((PyArrayObject *)Py_None);

  /* "nltkor/tag/libs/networkconv.pyx":136
 *         self.target_dist_lookup = None
 *         self.pred_dist_lookup = None
 *         self.target_dist_weights = target_dist_weights             # <<<<<<<<<<<<<<
 *         self.pred_dist_weights = pred_dist_weights
 * 
*/
  __pyx_t_3 = __pyx_v_target_dist_weights;
  __Pyx_INCREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 136, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->target_dist_weights);
  __Pyx_DECREF((PyObject *)__pyx_v_self->target_dist_weights);
  __pyx_v_self->target_dist_weights = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":137
 *         self.pred_dist_lookup = None
 *         self.target_dist_weights = target_dist_weights
 *         self.pred_dist_weights = pred_dist_weights             # <<<<<<<<<<<<<<
 * 
 *         self.hidden2_size = hidden2_size
*/
  __pyx_t_3 = __pyx_v_pred_dist_weights;
  __Pyx_INCREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 137, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->pred_dist_weights);
  __Pyx_DECREF((PyObject *)__pyx_v_self->pred_dist_weights);
  __pyx_v_self->pred_dist_weights = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":139
 *         self.pred_dist_weights = pred_dist_weights
 * 
 *         self.hidden2_size = hidden2_size             # <<<<<<<<<<<<<<
 *         self.hidden2_weights = hidden2_weights
 *         self.hidden2_bias = hidden2_bias
*/
  __pyx_t_7 = __Pyx_PyLong_As_int(__pyx_v_hidden2_size); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 139, __pyx_L1_error)
  __pyx_v_self->hidden2_size = __pyx_t_7;

  /* "nltkor/tag/libs/networkconv.pyx":140
 * 
 *         self.hidden2_size = hidden2_size
 *         self.hidden2_weights = hidden2_weights             # <<<<<<<<<<<<<<
 *         self.hidden2_bias = hidden2_bias
 * 
*/
  __pyx_t_3 = __pyx_v_hidden2_weights;
  __Pyx_INCREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 140, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden2_weights);
  __Pyx_DECREF((PyObject *)__pyx_v_self->hidden2_weights);
  __pyx_v_self->hidden2_weights = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":141
 *         self.hidden2_size = hidden2_size
 *         self.hidden2_weights = hidden2_weights
 *         self.hidden2_bias = hidden2_bias             # <<<<<<<<<<<<<<
 * 
 *         self.validation_predicates = None
*/
  __pyx_t_3 = __pyx_v_hidden2_bias;
  __Pyx_INCREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 141, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden2_bias);
  __Pyx_DECREF((PyObject *)__pyx_v_self->hidden2_bias);
  __pyx_v_self->hidden2_bias = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":143
 *         self.hidden2_bias = hidden2_bias
 * 
 *         self.validation_predicates = None             # <<<<<<<<<<<<<<
 *         self.validation_arguments = None
 * 
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->validation_predicates);
  __Pyx_DECREF(__pyx_v_self->validation_predicates);
  __pyx_v_self->validation_predicates = ((PyObject*)Py_None);

  /* "nltkor/tag/libs/networkconv.pyx":144
 * 
 *         self.validation_predicates = None
 *         self.validation_arguments = None             # <<<<<<<<<<<<<<
 * 
 *         self.use_learning_rate_decay = False
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->validation_arguments);
  __Pyx_DECREF(__pyx_v_self->validation_arguments);
  __pyx_v_self->validation_arguments = ((PyObject*)Py_None);

  /* "nltkor/tag/libs/networkconv.pyx":146
 *         self.validation_arguments = None
 * 
 *         self.use_learning_rate_decay = False             # <<<<<<<<<<<<<<
 * 
 *     def _generate_save_dict(self):
*/
  __Pyx_INCREF(Py_False);
  __Pyx_GIVEREF(Py_False);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.use_learning_rate_decay);
  __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.use_learning_rate_decay);
  __pyx_v_self->__pyx_base.use_learning_rate_decay = ((PyLongObject *)Py_False);

  /* "nltkor/tag/libs/networkconv.pyx":122
 * 
 * 
 *     def __init__(self, word_window, input_size, hidden1_size, hidden2_size,             # <<<<<<<<<<<<<<
 *                  output_size, hidden1_weights, hidden1_bias, target_dist_weights,
 *                  pred_dist_weights, hidden2_weights, hidden2_bias,
*/

  /* function exit code */
  __pyx_r = 0;
  __Pyx_TraceReturnCValue(__pyx_r, __Pyx_Owned_Py_None, 0, 0, __PYX_ERR(1, 122, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 122, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":148
 *         self.use_learning_rate_decay = False
 * 
 *     def _generate_save_dict(self):             # <<<<<<<<<<<<<<
 *         """
 *         Generates a dictionary with all parameters saved by the model.
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_7_generate_save_dict(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_6_generate_save_dict, "ConvolutionalNetwork._generate_save_dict(self)\nGenerates a dictionary with all parameters saved by the model.\nIt is directly used by the numpy savez function.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_7_generate_save_dict = {"_generate_save_dict", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_7_generate_save_dict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_6_generate_save_dict};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_7_generate_save_dict(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_generate_save_dict (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_generate_save_dict", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_generate_save_dict", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_6_generate_save_dict(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_6_generate_save_dict(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_v_d = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[84]))
  __Pyx_RefNannySetupContext("_generate_save_dict", 0);
  __Pyx_TraceStartFunc("_generate_save_dict", __pyx_f[1], 148, 0, 0, 0, __PYX_ERR(1, 148, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":153
 *         It is directly used by the numpy savez function.
 *         """
 *         d = dict(hidden_weights=self.hidden_weights,             # <<<<<<<<<<<<<<
 *                  target_dist_table=self.target_dist_table,
 *                  pred_dist_table=self.pred_dist_table,
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(19); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_hidden_weights, ((PyObject *)__pyx_v_self->__pyx_base.hidden_weights)) < 0) __PYX_ERR(1, 153, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":154
 *         """
 *         d = dict(hidden_weights=self.hidden_weights,
 *                  target_dist_table=self.target_dist_table,             # <<<<<<<<<<<<<<
 *                  pred_dist_table=self.pred_dist_table,
 *                  target_dist_weights=self.target_dist_weights,
*/
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_target_dist_table, ((PyObject *)__pyx_v_self->target_dist_table)) < 0) __PYX_ERR(1, 153, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":155
 *         d = dict(hidden_weights=self.hidden_weights,
 *                  target_dist_table=self.target_dist_table,
 *                  pred_dist_table=self.pred_dist_table,             # <<<<<<<<<<<<<<
 *                  target_dist_weights=self.target_dist_weights,
 *                  pred_dist_weights=self.pred_dist_weights,
*/
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_pred_dist_table, ((PyObject *)__pyx_v_self->pred_dist_table)) < 0) __PYX_ERR(1, 153, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":156
 *                  target_dist_table=self.target_dist_table,
 *                  pred_dist_table=self.pred_dist_table,
 *                  target_dist_weights=self.target_dist_weights,             # <<<<<<<<<<<<<<
 *                  pred_dist_weights=self.pred_dist_weights,
 *                  output_weights=self.output_weights,
*/
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_target_dist_weights, ((PyObject *)__pyx_v_self->target_dist_weights)) < 0) __PYX_ERR(1, 153, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":157
 *                  pred_dist_table=self.pred_dist_table,
 *                  target_dist_weights=self.target_dist_weights,
 *                  pred_dist_weights=self.pred_dist_weights,             # <<<<<<<<<<<<<<
 *                  output_weights=self.output_weights,
 *                  transitions=self.transitions,
*/
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_pred_dist_weights, ((PyObject *)__pyx_v_self->pred_dist_weights)) < 0) __PYX_ERR(1, 153, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":158
 *                  target_dist_weights=self.target_dist_weights,
 *                  pred_dist_weights=self.pred_dist_weights,
 *                  output_weights=self.output_weights,             # <<<<<<<<<<<<<<
 *                  transitions=self.transitions,
 *                  hidden_bias=self.hidden_bias, output_bias=self.output_bias,
*/
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_output_weights, ((PyObject *)__pyx_v_self->__pyx_base.output_weights)) < 0) __PYX_ERR(1, 153, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":159
 *                  pred_dist_weights=self.pred_dist_weights,
 *                  output_weights=self.output_weights,
 *                  transitions=self.transitions,             # <<<<<<<<<<<<<<
 *                  hidden_bias=self.hidden_bias, output_bias=self.output_bias,
 *                  word_window_size=self.word_window_size,
*/
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_transitions, ((PyObject *)__pyx_v_self->__pyx_base.transitions)) < 0) __PYX_ERR(1, 153, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":160
 *                  output_weights=self.output_weights,
 *                  transitions=self.transitions,
 *                  hidden_bias=self.hidden_bias, output_bias=self.output_bias,             # <<<<<<<<<<<<<<
 *                  word_window_size=self.word_window_size,
 *                  input_size=self.input_size, hidden_size=self.hidden_size,
*/
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_hidden_bias, ((PyObject *)__pyx_v_self->__pyx_base.hidden_bias)) < 0) __PYX_ERR(1, 153, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_output_bias, ((PyObject *)__pyx_v_self->__pyx_base.output_bias)) < 0) __PYX_ERR(1, 153, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":161
 *                  transitions=self.transitions,
 *                  hidden_bias=self.hidden_bias, output_bias=self.output_bias,
 *                  word_window_size=self.word_window_size,             # <<<<<<<<<<<<<<
 *                  input_size=self.input_size, hidden_size=self.hidden_size,
 *                  output_size=self.output_size, hidden2_size=self.hidden2_size,
*/
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.word_window_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_word_window_size, __pyx_t_2) < 0) __PYX_ERR(1, 153, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":162
 *                  hidden_bias=self.hidden_bias, output_bias=self.output_bias,
 *                  word_window_size=self.word_window_size,
 *                  input_size=self.input_size, hidden_size=self.hidden_size,             # <<<<<<<<<<<<<<
 *                  output_size=self.output_size, hidden2_size=self.hidden2_size,
 *                  hidden2_weights=self.hidden2_weights, hidden2_bias=self.hidden2_bias,
*/
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.input_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_input_size, __pyx_t_2) < 0) __PYX_ERR(1, 153, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.hidden_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_hidden_size, __pyx_t_2) < 0) __PYX_ERR(1, 153, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":163
 *                  word_window_size=self.word_window_size,
 *                  input_size=self.input_size, hidden_size=self.hidden_size,
 *                  output_size=self.output_size, hidden2_size=self.hidden2_size,             # <<<<<<<<<<<<<<
 *                  hidden2_weights=self.hidden2_weights, hidden2_bias=self.hidden2_bias,
 *                  padding_left=self.padding_left, padding_right=self.padding_right,
*/
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.output_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_output_size, __pyx_t_2) < 0) __PYX_ERR(1, 153, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_self->hidden2_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_hidden2_size, __pyx_t_2) < 0) __PYX_ERR(1, 153, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":164
 *                  input_size=self.input_size, hidden_size=self.hidden_size,
 *                  output_size=self.output_size, hidden2_size=self.hidden2_size,
 *                  hidden2_weights=self.hidden2_weights, hidden2_bias=self.hidden2_bias,             # <<<<<<<<<<<<<<
 *                  padding_left=self.padding_left, padding_right=self.padding_right,
 *                  feature_tables=self.feature_tables)
*/
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_hidden2_weights, ((PyObject *)__pyx_v_self->hidden2_weights)) < 0) __PYX_ERR(1, 153, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_hidden2_bias, ((PyObject *)__pyx_v_self->hidden2_bias)) < 0) __PYX_ERR(1, 153, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":165
 *                  output_size=self.output_size, hidden2_size=self.hidden2_size,
 *                  hidden2_weights=self.hidden2_weights, hidden2_bias=self.hidden2_bias,
 *                  padding_left=self.padding_left, padding_right=self.padding_right,             # <<<<<<<<<<<<<<
 *                  feature_tables=self.feature_tables)
 *         return d
*/
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_padding_left, ((PyObject *)__pyx_v_self->__pyx_base.padding_left)) < 0) __PYX_ERR(1, 153, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_padding_right, ((PyObject *)__pyx_v_self->__pyx_base.padding_right)) < 0) __PYX_ERR(1, 153, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":166
 *                  hidden2_weights=self.hidden2_weights, hidden2_bias=self.hidden2_bias,
 *                  padding_left=self.padding_left, padding_right=self.padding_right,
 *                  feature_tables=self.feature_tables)             # <<<<<<<<<<<<<<
 *         return d
 * 
*/
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_feature_tables, __pyx_v_self->__pyx_base.feature_tables) < 0) __PYX_ERR(1, 153, __pyx_L1_error)
  __pyx_v_d = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":167
 *                  padding_left=self.padding_left, padding_right=self.padding_right,
 *                  feature_tables=self.feature_tables)
 *         return d             # <<<<<<<<<<<<<<
 * 
 *     def save(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_d);
  __pyx_r = __pyx_v_d;
  __Pyx_TraceReturnValue(__pyx_r, 60, 0, __PYX_ERR(1, 167, __pyx_L1_error));
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkconv.pyx":148
 *         self.use_learning_rate_decay = False
 * 
 *     def _generate_save_dict(self):             # <<<<<<<<<<<<<<
 *         """
 *         Generates a dictionary with all parameters saved by the model.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 148, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._generate_save_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":169
 *         return d
 * 
 *     def save(self):             # <<<<<<<<<<<<<<
 *         """
 *         Saves the neural network to a file.
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_9save(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_8save, "ConvolutionalNetwork.save(self)\nSaves the neural network to a file.\nIt will save the weights, biases, sizes, padding and \ndistance tables, and other feature tables.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_9save = {"save", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_9save, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_8save};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_9save(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("save", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("save", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_8save(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_8save(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[85]))
  __Pyx_RefNannySetupContext("save", 0);
  __Pyx_TraceStartFunc("save", __pyx_f[1], 169, 0, 0, 0, __PYX_ERR(1, 169, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":175
 *         distance tables, and other feature tables.
 *         """
 *         data = self._generate_save_dict()             # <<<<<<<<<<<<<<
 *         np.savez(self.network_filename, **data)
 * 
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_generate_save_dict, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_data = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":176
 *         """
 *         data = self._generate_save_dict()
 *         np.savez(self.network_filename, **data)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_savez); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(__pyx_v_data == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
    __PYX_ERR(1, 176, __pyx_L1_error)
  }
  if (likely(PyDict_CheckExact(__pyx_v_data))) {
    __pyx_t_4 = PyDict_Copy(__pyx_v_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_3 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_3 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self->__pyx_base.network_filename};
    __pyx_t_1 = __Pyx_PyObject_FastCallDict(__pyx_t_5, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":169
 *         return d
 * 
 *     def save(self):             # <<<<<<<<<<<<<<
 *         """
 *         Saves the neural network to a file.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 169, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 169, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.save", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":178
 *         np.savez(self.network_filename, **data)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def _load_from_file(cls, data, filename):
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_11_load_from_file(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_10_load_from_file, "ConvolutionalNetwork._load_from_file(cls, data, filename)\nInternal method for setting data read from a npz file.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_11_load_from_file = {"_load_from_file", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_11_load_from_file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_10_load_from_file};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_11_load_from_file(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_filename = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_load_from_file (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data,&__pyx_mstate_global->__pyx_n_u_filename,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 178, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 178, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 178, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_load_from_file", 0) < 0) __PYX_ERR(1, 178, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_load_from_file", 1, 2, 2, i); __PYX_ERR(1, 178, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 178, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 178, __pyx_L3_error)
    }
    __pyx_v_data = values[0];
    __pyx_v_filename = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_load_from_file", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 178, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._load_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_10_load_from_file(((PyTypeObject*)__pyx_v_cls), __pyx_v_data, __pyx_v_filename);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_10_load_from_file(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_data, PyObject *__pyx_v_filename) {
  PyObject *__pyx_v_hidden_weights = NULL;
  PyObject *__pyx_v_hidden_bias = NULL;
  PyObject *__pyx_v_hidden2_weights = NULL;
  PyObject *__pyx_v_hidden2_bias = NULL;
  PyObject *__pyx_v_output_weights = NULL;
  PyObject *__pyx_v_output_bias = NULL;
  PyObject *__pyx_v_word_window_size = NULL;
  PyObject *__pyx_v_input_size = NULL;
  PyObject *__pyx_v_hidden_size = NULL;
  PyObject *__pyx_v_hidden2_size = NULL;
  PyObject *__pyx_v_output_size = NULL;
  PyObject *__pyx_v_nn = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[86]))
  __Pyx_RefNannySetupContext("_load_from_file", 0);
  __Pyx_TraceStartFunc("_load_from_file", __pyx_f[1], 178, 0, 0, 0, __PYX_ERR(1, 178, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":185
 *         # cython classes don't have the __dict__ attribute
 *         # so we can't do an elegant self.__dict__.update(data)
 *         hidden_weights = data['hidden_weights']             # <<<<<<<<<<<<<<
 *         hidden_bias = data['hidden_bias']
 *         hidden2_weights = data['hidden2_weights']
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_hidden_weights); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_hidden_weights = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":186
 *         # so we can't do an elegant self.__dict__.update(data)
 *         hidden_weights = data['hidden_weights']
 *         hidden_bias = data['hidden_bias']             # <<<<<<<<<<<<<<
 *         hidden2_weights = data['hidden2_weights']
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_hidden_bias); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_hidden_bias = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":187
 *         hidden_weights = data['hidden_weights']
 *         hidden_bias = data['hidden_bias']
 *         hidden2_weights = data['hidden2_weights']             # <<<<<<<<<<<<<<
 * 
 *         hidden2_bias = data['hidden2_bias']
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_hidden2_weights); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_hidden2_weights = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":189
 *         hidden2_weights = data['hidden2_weights']
 * 
 *         hidden2_bias = data['hidden2_bias']             # <<<<<<<<<<<<<<
 *         output_weights = data['output_weights']
 *         output_bias = data['output_bias']
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_hidden2_bias); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_hidden2_bias = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":190
 * 
 *         hidden2_bias = data['hidden2_bias']
 *         output_weights = data['output_weights']             # <<<<<<<<<<<<<<
 *         output_bias = data['output_bias']
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_output_weights); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_output_weights = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":191
 *         hidden2_bias = data['hidden2_bias']
 *         output_weights = data['output_weights']
 *         output_bias = data['output_bias']             # <<<<<<<<<<<<<<
 * 
 *         word_window_size = data['word_window_size']
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_output_bias); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_output_bias = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":193
 *         output_bias = data['output_bias']
 * 
 *         word_window_size = data['word_window_size']             # <<<<<<<<<<<<<<
 *         input_size = data['input_size']
 *         hidden_size = data['hidden_size']
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_word_window_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_word_window_size = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":194
 * 
 *         word_window_size = data['word_window_size']
 *         input_size = data['input_size']             # <<<<<<<<<<<<<<
 *         hidden_size = data['hidden_size']
 *         hidden2_size = data['hidden2_size']
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_input_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_input_size = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":195
 *         word_window_size = data['word_window_size']
 *         input_size = data['input_size']
 *         hidden_size = data['hidden_size']             # <<<<<<<<<<<<<<
 *         hidden2_size = data['hidden2_size']
 *         output_size = data['output_size']
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_hidden_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_hidden_size = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":196
 *         input_size = data['input_size']
 *         hidden_size = data['hidden_size']
 *         hidden2_size = data['hidden2_size']             # <<<<<<<<<<<<<<
 *         output_size = data['output_size']
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_hidden2_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_hidden2_size = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":197
 *         hidden_size = data['hidden_size']
 *         hidden2_size = data['hidden2_size']
 *         output_size = data['output_size']             # <<<<<<<<<<<<<<
 * 
 *         # numpy stores None as an array containing None and with empty shape
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_output_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_output_size = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":200
 * 
 *         # numpy stores None as an array containing None and with empty shape
 *         if hidden2_weights.shape == ():             # <<<<<<<<<<<<<<
 *             hidden2_weights = None
 *             hidden2_size = 0
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_hidden2_weights, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_mstate_global->__pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 200, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 200, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "nltkor/tag/libs/networkconv.pyx":201
 *         # numpy stores None as an array containing None and with empty shape
 *         if hidden2_weights.shape == ():
 *             hidden2_weights = None             # <<<<<<<<<<<<<<
 *             hidden2_size = 0
 *             hidden2_bias = None
*/
    __Pyx_INCREF(Py_None);
    __Pyx_DECREF_SET(__pyx_v_hidden2_weights, Py_None);

    /* "nltkor/tag/libs/networkconv.pyx":202
 *         if hidden2_weights.shape == ():
 *             hidden2_weights = None
 *             hidden2_size = 0             # <<<<<<<<<<<<<<
 *             hidden2_bias = None
 * 
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __Pyx_DECREF_SET(__pyx_v_hidden2_size, __pyx_mstate_global->__pyx_int_0);

    /* "nltkor/tag/libs/networkconv.pyx":203
 *             hidden2_weights = None
 *             hidden2_size = 0
 *             hidden2_bias = None             # <<<<<<<<<<<<<<
 * 
 *         nn = cls(word_window_size, input_size, hidden_size, hidden2_size,
*/
    __Pyx_INCREF(Py_None);
    __Pyx_DECREF_SET(__pyx_v_hidden2_bias, Py_None);

    /* "nltkor/tag/libs/networkconv.pyx":200
 * 
 *         # numpy stores None as an array containing None and with empty shape
 *         if hidden2_weights.shape == ():             # <<<<<<<<<<<<<<
 *             hidden2_weights = None
 *             hidden2_size = 0
*/
  }

  /* "nltkor/tag/libs/networkconv.pyx":205
 *             hidden2_bias = None
 * 
 *         nn = cls(word_window_size, input_size, hidden_size, hidden2_size,             # <<<<<<<<<<<<<<
 *                  output_size, hidden_weights, hidden_bias,
 *                  data['target_dist_weights'], data['pred_dist_weights'],
*/
  __pyx_t_1 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_v_cls);
  __pyx_t_4 = ((PyObject *)__pyx_v_cls); 

  /* "nltkor/tag/libs/networkconv.pyx":207
 *         nn = cls(word_window_size, input_size, hidden_size, hidden2_size,
 *                  output_size, hidden_weights, hidden_bias,
 *                  data['target_dist_weights'], data['pred_dist_weights'],             # <<<<<<<<<<<<<<
 *                  hidden2_weights, hidden2_bias,
 *                  output_weights, output_bias)
*/
  __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_target_dist_weights); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_pred_dist_weights); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "nltkor/tag/libs/networkconv.pyx":209
 *                  data['target_dist_weights'], data['pred_dist_weights'],
 *                  hidden2_weights, hidden2_bias,
 *                  output_weights, output_bias)             # <<<<<<<<<<<<<<
 * 
 *         nn.target_dist_table = data['target_dist_table']
*/
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[14] = {__pyx_t_1, __pyx_v_word_window_size, __pyx_v_input_size, __pyx_v_hidden_size, __pyx_v_hidden2_size, __pyx_v_output_size, __pyx_v_hidden_weights, __pyx_v_hidden_bias, __pyx_t_5, __pyx_t_6, __pyx_v_hidden2_weights, __pyx_v_hidden2_bias, __pyx_v_output_weights, __pyx_v_output_bias};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (14-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 205, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_nn = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":211
 *                  output_weights, output_bias)
 * 
 *         nn.target_dist_table = data['target_dist_table']             # <<<<<<<<<<<<<<
 *         nn.pred_dist_table = data['pred_dist_table']
 *         #transitions = data['transitions']
*/
  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_target_dist_table); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_nn, __pyx_mstate_global->__pyx_n_u_target_dist_table, __pyx_t_2) < 0) __PYX_ERR(1, 211, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":212
 * 
 *         nn.target_dist_table = data['target_dist_table']
 *         nn.pred_dist_table = data['pred_dist_table']             # <<<<<<<<<<<<<<
 *         #transitions = data['transitions']
 *         #nn.transitions = transitions if transitions.shape != () else None
*/
  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_pred_dist_table); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_nn, __pyx_mstate_global->__pyx_n_u_pred_dist_table, __pyx_t_2) < 0) __PYX_ERR(1, 212, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":215
 *         #transitions = data['transitions']
 *         #nn.transitions = transitions if transitions.shape != () else None
 *         nn.padding_left = data['padding_left']             # <<<<<<<<<<<<<<
 *         nn.padding_right = data['padding_right']
 *         nn.pre_padding = np.array(int(nn.word_window_size // 2) * [nn.padding_left])
*/
  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_padding_left); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_nn, __pyx_mstate_global->__pyx_n_u_padding_left, __pyx_t_2) < 0) __PYX_ERR(1, 215, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":216
 *         #nn.transitions = transitions if transitions.shape != () else None
 *         nn.padding_left = data['padding_left']
 *         nn.padding_right = data['padding_right']             # <<<<<<<<<<<<<<
 *         nn.pre_padding = np.array(int(nn.word_window_size // 2) * [nn.padding_left])
 *         nn.pos_padding = np.array(int(nn.word_window_size // 2) * [nn.padding_right])
*/
  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_padding_right); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_nn, __pyx_mstate_global->__pyx_n_u_padding_right, __pyx_t_2) < 0) __PYX_ERR(1, 216, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":217
 *         nn.padding_left = data['padding_left']
 *         nn.padding_right = data['padding_right']
 *         nn.pre_padding = np.array(int(nn.word_window_size // 2) * [nn.padding_left])             # <<<<<<<<<<<<<<
 *         nn.pos_padding = np.array(int(nn.word_window_size // 2) * [nn.padding_right])
 *         nn.feature_tables = list(data['feature_tables'])
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_nn, __pyx_mstate_global->__pyx_n_u_padding_left); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_nn, __pyx_mstate_global->__pyx_n_u_word_window_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_PyLong_FloorDivideObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 217, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyList_New(1 * ((__pyx_t_9<0) ? 0:__pyx_t_9)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_t_9; __pyx_temp++) {
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_t_6) != (0)) __PYX_ERR(1, 217, __pyx_L1_error);
    }
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_1};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_nn, __pyx_mstate_global->__pyx_n_u_pre_padding, __pyx_t_2) < 0) __PYX_ERR(1, 217, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":218
 *         nn.padding_right = data['padding_right']
 *         nn.pre_padding = np.array(int(nn.word_window_size // 2) * [nn.padding_left])
 *         nn.pos_padding = np.array(int(nn.word_window_size // 2) * [nn.padding_right])             # <<<<<<<<<<<<<<
 *         nn.feature_tables = list(data['feature_tables'])
 *         nn.network_filename = filename
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_nn, __pyx_mstate_global->__pyx_n_u_padding_right); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_nn, __pyx_mstate_global->__pyx_n_u_word_window_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = __Pyx_PyLong_FloorDivideObjC(__pyx_t_6, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyList_New(1 * ((__pyx_t_9<0) ? 0:__pyx_t_9)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_t_9; __pyx_temp++) {
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_6, __pyx_temp, __pyx_t_1) != (0)) __PYX_ERR(1, 218, __pyx_L1_error);
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_nn, __pyx_mstate_global->__pyx_n_u_pos_padding, __pyx_t_2) < 0) __PYX_ERR(1, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":219
 *         nn.pre_padding = np.array(int(nn.word_window_size // 2) * [nn.padding_left])
 *         nn.pos_padding = np.array(int(nn.word_window_size // 2) * [nn.padding_right])
 *         nn.feature_tables = list(data['feature_tables'])             # <<<<<<<<<<<<<<
 *         nn.network_filename = filename
 * 
*/
  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_feature_tables); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PySequence_ListKeepNew(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_nn, __pyx_mstate_global->__pyx_n_u_feature_tables, __pyx_t_4) < 0) __PYX_ERR(1, 219, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":220
 *         nn.pos_padding = np.array(int(nn.word_window_size // 2) * [nn.padding_right])
 *         nn.feature_tables = list(data['feature_tables'])
 *         nn.network_filename = filename             # <<<<<<<<<<<<<<
 * 
 *         return nn
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_nn, __pyx_mstate_global->__pyx_n_u_network_filename, __pyx_v_filename) < 0) __PYX_ERR(1, 220, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":222
 *         nn.network_filename = filename
 * 
 *         return nn             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_nn);
  __pyx_r = __pyx_v_nn;
  __Pyx_TraceReturnValue(__pyx_r, 134, 0, __PYX_ERR(1, 222, __pyx_L1_error));
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkconv.pyx":178
 *         np.savez(self.network_filename, **data)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def _load_from_file(cls, data, filename):
 *         """
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 178, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._load_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_hidden_weights);
  __Pyx_XDECREF(__pyx_v_hidden_bias);
  __Pyx_XDECREF(__pyx_v_hidden2_weights);
  __Pyx_XDECREF(__pyx_v_hidden2_bias);
  __Pyx_XDECREF(__pyx_v_output_weights);
  __Pyx_XDECREF(__pyx_v_output_bias);
  __Pyx_XDECREF(__pyx_v_word_window_size);
  __Pyx_XDECREF(__pyx_v_input_size);
  __Pyx_XDECREF(__pyx_v_hidden_size);
  __Pyx_XDECREF(__pyx_v_hidden2_size);
  __Pyx_XDECREF(__pyx_v_output_size);
  __Pyx_XDECREF(__pyx_v_nn);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":224
 *         return nn
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def load_from_file(cls, filename):
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_13load_from_file(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12load_from_file, "ConvolutionalNetwork.load_from_file(cls, filename)\nLoads the neural network from a file.\nIt will load weights, biases, sizes, padding and \ndistance tables, and other feature tables.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_13load_from_file = {"load_from_file", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_13load_from_file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12load_from_file};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_13load_from_file(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_filename = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("load_from_file (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_filename,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 224, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 224, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "load_from_file", 0) < 0) __PYX_ERR(1, 224, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("load_from_file", 1, 1, 1, i); __PYX_ERR(1, 224, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 224, __pyx_L3_error)
    }
    __pyx_v_filename = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("load_from_file", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 224, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.load_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12load_from_file(((PyTypeObject*)__pyx_v_cls), __pyx_v_filename);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12load_from_file(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_filename) {
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[87]))
  __Pyx_RefNannySetupContext("load_from_file", 0);
  __Pyx_TraceStartFunc("load_from_file", __pyx_f[1], 224, 0, 0, 0, __PYX_ERR(1, 224, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":231
 *         distance tables, and other feature tables.
 *         """
 *         data = np.load(filename, allow_pickle=True) #             # <<<<<<<<<<<<<<
 *         return cls._load_from_file(data, filename)
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_load); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_v_filename};
    __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_allow_pickle, Py_True, __pyx_t_3, __pyx_callargs+2, 0) < 0) __PYX_ERR(1, 231, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_data = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":232
 *         """
 *         data = np.load(filename, allow_pickle=True) #
 *         return cls._load_from_file(data, filename)             # <<<<<<<<<<<<<<
 * 
 *     def _load_parameters(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = ((PyObject *)__pyx_v_cls);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_data, __pyx_v_filename};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_load_from_file, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_TraceReturnValue(__pyx_r, 8, 0, __PYX_ERR(1, 232, __pyx_L1_error));
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkconv.pyx":224
 *         return nn
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def load_from_file(cls, filename):
 *         """
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 224, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.load_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":234
 *         return cls._load_from_file(data, filename)
 * 
 *     def _load_parameters(self):             # <<<<<<<<<<<<<<
 *         """
 *         Loads weights, feature tables, distance tables and
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15_load_parameters(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_14_load_parameters, "ConvolutionalNetwork._load_parameters(self)\nLoads weights, feature tables, distance tables and \ntransition tables previously saved.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15_load_parameters = {"_load_parameters", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15_load_parameters, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_14_load_parameters};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15_load_parameters(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_load_parameters (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_load_parameters", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_load_parameters", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_14_load_parameters(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_14_load_parameters(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[88]))
  __Pyx_RefNannySetupContext("_load_parameters", 0);
  __Pyx_TraceStartFunc("_load_parameters", __pyx_f[1], 234, 0, 0, 0, __PYX_ERR(1, 234, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":239
 *         transition tables previously saved.
 *         """
 *         data = np.load(self.network_filename)             # <<<<<<<<<<<<<<
 *         self.hidden_weights = data['hidden_weights']
 *         self.hidden_bias = data['hidden_bias']
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_load); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self->__pyx_base.network_filename};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 239, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_data = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":240
 *         """
 *         data = np.load(self.network_filename)
 *         self.hidden_weights = data['hidden_weights']             # <<<<<<<<<<<<<<
 *         self.hidden_bias = data['hidden_bias']
 *         self.output_weights = data['output_weights']
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_hidden_weights); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 240, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.hidden_weights);
  __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.hidden_weights);
  __pyx_v_self->__pyx_base.hidden_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":241
 *         data = np.load(self.network_filename)
 *         self.hidden_weights = data['hidden_weights']
 *         self.hidden_bias = data['hidden_bias']             # <<<<<<<<<<<<<<
 *         self.output_weights = data['output_weights']
 *         self.output_bias = data['output_bias']
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_hidden_bias); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 241, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.hidden_bias);
  __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.hidden_bias);
  __pyx_v_self->__pyx_base.hidden_bias = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":242
 *         self.hidden_weights = data['hidden_weights']
 *         self.hidden_bias = data['hidden_bias']
 *         self.output_weights = data['output_weights']             # <<<<<<<<<<<<<<
 *         self.output_bias = data['output_bias']
 *         self.feature_tables = list(data['feature_tables'])
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_output_weights); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 242, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.output_weights);
  __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.output_weights);
  __pyx_v_self->__pyx_base.output_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":243
 *         self.hidden_bias = data['hidden_bias']
 *         self.output_weights = data['output_weights']
 *         self.output_bias = data['output_bias']             # <<<<<<<<<<<<<<
 *         self.feature_tables = list(data['feature_tables'])
 *         self.target_dist_table = data['target_dist_table']
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_output_bias); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 243, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.output_bias);
  __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.output_bias);
  __pyx_v_self->__pyx_base.output_bias = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":244
 *         self.output_weights = data['output_weights']
 *         self.output_bias = data['output_bias']
 *         self.feature_tables = list(data['feature_tables'])             # <<<<<<<<<<<<<<
 *         self.target_dist_table = data['target_dist_table']
 *         self.pred_dist_table = data['pred_dist_table']
*/
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_feature_tables); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.feature_tables);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.feature_tables);
  __pyx_v_self->__pyx_base.feature_tables = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":245
 *         self.output_bias = data['output_bias']
 *         self.feature_tables = list(data['feature_tables'])
 *         self.target_dist_table = data['target_dist_table']             # <<<<<<<<<<<<<<
 *         self.pred_dist_table = data['pred_dist_table']
 * 
*/
  __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_target_dist_table); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 245, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->target_dist_table);
  __Pyx_DECREF((PyObject *)__pyx_v_self->target_dist_table);
  __pyx_v_self->target_dist_table = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":246
 *         self.feature_tables = list(data['feature_tables'])
 *         self.target_dist_table = data['target_dist_table']
 *         self.pred_dist_table = data['pred_dist_table']             # <<<<<<<<<<<<<<
 * 
 *         # check if transitions isn't None (numpy saves everything as an array)
*/
  __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_pred_dist_table); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 246, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->pred_dist_table);
  __Pyx_DECREF((PyObject *)__pyx_v_self->pred_dist_table);
  __pyx_v_self->pred_dist_table = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":249
 * 
 *         # check if transitions isn't None (numpy saves everything as an array)
 *         if data['transitions'].shape != ():             # <<<<<<<<<<<<<<
 *             self.transitions = data['transitions']
 *         else:
*/
  __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_transitions); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_mstate_global->__pyx_empty_tuple, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 249, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_6) {

    /* "nltkor/tag/libs/networkconv.pyx":250
 *         # check if transitions isn't None (numpy saves everything as an array)
 *         if data['transitions'].shape != ():
 *             self.transitions = data['transitions']             # <<<<<<<<<<<<<<
 *         else:
 *             self.transitions = None
*/
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_transitions); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 250, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 250, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.transitions);
    __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.transitions);
    __pyx_v_self->__pyx_base.transitions = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":249
 * 
 *         # check if transitions isn't None (numpy saves everything as an array)
 *         if data['transitions'].shape != ():             # <<<<<<<<<<<<<<
 *             self.transitions = data['transitions']
 *         else:
*/
    goto __pyx_L3;
  }

  /* "nltkor/tag/libs/networkconv.pyx":252
 *             self.transitions = data['transitions']
 *         else:
 *             self.transitions = None             # <<<<<<<<<<<<<<
 * 
 *         # same for second hidden layer weights
*/
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.transitions);
    __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.transitions);
    __pyx_v_self->__pyx_base.transitions = ((PyArrayObject *)Py_None);
  }
  __pyx_L3:;

  /* "nltkor/tag/libs/networkconv.pyx":255
 * 
 *         # same for second hidden layer weights
 *         if data['hidden2_weights'].shape != ():             # <<<<<<<<<<<<<<
 *             self.hidden2_weights = data['hidden2_weights']
 *             self.hidden2_bias = data['hidden2_bias']
*/
  __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_hidden2_weights); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_mstate_global->__pyx_empty_tuple, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 255, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 255, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_6) {

    /* "nltkor/tag/libs/networkconv.pyx":256
 *         # same for second hidden layer weights
 *         if data['hidden2_weights'].shape != ():
 *             self.hidden2_weights = data['hidden2_weights']             # <<<<<<<<<<<<<<
 *             self.hidden2_bias = data['hidden2_bias']
 *         else:
*/
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_hidden2_weights); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 256, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden2_weights);
    __Pyx_DECREF((PyObject *)__pyx_v_self->hidden2_weights);
    __pyx_v_self->hidden2_weights = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":257
 *         if data['hidden2_weights'].shape != ():
 *             self.hidden2_weights = data['hidden2_weights']
 *             self.hidden2_bias = data['hidden2_bias']             # <<<<<<<<<<<<<<
 *         else:
 *             self.hidden2_weights = None
*/
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_hidden2_bias); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 257, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden2_bias);
    __Pyx_DECREF((PyObject *)__pyx_v_self->hidden2_bias);
    __pyx_v_self->hidden2_bias = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":255
 * 
 *         # same for second hidden layer weights
 *         if data['hidden2_weights'].shape != ():             # <<<<<<<<<<<<<<
 *             self.hidden2_weights = data['hidden2_weights']
 *             self.hidden2_bias = data['hidden2_bias']
*/
    goto __pyx_L4;
  }

  /* "nltkor/tag/libs/networkconv.pyx":259
 *             self.hidden2_bias = data['hidden2_bias']
 *         else:
 *             self.hidden2_weights = None             # <<<<<<<<<<<<<<
 * 
 *     def set_validation_data(self, list validation_sentences,
*/
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden2_weights);
    __Pyx_DECREF((PyObject *)__pyx_v_self->hidden2_weights);
    __pyx_v_self->hidden2_weights = ((PyArrayObject *)Py_None);
  }
  __pyx_L4:;

  /* "nltkor/tag/libs/networkconv.pyx":234
 *         return cls._load_from_file(data, filename)
 * 
 *     def _load_parameters(self):             # <<<<<<<<<<<<<<
 *         """
 *         Loads weights, feature tables, distance tables and
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 234, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 234, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._load_parameters", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":261
 *             self.hidden2_weights = None
 * 
 *     def set_validation_data(self, list validation_sentences,             # <<<<<<<<<<<<<<
 *                             list validation_predicates,
 *                             list validation_tags,
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17set_validation_data(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16set_validation_data, "ConvolutionalNetwork.set_validation_data(self, list validation_sentences, list validation_predicates, list validation_tags, list validation_arguments=None)\nSets the data to be used in validation during training. If this function\nis not called before training, the training data itself is used to \nmeasure the model's performance.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17set_validation_data = {"set_validation_data", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17set_validation_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16set_validation_data};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17set_validation_data(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_validation_sentences = 0;
  PyObject *__pyx_v_validation_predicates = 0;
  PyObject *__pyx_v_validation_tags = 0;
  PyObject *__pyx_v_validation_arguments = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_validation_data (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_validation_sentences,&__pyx_mstate_global->__pyx_n_u_validation_predicates,&__pyx_mstate_global->__pyx_n_u_validation_tags,&__pyx_mstate_global->__pyx_n_u_validation_arguments,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 261, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 261, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 261, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 261, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 261, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_validation_data", 0) < 0) __PYX_ERR(1, 261, __pyx_L3_error)

      /* "nltkor/tag/libs/networkconv.pyx":264
 *                             list validation_predicates,
 *                             list validation_tags,
 *                             list validation_arguments=None):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the data to be used in validation during training. If this function
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_validation_data", 0, 3, 4, i); __PYX_ERR(1, 261, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 261, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 261, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 261, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 261, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)Py_None));
    }
    __pyx_v_validation_sentences = ((PyObject*)values[0]);
    __pyx_v_validation_predicates = ((PyObject*)values[1]);
    __pyx_v_validation_tags = ((PyObject*)values[2]);
    __pyx_v_validation_arguments = ((PyObject*)values[3]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_validation_data", 0, 3, 4, __pyx_nargs); __PYX_ERR(1, 261, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.set_validation_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_validation_sentences), (&PyList_Type), 1, "validation_sentences", 1))) __PYX_ERR(1, 261, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_validation_predicates), (&PyList_Type), 1, "validation_predicates", 1))) __PYX_ERR(1, 262, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_validation_tags), (&PyList_Type), 1, "validation_tags", 1))) __PYX_ERR(1, 263, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_validation_arguments), (&PyList_Type), 1, "validation_arguments", 1))) __PYX_ERR(1, 264, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16set_validation_data(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v_validation_sentences, __pyx_v_validation_predicates, __pyx_v_validation_tags, __pyx_v_validation_arguments);

  /* "nltkor/tag/libs/networkconv.pyx":261
 *             self.hidden2_weights = None
 * 
 *     def set_validation_data(self, list validation_sentences,             # <<<<<<<<<<<<<<
 *                             list validation_predicates,
 *                             list validation_tags,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16set_validation_data(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_validation_sentences, PyObject *__pyx_v_validation_predicates, PyObject *__pyx_v_validation_tags, PyObject *__pyx_v_validation_arguments) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[89]))
  __Pyx_RefNannySetupContext("set_validation_data", 0);
  __Pyx_TraceStartFunc("set_validation_data", __pyx_f[1], 261, 0, 0, 0, __PYX_ERR(1, 261, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":270
 *         measure the model's performance.
 *         """
 *         self.validation_sentences = validation_sentences             # <<<<<<<<<<<<<<
 *         self.validation_predicates = validation_predicates
 *         self.validation_tags = validation_tags
*/
  __Pyx_INCREF(__pyx_v_validation_sentences);
  __Pyx_GIVEREF(__pyx_v_validation_sentences);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.validation_sentences);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.validation_sentences);
  __pyx_v_self->__pyx_base.validation_sentences = __pyx_v_validation_sentences;

  /* "nltkor/tag/libs/networkconv.pyx":271
 *         """
 *         self.validation_sentences = validation_sentences
 *         self.validation_predicates = validation_predicates             # <<<<<<<<<<<<<<
 *         self.validation_tags = validation_tags
 *         self.validation_arguments = validation_arguments
*/
  __Pyx_INCREF(__pyx_v_validation_predicates);
  __Pyx_GIVEREF(__pyx_v_validation_predicates);
  __Pyx_GOTREF(__pyx_v_self->validation_predicates);
  __Pyx_DECREF(__pyx_v_self->validation_predicates);
  __pyx_v_self->validation_predicates = __pyx_v_validation_predicates;

  /* "nltkor/tag/libs/networkconv.pyx":272
 *         self.validation_sentences = validation_sentences
 *         self.validation_predicates = validation_predicates
 *         self.validation_tags = validation_tags             # <<<<<<<<<<<<<<
 *         self.validation_arguments = validation_arguments
 * 
*/
  __Pyx_INCREF(__pyx_v_validation_tags);
  __Pyx_GIVEREF(__pyx_v_validation_tags);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.validation_tags);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.validation_tags);
  __pyx_v_self->__pyx_base.validation_tags = __pyx_v_validation_tags;

  /* "nltkor/tag/libs/networkconv.pyx":273
 *         self.validation_predicates = validation_predicates
 *         self.validation_tags = validation_tags
 *         self.validation_arguments = validation_arguments             # <<<<<<<<<<<<<<
 * 
 *     def train(self, list sentences, list predicates, list tags,
*/
  __Pyx_INCREF(__pyx_v_validation_arguments);
  __Pyx_GIVEREF(__pyx_v_validation_arguments);
  __Pyx_GOTREF(__pyx_v_self->validation_arguments);
  __Pyx_DECREF(__pyx_v_self->validation_arguments);
  __pyx_v_self->validation_arguments = __pyx_v_validation_arguments;

  /* "nltkor/tag/libs/networkconv.pyx":261
 *             self.hidden2_weights = None
 * 
 *     def set_validation_data(self, list validation_sentences,             # <<<<<<<<<<<<<<
 *                             list validation_predicates,
 *                             list validation_tags,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 261, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 261, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.set_validation_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":275
 *         self.validation_arguments = validation_arguments
 * 
 *     def train(self, list sentences, list predicates, list tags,             # <<<<<<<<<<<<<<
 *               int epochs, int epochs_between_reports=0,
 *               float desired_accuracy=0, list arguments=None):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_19train(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18train, "ConvolutionalNetwork.train(self, list sentences, list predicates, list tags, int epochs, int epochs_between_reports=0, float desired_accuracy=0, list arguments=None)\nTrains the convolutional network. Refer to the basic Network\ntrain method for detailed explanation.\n\n:param predicates: a list of 1-dim numpy array\n    indicating the indices of predicates in each sentence.\n:param arguments: (only for argument classifying) a list of 2-dim\n    numpy arrays indicating the start and end of each argument. ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_19train = {"train", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_19train, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18train};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_19train(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_sentences = 0;
  PyObject *__pyx_v_predicates = 0;
  PyObject *__pyx_v_tags = 0;
  int __pyx_v_epochs;
  int __pyx_v_epochs_between_reports;
  float __pyx_v_desired_accuracy;
  PyObject *__pyx_v_arguments = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[7] = {0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("train (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sentences,&__pyx_mstate_global->__pyx_n_u_predicates,&__pyx_mstate_global->__pyx_n_u_tags,&__pyx_mstate_global->__pyx_n_u_epochs,&__pyx_mstate_global->__pyx_n_u_epochs_between_reports,&__pyx_mstate_global->__pyx_n_u_desired_accuracy,&__pyx_mstate_global->__pyx_n_u_arguments,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 275, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(1, 275, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(1, 275, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 275, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 275, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 275, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 275, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 275, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "train", 0) < 0) __PYX_ERR(1, 275, __pyx_L3_error)

      /* "nltkor/tag/libs/networkconv.pyx":277
 *     def train(self, list sentences, list predicates, list tags,
 *               int epochs, int epochs_between_reports=0,
 *               float desired_accuracy=0, list arguments=None):             # <<<<<<<<<<<<<<
 *         """
 *         Trains the convolutional network. Refer to the basic Network
*/
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject*)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("train", 0, 4, 7, i); __PYX_ERR(1, 275, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(1, 275, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(1, 275, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 275, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 275, __pyx_L3_error)
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 275, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 275, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 275, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject*)Py_None));
    }
    __pyx_v_sentences = ((PyObject*)values[0]);
    __pyx_v_predicates = ((PyObject*)values[1]);
    __pyx_v_tags = ((PyObject*)values[2]);
    __pyx_v_epochs = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_epochs == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 276, __pyx_L3_error)
    if (values[4]) {
      __pyx_v_epochs_between_reports = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_epochs_between_reports == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 276, __pyx_L3_error)
    } else {
      __pyx_v_epochs_between_reports = ((int)0);
    }
    if (values[5]) {
      __pyx_v_desired_accuracy = __Pyx_PyFloat_AsFloat(values[5]); if (unlikely((__pyx_v_desired_accuracy == (float)-1) && PyErr_Occurred())) __PYX_ERR(1, 277, __pyx_L3_error)
    } else {
      __pyx_v_desired_accuracy = ((float)0.0);
    }
    __pyx_v_arguments = ((PyObject*)values[6]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("train", 0, 4, 7, __pyx_nargs); __PYX_ERR(1, 275, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.train", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sentences), (&PyList_Type), 1, "sentences", 1))) __PYX_ERR(1, 275, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_predicates), (&PyList_Type), 1, "predicates", 1))) __PYX_ERR(1, 275, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tags), (&PyList_Type), 1, "tags", 1))) __PYX_ERR(1, 275, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arguments), (&PyList_Type), 1, "arguments", 1))) __PYX_ERR(1, 277, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18train(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v_sentences, __pyx_v_predicates, __pyx_v_tags, __pyx_v_epochs, __pyx_v_epochs_between_reports, __pyx_v_desired_accuracy, __pyx_v_arguments);

  /* "nltkor/tag/libs/networkconv.pyx":275
 *         self.validation_arguments = validation_arguments
 * 
 *     def train(self, list sentences, list predicates, list tags,             # <<<<<<<<<<<<<<
 *               int epochs, int epochs_between_reports=0,
 *               float desired_accuracy=0, list arguments=None):
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_5train_2generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "nltkor/tag/libs/networkconv.pyx":288
 *         """
 *         self.num_sentences = len(sentences)
 *         self.num_tokens = sum(len(sent) for sent in sentences)             # <<<<<<<<<<<<<<
 *         self.only_classify = arguments is not None
 * 
*/

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_5train_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr *)__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(1, 288, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_5train_2generator4, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[90]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_train_locals_genexpr, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network); if (unlikely(!gen)) __PYX_ERR(1, 288, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.train.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_5train_2generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsGen
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_TraceStartGen("genexpr", __pyx_f[1], 288, 0, 0, 0, __PYX_ERR(1, 288, __pyx_L1_error));
    __Pyx_TraceReturnValue(Py_None, 0, 0, __PYX_ERR(1, 288, __pyx_L1_error));
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  __Pyx_TraceStartGen("genexpr", __pyx_f[1], 288, 0, 0, 0, __PYX_ERR(1, 288, __pyx_L1_error));
  if (unlikely(__pyx_sent_value != Py_None)) {
    if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started generator");
    __PYX_ERR(1, 288, __pyx_L1_error)
  }
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(1, 288, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_genexpr_arg_0 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(1, 288, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 288, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2);
    ++__pyx_t_2;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_sent);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_sent, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_4 = PyObject_Length(__pyx_cur_scope->__pyx_v_sent); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 288, __pyx_L1_error)
    __pyx_t_3 = PyLong_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_TraceYield(__pyx_r, 0, __PYX_ERR(1, 288, __pyx_L1_error));
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __Pyx_TraceResumeGen("genexpr", __pyx_f[1], 288, 0, __PYX_ERR(1, 288, __pyx_L1_error));
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(1, 288, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
  __Pyx_TraceReturnValue(Py_None, 0, 0, __PYX_ERR(1, 288, __pyx_L1_error));

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_TraceException(__pyx_lineno, 0, 0);
    __Pyx_Generator_Replace_StopIteration(0);
    __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_TraceExceptionUnwind(0, 0);
  }
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":275
 *         self.validation_arguments = validation_arguments
 * 
 *     def train(self, list sentences, list predicates, list tags,             # <<<<<<<<<<<<<<
 *               int epochs, int epochs_between_reports=0,
 *               float desired_accuracy=0, list arguments=None):
*/

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18train(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_sentences, PyObject *__pyx_v_predicates, PyObject *__pyx_v_tags, int __pyx_v_epochs, int __pyx_v_epochs_between_reports, float __pyx_v_desired_accuracy, PyObject *__pyx_v_arguments) {
  PyObject *__pyx_v_logger = NULL;
  double __pyx_v_last_accuracy;
  double __pyx_v_top_accuracy;
  PyObject *__pyx_v_last_error = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_gb_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_5train_2generator4 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  float __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[91]))
  __Pyx_RefNannySetupContext("train", 0);
  __Pyx_TraceStartFunc("train", __pyx_f[1], 275, 0, 0, 0, __PYX_ERR(1, 275, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":287
 *             numpy arrays indicating the start and end of each argument.
 *         """
 *         self.num_sentences = len(sentences)             # <<<<<<<<<<<<<<
 *         self.num_tokens = sum(len(sent) for sent in sentences)
 *         self.only_classify = arguments is not None
*/
  if (unlikely(__pyx_v_sentences == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(1, 287, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyList_GET_SIZE(__pyx_v_sentences); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 287, __pyx_L1_error)
  __pyx_v_self->num_sentences = __pyx_t_1;

  /* "nltkor/tag/libs/networkconv.pyx":288
 *         """
 *         self.num_sentences = len(sentences)
 *         self.num_tokens = sum(len(sent) for sent in sentences)             # <<<<<<<<<<<<<<
 *         self.only_classify = arguments is not None
 * 
*/
  __pyx_t_3 = NULL;
  __Pyx_INCREF(__pyx_builtin_sum);
  __pyx_t_4 = __pyx_builtin_sum; 
  __pyx_t_5 = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_5train_genexpr(NULL, __pyx_v_sentences); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_7 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 288, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_self->__pyx_base.num_tokens = __pyx_t_7;

  /* "nltkor/tag/libs/networkconv.pyx":289
 *         self.num_sentences = len(sentences)
 *         self.num_tokens = sum(len(sent) for sent in sentences)
 *         self.only_classify = arguments is not None             # <<<<<<<<<<<<<<
 * 
 *         logger = logging.getLogger("Logger")
*/
  __pyx_t_8 = (__pyx_v_arguments != ((PyObject*)Py_None));
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool)))) __PYX_ERR(1, 289, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->only_classify);
  __Pyx_DECREF((PyObject *)__pyx_v_self->only_classify);
  __pyx_v_self->only_classify = ((PyLongObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":291
 *         self.only_classify = arguments is not None
 * 
 *         logger = logging.getLogger("Logger")             # <<<<<<<<<<<<<<
 *         logger.info("Training for up to %d epochs" % epochs)
 *         last_accuracy = 0
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_logging); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_getLogger); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Logger};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 291, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_logger = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":292
 * 
 *         logger = logging.getLogger("Logger")
 *         logger.info("Training for up to %d epochs" % epochs)             # <<<<<<<<<<<<<<
 *         last_accuracy = 0
 *         top_accuracy = 0
*/
  __pyx_t_3 = __pyx_v_logger;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_epochs); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_Training_for_up_to_d_epochs, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_info, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":293
 *         logger = logging.getLogger("Logger")
 *         logger.info("Training for up to %d epochs" % epochs)
 *         last_accuracy = 0             # <<<<<<<<<<<<<<
 *         top_accuracy = 0
 *         last_error = np.Infinity
*/
  __pyx_v_last_accuracy = 0.0;

  /* "nltkor/tag/libs/networkconv.pyx":294
 *         logger.info("Training for up to %d epochs" % epochs)
 *         last_accuracy = 0
 *         top_accuracy = 0             # <<<<<<<<<<<<<<
 *         last_error = np.Infinity
 * 
*/
  __pyx_v_top_accuracy = 0.0;

  /* "nltkor/tag/libs/networkconv.pyx":295
 *         last_accuracy = 0
 *         top_accuracy = 0
 *         last_error = np.Infinity             # <<<<<<<<<<<<<<
 * 
 *         if self.validation_sentences is None:
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Infinity); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_last_error = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":297
 *         last_error = np.Infinity
 * 
 *         if self.validation_sentences is None:             # <<<<<<<<<<<<<<
 *             self.set_validation_data(sentences, predicates, tags, arguments)
 * 
*/
  __pyx_t_8 = (__pyx_v_self->__pyx_base.validation_sentences == ((PyObject*)Py_None));
  if (__pyx_t_8) {

    /* "nltkor/tag/libs/networkconv.pyx":298
 * 
 *         if self.validation_sentences is None:
 *             self.set_validation_data(sentences, predicates, tags, arguments)             # <<<<<<<<<<<<<<
 * 
 *         for i in xrange(epochs):
*/
    __pyx_t_2 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_v_sentences, __pyx_v_predicates, __pyx_v_tags, __pyx_v_arguments};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_validation_data, __pyx_callargs+__pyx_t_6, (5-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 298, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":297
 *         last_error = np.Infinity
 * 
 *         if self.validation_sentences is None:             # <<<<<<<<<<<<<<
 *             self.set_validation_data(sentences, predicates, tags, arguments)
 * 
*/
  }

  /* "nltkor/tag/libs/networkconv.pyx":300
 *             self.set_validation_data(sentences, predicates, tags, arguments)
 * 
 *         for i in xrange(epochs):             # <<<<<<<<<<<<<<
 *             self.decrease_learning_rates(i)
 *             self._train_epoch(sentences, predicates, tags, arguments)
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_builtin_xrange);
  __pyx_t_3 = __pyx_builtin_xrange; 
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_epochs); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_3 = __pyx_t_5; __Pyx_INCREF(__pyx_t_3);
    __pyx_t_1 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 300, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 300, __pyx_L1_error)
          #endif
          if (__pyx_t_1 >= __pyx_temp) break;
        }
        __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_1);
        ++__pyx_t_1;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 300, __pyx_L1_error)
          #endif
          if (__pyx_t_1 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1));
        #else
        __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_1);
        #endif
        ++__pyx_t_1;
      }
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 300, __pyx_L1_error)
    } else {
      __pyx_t_5 = __pyx_t_9(__pyx_t_3);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 300, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":301
 * 
 *         for i in xrange(epochs):
 *             self.decrease_learning_rates(i)             # <<<<<<<<<<<<<<
 *             self._train_epoch(sentences, predicates, tags, arguments)
 *             self._validate()
*/
    __pyx_t_4 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_i};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_decrease_learning_rates, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 301, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":302
 *         for i in xrange(epochs):
 *             self.decrease_learning_rates(i)
 *             self._train_epoch(sentences, predicates, tags, arguments)             # <<<<<<<<<<<<<<
 *             self._validate()
 * 
*/
    __pyx_t_4 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_4, __pyx_v_sentences, __pyx_v_predicates, __pyx_v_tags, __pyx_v_arguments};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_train_epoch, __pyx_callargs+__pyx_t_6, (5-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 302, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":303
 *             self.decrease_learning_rates(i)
 *             self._train_epoch(sentences, predicates, tags, arguments)
 *             self._validate()             # <<<<<<<<<<<<<<
 * 
 *             # Attardi: save model
*/
    __pyx_t_4 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_validate, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 303, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":306
 * 
 *             # Attardi: save model
 *             if self.accuracy > top_accuracy:             # <<<<<<<<<<<<<<
 *                 top_accuracy = self.accuracy
 *                 self.save()
*/
    __pyx_t_8 = (__pyx_v_self->__pyx_base.accuracy > __pyx_v_top_accuracy);
    if (__pyx_t_8) {

      /* "nltkor/tag/libs/networkconv.pyx":307
 *             # Attardi: save model
 *             if self.accuracy > top_accuracy:
 *                 top_accuracy = self.accuracy             # <<<<<<<<<<<<<<
 *                 self.save()
 *                 logger.debug("Saved model")
*/
      __pyx_t_10 = __pyx_v_self->__pyx_base.accuracy;
      __pyx_v_top_accuracy = __pyx_t_10;

      /* "nltkor/tag/libs/networkconv.pyx":308
 *             if self.accuracy > top_accuracy:
 *                 top_accuracy = self.accuracy
 *                 self.save()             # <<<<<<<<<<<<<<
 *                 logger.debug("Saved model")
 *             elif self.use_learning_rate_decay:
*/
      __pyx_t_4 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
        __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_save, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 308, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":309
 *                 top_accuracy = self.accuracy
 *                 self.save()
 *                 logger.debug("Saved model")             # <<<<<<<<<<<<<<
 *             elif self.use_learning_rate_decay:
 *                 # this iteration didn't bring improvements; load the last saved model
*/
      __pyx_t_4 = __pyx_v_logger;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Saved_model};
        __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_debug, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 309, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":306
 * 
 *             # Attardi: save model
 *             if self.accuracy > top_accuracy:             # <<<<<<<<<<<<<<
 *                 top_accuracy = self.accuracy
 *                 self.save()
*/
      goto __pyx_L6;
    }

    /* "nltkor/tag/libs/networkconv.pyx":310
 *                 self.save()
 *                 logger.debug("Saved model")
 *             elif self.use_learning_rate_decay:             # <<<<<<<<<<<<<<
 *                 # this iteration didn't bring improvements; load the last saved model
 *                 # before continuing training with a lower rate
*/
    __pyx_t_8 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->__pyx_base.use_learning_rate_decay)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 310, __pyx_L1_error)
    if (__pyx_t_8) {

      /* "nltkor/tag/libs/networkconv.pyx":313
 *                 # this iteration didn't bring improvements; load the last saved model
 *                 # before continuing training with a lower rate
 *                 self._load_parameters()             # <<<<<<<<<<<<<<
 * 
 *             if (epochs_between_reports > 0 and i % epochs_between_reports == 0) \
*/
      __pyx_t_4 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
        __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_load_parameters, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 313, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":310
 *                 self.save()
 *                 logger.debug("Saved model")
 *             elif self.use_learning_rate_decay:             # <<<<<<<<<<<<<<
 *                 # this iteration didn't bring improvements; load the last saved model
 *                 # before continuing training with a lower rate
*/
    }
    __pyx_L6:;

    /* "nltkor/tag/libs/networkconv.pyx":315
 *                 self._load_parameters()
 * 
 *             if (epochs_between_reports > 0 and i % epochs_between_reports == 0) \             # <<<<<<<<<<<<<<
 *                 or self.accuracy >= desired_accuracy > 0 \
 *                 or (self.accuracy < last_accuracy and self.error > last_error):
*/
    __pyx_t_11 = (__pyx_v_epochs_between_reports > 0);
    if (!__pyx_t_11) {
      goto __pyx_L9_next_or;
    } else {
    }
    __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_epochs_between_reports); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 315, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyNumber_Remainder(__pyx_v_i, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 315, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_11 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_4, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(1, 315, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!__pyx_t_11) {
    } else {
      __pyx_t_8 = __pyx_t_11;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_L9_next_or:;

    /* "nltkor/tag/libs/networkconv.pyx":316
 * 
 *             if (epochs_between_reports > 0 and i % epochs_between_reports == 0) \
 *                 or self.accuracy >= desired_accuracy > 0 \             # <<<<<<<<<<<<<<
 *                 or (self.accuracy < last_accuracy and self.error > last_error):
 * 
*/
    __pyx_t_11 = (__pyx_v_self->__pyx_base.accuracy >= __pyx_v_desired_accuracy);
    if (__pyx_t_11) {
      __pyx_t_11 = (__pyx_v_desired_accuracy > 0.0);
    }
    if (!__pyx_t_11) {
    } else {
      __pyx_t_8 = __pyx_t_11;
      goto __pyx_L8_bool_binop_done;
    }

    /* "nltkor/tag/libs/networkconv.pyx":317
 *             if (epochs_between_reports > 0 and i % epochs_between_reports == 0) \
 *                 or self.accuracy >= desired_accuracy > 0 \
 *                 or (self.accuracy < last_accuracy and self.error > last_error):             # <<<<<<<<<<<<<<
 * 
 *                 self._print_epoch_report(i + 1)
*/
    __pyx_t_11 = (__pyx_v_self->__pyx_base.accuracy < __pyx_v_last_accuracy);
    if (__pyx_t_11) {
    } else {
      __pyx_t_8 = __pyx_t_11;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.error); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 317, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_v_last_error, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 317, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(1, 317, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = __pyx_t_11;
    __pyx_L8_bool_binop_done:;

    /* "nltkor/tag/libs/networkconv.pyx":315
 *                 self._load_parameters()
 * 
 *             if (epochs_between_reports > 0 and i % epochs_between_reports == 0) \             # <<<<<<<<<<<<<<
 *                 or self.accuracy >= desired_accuracy > 0 \
 *                 or (self.accuracy < last_accuracy and self.error > last_error):
*/
    if (__pyx_t_8) {

      /* "nltkor/tag/libs/networkconv.pyx":319
 *                 or (self.accuracy < last_accuracy and self.error > last_error):
 * 
 *                 self._print_epoch_report(i + 1)             # <<<<<<<<<<<<<<
 * 
 *                 if self.accuracy >= desired_accuracy > 0\
*/
      __pyx_t_4 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_2 = __Pyx_PyLong_AddObjC(__pyx_v_i, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
        __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_print_epoch_report, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 319, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":321
 *                 self._print_epoch_report(i + 1)
 * 
 *                 if self.accuracy >= desired_accuracy > 0\             # <<<<<<<<<<<<<<
 *                         or (self.accuracy < last_accuracy and self.error > last_error):
 *                     # accuracy is falling, the network is probably diverging
*/
      __pyx_t_11 = (__pyx_v_self->__pyx_base.accuracy >= __pyx_v_desired_accuracy);
      if (__pyx_t_11) {
        __pyx_t_11 = (__pyx_v_desired_accuracy > 0.0);
      }
      if (!__pyx_t_11) {
      } else {
        __pyx_t_8 = __pyx_t_11;
        goto __pyx_L14_bool_binop_done;
      }

      /* "nltkor/tag/libs/networkconv.pyx":322
 * 
 *                 if self.accuracy >= desired_accuracy > 0\
 *                         or (self.accuracy < last_accuracy and self.error > last_error):             # <<<<<<<<<<<<<<
 *                     # accuracy is falling, the network is probably diverging
 *                     # or overfitting
*/
      __pyx_t_11 = (__pyx_v_self->__pyx_base.accuracy < __pyx_v_last_accuracy);
      if (__pyx_t_11) {
      } else {
        __pyx_t_8 = __pyx_t_11;
        goto __pyx_L14_bool_binop_done;
      }
      __pyx_t_5 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.error); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 322, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_v_last_error, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 322, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(1, 322, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = __pyx_t_11;
      __pyx_L14_bool_binop_done:;

      /* "nltkor/tag/libs/networkconv.pyx":321
 *                 self._print_epoch_report(i + 1)
 * 
 *                 if self.accuracy >= desired_accuracy > 0\             # <<<<<<<<<<<<<<
 *                         or (self.accuracy < last_accuracy and self.error > last_error):
 *                     # accuracy is falling, the network is probably diverging
*/
      if (__pyx_t_8) {

        /* "nltkor/tag/libs/networkconv.pyx":325
 *                     # accuracy is falling, the network is probably diverging
 *                     # or overfitting
 *                     break             # <<<<<<<<<<<<<<
 * 
 *             last_accuracy = self.accuracy
*/
        goto __pyx_L5_break;

        /* "nltkor/tag/libs/networkconv.pyx":321
 *                 self._print_epoch_report(i + 1)
 * 
 *                 if self.accuracy >= desired_accuracy > 0\             # <<<<<<<<<<<<<<
 *                         or (self.accuracy < last_accuracy and self.error > last_error):
 *                     # accuracy is falling, the network is probably diverging
*/
      }

      /* "nltkor/tag/libs/networkconv.pyx":315
 *                 self._load_parameters()
 * 
 *             if (epochs_between_reports > 0 and i % epochs_between_reports == 0) \             # <<<<<<<<<<<<<<
 *                 or self.accuracy >= desired_accuracy > 0 \
 *                 or (self.accuracy < last_accuracy and self.error > last_error):
*/
    }

    /* "nltkor/tag/libs/networkconv.pyx":327
 *                     break
 * 
 *             last_accuracy = self.accuracy             # <<<<<<<<<<<<<<
 *             last_error = self.error
 * 
*/
    __pyx_t_10 = __pyx_v_self->__pyx_base.accuracy;
    __pyx_v_last_accuracy = __pyx_t_10;

    /* "nltkor/tag/libs/networkconv.pyx":328
 * 
 *             last_accuracy = self.accuracy
 *             last_error = self.error             # <<<<<<<<<<<<<<
 * 
 *         self.num_sentences = 0
*/
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_last_error, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":300
 *             self.set_validation_data(sentences, predicates, tags, arguments)
 * 
 *         for i in xrange(epochs):             # <<<<<<<<<<<<<<
 *             self.decrease_learning_rates(i)
 *             self._train_epoch(sentences, predicates, tags, arguments)
*/
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  goto __pyx_L17_for_end;
  __pyx_L5_break:;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  goto __pyx_L17_for_end;
  __pyx_L17_for_end:;

  /* "nltkor/tag/libs/networkconv.pyx":330
 *             last_error = self.error
 * 
 *         self.num_sentences = 0             # <<<<<<<<<<<<<<
 *         self.num_tokens = 0
 *         self._reset_counters()
*/
  __pyx_v_self->num_sentences = 0;

  /* "nltkor/tag/libs/networkconv.pyx":331
 * 
 *         self.num_sentences = 0
 *         self.num_tokens = 0             # <<<<<<<<<<<<<<
 *         self._reset_counters()
 * 
*/
  __pyx_v_self->__pyx_base.num_tokens = 0;

  /* "nltkor/tag/libs/networkconv.pyx":332
 *         self.num_sentences = 0
 *         self.num_tokens = 0
 *         self._reset_counters()             # <<<<<<<<<<<<<<
 * 
 *     def _reset_counters(self):
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_reset_counters, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":275
 *         self.validation_arguments = validation_arguments
 * 
 *     def train(self, list sentences, list predicates, list tags,             # <<<<<<<<<<<<<<
 *               int epochs, int epochs_between_reports=0,
 *               float desired_accuracy=0, list arguments=None):
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 275, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 275, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.train", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_logger);
  __Pyx_XDECREF(__pyx_v_last_error);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_gb_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_5train_2generator4);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":334
 *         self._reset_counters()
 * 
 *     def _reset_counters(self):             # <<<<<<<<<<<<<<
 *         """
 *         Reset the performance statistics counters. They are updated during
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_21_reset_counters(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_20_reset_counters, "ConvolutionalNetwork._reset_counters(self)\nReset the performance statistics counters. They are updated during\neach epoch. ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_21_reset_counters = {"_reset_counters", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_21_reset_counters, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_20_reset_counters};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_21_reset_counters(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_reset_counters (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_reset_counters", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_reset_counters", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_20_reset_counters(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_20_reset_counters(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[92]))
  __Pyx_RefNannySetupContext("_reset_counters", 0);
  __Pyx_TraceStartFunc("_reset_counters", __pyx_f[1], 334, 0, 0, 0, __PYX_ERR(1, 334, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":339
 *         each epoch.
 *         """
 *         self.error = 0             # <<<<<<<<<<<<<<
 *         self.skips = 0
 *         self.float_errors = 0
*/
  __pyx_v_self->__pyx_base.error = 0.0;

  /* "nltkor/tag/libs/networkconv.pyx":340
 *         """
 *         self.error = 0
 *         self.skips = 0             # <<<<<<<<<<<<<<
 *         self.float_errors = 0
 * 
*/
  __pyx_v_self->__pyx_base.skips = 0;

  /* "nltkor/tag/libs/networkconv.pyx":341
 *         self.error = 0
 *         self.skips = 0
 *         self.float_errors = 0             # <<<<<<<<<<<<<<
 * 
 *     def _shuffle_data(self, sentences, predicates, tags, arguments=None):
*/
  __pyx_v_self->__pyx_base.float_errors = 0.0;

  /* "nltkor/tag/libs/networkconv.pyx":334
 *         self._reset_counters()
 * 
 *     def _reset_counters(self):             # <<<<<<<<<<<<<<
 *         """
 *         Reset the performance statistics counters. They are updated during
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 334, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 334, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._reset_counters", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":343
 *         self.float_errors = 0
 * 
 *     def _shuffle_data(self, sentences, predicates, tags, arguments=None):             # <<<<<<<<<<<<<<
 *         """
 *         Shuffle the given training data in place.
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_23_shuffle_data(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_22_shuffle_data, "ConvolutionalNetwork._shuffle_data(self, sentences, predicates, tags, arguments=None)\nShuffle the given training data in place.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_23_shuffle_data = {"_shuffle_data", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_23_shuffle_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_22_shuffle_data};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_23_shuffle_data(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_sentences = 0;
  PyObject *__pyx_v_predicates = 0;
  PyObject *__pyx_v_tags = 0;
  PyObject *__pyx_v_arguments = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_shuffle_data (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sentences,&__pyx_mstate_global->__pyx_n_u_predicates,&__pyx_mstate_global->__pyx_n_u_tags,&__pyx_mstate_global->__pyx_n_u_arguments,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 343, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 343, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 343, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 343, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 343, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_shuffle_data", 0) < 0) __PYX_ERR(1, 343, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_shuffle_data", 0, 3, 4, i); __PYX_ERR(1, 343, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 343, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 343, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 343, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 343, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_sentences = values[0];
    __pyx_v_predicates = values[1];
    __pyx_v_tags = values[2];
    __pyx_v_arguments = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_shuffle_data", 0, 3, 4, __pyx_nargs); __PYX_ERR(1, 343, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._shuffle_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_22_shuffle_data(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v_sentences, __pyx_v_predicates, __pyx_v_tags, __pyx_v_arguments);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_22_shuffle_data(CYTHON_UNUSED struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_sentences, PyObject *__pyx_v_predicates, PyObject *__pyx_v_tags, PyObject *__pyx_v_arguments) {
  PyObject *__pyx_v_random_state = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[93]))
  __Pyx_RefNannySetupContext("_shuffle_data", 0);
  __Pyx_TraceStartFunc("_shuffle_data", __pyx_f[1], 343, 0, 0, 0, __PYX_ERR(1, 343, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":349
 *         # get the random number generator state in order to shuffle
 *         # sentences and their tags in the same order
 *         random_state = np.random.get_state()             # <<<<<<<<<<<<<<
 *         np.random.shuffle(sentences)
 *         np.random.set_state(random_state)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_get_state, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 349, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_random_state = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":350
 *         # sentences and their tags in the same order
 *         random_state = np.random.get_state()
 *         np.random.shuffle(sentences)             # <<<<<<<<<<<<<<
 *         np.random.set_state(random_state)
 *         np.random.shuffle(predicates)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_sentences};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_shuffle, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 350, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":351
 *         random_state = np.random.get_state()
 *         np.random.shuffle(sentences)
 *         np.random.set_state(random_state)             # <<<<<<<<<<<<<<
 *         np.random.shuffle(predicates)
 *         np.random.set_state(random_state)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = __pyx_t_2;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_random_state};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_state, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 351, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":352
 *         np.random.shuffle(sentences)
 *         np.random.set_state(random_state)
 *         np.random.shuffle(predicates)             # <<<<<<<<<<<<<<
 *         np.random.set_state(random_state)
 *         np.random.shuffle(tags)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_predicates};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_shuffle, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 352, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":353
 *         np.random.set_state(random_state)
 *         np.random.shuffle(predicates)
 *         np.random.set_state(random_state)             # <<<<<<<<<<<<<<
 *         np.random.shuffle(tags)
 *         if arguments is not None:
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_random_state};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_state, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 353, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":354
 *         np.random.shuffle(predicates)
 *         np.random.set_state(random_state)
 *         np.random.shuffle(tags)             # <<<<<<<<<<<<<<
 *         if arguments is not None:
 *             np.random.set_state(random_state)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = __pyx_t_2;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_tags};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_shuffle, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 354, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":355
 *         np.random.set_state(random_state)
 *         np.random.shuffle(tags)
 *         if arguments is not None:             # <<<<<<<<<<<<<<
 *             np.random.set_state(random_state)
 *             np.random.shuffle(arguments)
*/
  __pyx_t_6 = (__pyx_v_arguments != Py_None);
  if (__pyx_t_6) {

    /* "nltkor/tag/libs/networkconv.pyx":356
 *         np.random.shuffle(tags)
 *         if arguments is not None:
 *             np.random.set_state(random_state)             # <<<<<<<<<<<<<<
 *             np.random.shuffle(arguments)
 * 
*/
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __pyx_t_4;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_random_state};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_state, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 356, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":357
 *         if arguments is not None:
 *             np.random.set_state(random_state)
 *             np.random.shuffle(arguments)             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __pyx_t_3;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_arguments};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_shuffle, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 357, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":355
 *         np.random.set_state(random_state)
 *         np.random.shuffle(tags)
 *         if arguments is not None:             # <<<<<<<<<<<<<<
 *             np.random.set_state(random_state)
 *             np.random.shuffle(arguments)
*/
  }

  /* "nltkor/tag/libs/networkconv.pyx":343
 *         self.float_errors = 0
 * 
 *     def _shuffle_data(self, sentences, predicates, tags, arguments=None):             # <<<<<<<<<<<<<<
 *         """
 *         Shuffle the given training data in place.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 343, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 343, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._shuffle_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_random_state);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":360
 * 
 * 
 *     def _train_epoch(self, sentences, predicates, tags, arguments):             # <<<<<<<<<<<<<<
 *         """Trains for one epoch with all examples."""
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25_train_epoch(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_24_train_epoch, "ConvolutionalNetwork._train_epoch(self, sentences, predicates, tags, arguments)\nTrains for one epoch with all examples.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25_train_epoch = {"_train_epoch", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25_train_epoch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_24_train_epoch};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25_train_epoch(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_sentences = 0;
  PyObject *__pyx_v_predicates = 0;
  PyObject *__pyx_v_tags = 0;
  PyObject *__pyx_v_arguments = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_train_epoch (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sentences,&__pyx_mstate_global->__pyx_n_u_predicates,&__pyx_mstate_global->__pyx_n_u_tags,&__pyx_mstate_global->__pyx_n_u_arguments,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 360, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 360, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 360, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 360, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 360, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_train_epoch", 0) < 0) __PYX_ERR(1, 360, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_train_epoch", 1, 4, 4, i); __PYX_ERR(1, 360, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 360, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 360, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 360, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 360, __pyx_L3_error)
    }
    __pyx_v_sentences = values[0];
    __pyx_v_predicates = values[1];
    __pyx_v_tags = values[2];
    __pyx_v_arguments = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_train_epoch", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 360, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._train_epoch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_24_train_epoch(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v_sentences, __pyx_v_predicates, __pyx_v_tags, __pyx_v_arguments);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_24_train_epoch(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_sentences, PyObject *__pyx_v_predicates, PyObject *__pyx_v_tags, PyObject *__pyx_v_arguments) {
  PyObject *__pyx_v_i_args = NULL;
  PyObject *__pyx_v_sent_args = NULL;
  PyObject *__pyx_v_sent = NULL;
  PyObject *__pyx_v_sent_preds = NULL;
  PyObject *__pyx_v_sent_tags = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[94]))
  __Pyx_RefNannySetupContext("_train_epoch", 0);
  __Pyx_TraceStartFunc("_train_epoch", __pyx_f[1], 360, 0, 0, 0, __PYX_ERR(1, 360, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":363
 *         """Trains for one epoch with all examples."""
 * 
 *         self._reset_counters()             # <<<<<<<<<<<<<<
 *         self._shuffle_data(sentences, predicates, tags, arguments)
 *         if arguments is not None:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_reset_counters, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":364
 * 
 *         self._reset_counters()
 *         self._shuffle_data(sentences, predicates, tags, arguments)             # <<<<<<<<<<<<<<
 *         if arguments is not None:
 *             i_args = iter(arguments)
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_v_sentences, __pyx_v_predicates, __pyx_v_tags, __pyx_v_arguments};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_shuffle_data, __pyx_callargs+__pyx_t_3, (5-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 364, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":365
 *         self._reset_counters()
 *         self._shuffle_data(sentences, predicates, tags, arguments)
 *         if arguments is not None:             # <<<<<<<<<<<<<<
 *             i_args = iter(arguments)
 *         else:
*/
  __pyx_t_4 = (__pyx_v_arguments != Py_None);
  if (__pyx_t_4) {

    /* "nltkor/tag/libs/networkconv.pyx":366
 *         self._shuffle_data(sentences, predicates, tags, arguments)
 *         if arguments is not None:
 *             i_args = iter(arguments)             # <<<<<<<<<<<<<<
 *         else:
 *             sent_args = None
*/
    __pyx_t_1 = PyObject_GetIter(__pyx_v_arguments); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 366, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_i_args = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":365
 *         self._reset_counters()
 *         self._shuffle_data(sentences, predicates, tags, arguments)
 *         if arguments is not None:             # <<<<<<<<<<<<<<
 *             i_args = iter(arguments)
 *         else:
*/
    goto __pyx_L3;
  }

  /* "nltkor/tag/libs/networkconv.pyx":368
 *             i_args = iter(arguments)
 *         else:
 *             sent_args = None             # <<<<<<<<<<<<<<
 * 
 *         for sent, sent_preds, sent_tags in zip(sentences, predicates, tags):
*/
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __pyx_v_sent_args = Py_None;
  }
  __pyx_L3:;

  /* "nltkor/tag/libs/networkconv.pyx":370
 *             sent_args = None
 * 
 *         for sent, sent_preds, sent_tags in zip(sentences, predicates, tags):             # <<<<<<<<<<<<<<
 *             if arguments is not None:
 *                 sent_args = next(i_args)
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_builtin_zip);
  __pyx_t_5 = __pyx_builtin_zip; 
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_sentences, __pyx_v_predicates, __pyx_v_tags};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_3, (4-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5);
    __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 370, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 370, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_6);
        ++__pyx_t_6;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 370, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6));
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_6);
        #endif
        ++__pyx_t_6;
      }
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 370, __pyx_L1_error)
    } else {
      __pyx_t_1 = __pyx_t_7(__pyx_t_5);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 370, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_1);
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(1, 370, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_8);
        __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2);
        __Pyx_INCREF(__pyx_t_9);
      } else {
        __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0);
        if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 370, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_2);
        __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1);
        if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 370, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_8);
        __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 2);
        if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 370, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_9);
      }
      #else
      __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 370, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 370, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 370, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 370, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10);
      index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      index = 1; __pyx_t_8 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_8);
      index = 2; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_9);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 3) < 0) __PYX_ERR(1, 370, __pyx_L1_error)
      __pyx_t_11 = NULL;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_11 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(1, 370, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_sent, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_sent_preds, __pyx_t_8);
    __pyx_t_8 = 0;
    __Pyx_XDECREF_SET(__pyx_v_sent_tags, __pyx_t_9);
    __pyx_t_9 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":371
 * 
 *         for sent, sent_preds, sent_tags in zip(sentences, predicates, tags):
 *             if arguments is not None:             # <<<<<<<<<<<<<<
 *                 sent_args = next(i_args)
 *                 #sent_args = i_args.next()
*/
    __pyx_t_4 = (__pyx_v_arguments != Py_None);
    if (__pyx_t_4) {

      /* "nltkor/tag/libs/networkconv.pyx":372
 *         for sent, sent_preds, sent_tags in zip(sentences, predicates, tags):
 *             if arguments is not None:
 *                 sent_args = next(i_args)             # <<<<<<<<<<<<<<
 *                 #sent_args = i_args.next()
 * 
*/
      if (unlikely(!__pyx_v_i_args)) { __Pyx_RaiseUnboundLocalError("i_args"); __PYX_ERR(1, 372, __pyx_L1_error) }
      __pyx_t_1 = __Pyx_PyIter_Next(__pyx_v_i_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 372, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_sent_args, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":371
 * 
 *         for sent, sent_preds, sent_tags in zip(sentences, predicates, tags):
 *             if arguments is not None:             # <<<<<<<<<<<<<<
 *                 sent_args = next(i_args)
 *                 #sent_args = i_args.next()
*/
    }

    /* "nltkor/tag/libs/networkconv.pyx":375
 *                 #sent_args = i_args.next()
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 self._tag_sentence(sent, sent_preds, sent_tags, sent_args)
 *             except FloatingPointError:
*/
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      /*try:*/ {

        /* "nltkor/tag/libs/networkconv.pyx":376
 * 
 *             try:
 *                 self._tag_sentence(sent, sent_preds, sent_tags, sent_args)             # <<<<<<<<<<<<<<
 *             except FloatingPointError:
 *                 # just ignore the sentence in case of an overflow
*/
        __pyx_t_9 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_9);
        if (unlikely(!__pyx_v_sent_args)) { __Pyx_RaiseUnboundLocalError("sent_args"); __PYX_ERR(1, 376, __pyx_L9_error) }
        __pyx_t_3 = 0;
        {
          PyObject *__pyx_callargs[5] = {__pyx_t_9, __pyx_v_sent, __pyx_v_sent_preds, __pyx_v_sent_tags, __pyx_v_sent_args};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_tag_sentence, __pyx_callargs+__pyx_t_3, (5-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 376, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "nltkor/tag/libs/networkconv.pyx":375
 *                 #sent_args = i_args.next()
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 self._tag_sentence(sent, sent_preds, sent_tags, sent_args)
 *             except FloatingPointError:
*/
      }
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      goto __pyx_L16_try_end;
      __pyx_L9_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_TraceException(__pyx_lineno, 0, 0);

      /* "nltkor/tag/libs/networkconv.pyx":377
 *             try:
 *                 self._tag_sentence(sent, sent_preds, sent_tags, sent_args)
 *             except FloatingPointError:             # <<<<<<<<<<<<<<
 *                 # just ignore the sentence in case of an overflow
 *                 self.float_errors += 1
*/
      __pyx_t_15 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_FloatingPointError);
      if (__pyx_t_15) {
        __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._train_epoch", __pyx_clineno, __pyx_lineno, __pyx_filename);
        __Pyx_TraceExceptionHandled(0);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_9, &__pyx_t_8) < 0) __PYX_ERR(1, 377, __pyx_L11_except_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_TraceExceptionDone();

        /* "nltkor/tag/libs/networkconv.pyx":379
 *             except FloatingPointError:
 *                 # just ignore the sentence in case of an overflow
 *                 self.float_errors += 1             # <<<<<<<<<<<<<<
 * 
 *     def tag_sentence(self, np.ndarray sentence, np.ndarray predicates,
*/
        __pyx_v_self->__pyx_base.float_errors = (__pyx_v_self->__pyx_base.float_errors + 1.0);
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L10_exception_handled;
      }
      goto __pyx_L11_except_error;

      /* "nltkor/tag/libs/networkconv.pyx":375
 *                 #sent_args = i_args.next()
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 self._tag_sentence(sent, sent_preds, sent_tags, sent_args)
 *             except FloatingPointError:
*/
      __pyx_L11_except_error:;
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      goto __pyx_L1_error;
      __pyx_L10_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      __pyx_L16_try_end:;
    }

    /* "nltkor/tag/libs/networkconv.pyx":370
 *             sent_args = None
 * 
 *         for sent, sent_preds, sent_tags in zip(sentences, predicates, tags):             # <<<<<<<<<<<<<<
 *             if arguments is not None:
 *                 sent_args = next(i_args)
*/
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":360
 * 
 * 
 *     def _train_epoch(self, sentences, predicates, tags, arguments):             # <<<<<<<<<<<<<<
 *         """Trains for one epoch with all examples."""
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 360, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 360, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._train_epoch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_i_args);
  __Pyx_XDECREF(__pyx_v_sent_args);
  __Pyx_XDECREF(__pyx_v_sent);
  __Pyx_XDECREF(__pyx_v_sent_preds);
  __Pyx_XDECREF(__pyx_v_sent_tags);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":381
 *                 self.float_errors += 1
 * 
 *     def tag_sentence(self, np.ndarray sentence, np.ndarray predicates,             # <<<<<<<<<<<<<<
 *                      list arguments=None, bool logprob=False,
 *                      bool allow_repeats=True):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_27tag_sentence(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_26tag_sentence, "ConvolutionalNetwork.tag_sentence(self, ndarray sentence, ndarray predicates, list arguments=None, bool logprob=False, bool allow_repeats=True)\nRuns the network for each element in the sentence and returns \nthe sequence of tags.\n\n:param sentence: a 2-dim numpy array, where each item encodes a token.\n:param predicates: a 1-dim numpy array, indicating the position\n    of the predicates in the sentence\n:param logprob: a boolean indicating whether to return the \n    log-probability for each answer or not.\n:param allow_repeats: a boolean indicating whether to allow repeated\n    argument classes (only for separate argument classification).");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_27tag_sentence = {"tag_sentence", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_27tag_sentence, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_26tag_sentence};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_27tag_sentence(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyArrayObject *__pyx_v_sentence = 0;
  PyArrayObject *__pyx_v_predicates = 0;
  PyObject *__pyx_v_arguments = 0;
  PyLongObject *__pyx_v_logprob = 0;
  PyLongObject *__pyx_v_allow_repeats = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tag_sentence (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sentence,&__pyx_mstate_global->__pyx_n_u_predicates,&__pyx_mstate_global->__pyx_n_u_arguments,&__pyx_mstate_global->__pyx_n_u_logprob,&__pyx_mstate_global->__pyx_n_u_allow_repeats,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 381, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 381, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 381, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 381, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 381, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 381, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "tag_sentence", 0) < 0) __PYX_ERR(1, 381, __pyx_L3_error)

      /* "nltkor/tag/libs/networkconv.pyx":382
 * 
 *     def tag_sentence(self, np.ndarray sentence, np.ndarray predicates,
 *                      list arguments=None, bool logprob=False,             # <<<<<<<<<<<<<<
 *                      bool allow_repeats=True):
 *         """
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((PyLongObject *)Py_False));

      /* "nltkor/tag/libs/networkconv.pyx":383
 *     def tag_sentence(self, np.ndarray sentence, np.ndarray predicates,
 *                      list arguments=None, bool logprob=False,
 *                      bool allow_repeats=True):             # <<<<<<<<<<<<<<
 *         """
 *         Runs the network for each element in the sentence and returns
*/
      if (!values[4]) values[4] = __Pyx_NewRef((PyObject *)((PyLongObject *)Py_True));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("tag_sentence", 0, 2, 5, i); __PYX_ERR(1, 381, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 381, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 381, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 381, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 381, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 381, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "nltkor/tag/libs/networkconv.pyx":382
 * 
 *     def tag_sentence(self, np.ndarray sentence, np.ndarray predicates,
 *                      list arguments=None, bool logprob=False,             # <<<<<<<<<<<<<<
 *                      bool allow_repeats=True):
 *         """
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((PyLongObject *)Py_False));

      /* "nltkor/tag/libs/networkconv.pyx":383
 *     def tag_sentence(self, np.ndarray sentence, np.ndarray predicates,
 *                      list arguments=None, bool logprob=False,
 *                      bool allow_repeats=True):             # <<<<<<<<<<<<<<
 *         """
 *         Runs the network for each element in the sentence and returns
*/
      if (!values[4]) values[4] = __Pyx_NewRef((PyObject *)((PyLongObject *)Py_True));
    }
    __pyx_v_sentence = ((PyArrayObject *)values[0]);
    __pyx_v_predicates = ((PyArrayObject *)values[1]);
    __pyx_v_arguments = ((PyObject*)values[2]);
    __pyx_v_logprob = ((PyLongObject *)values[3]);
    __pyx_v_allow_repeats = ((PyLongObject *)values[4]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tag_sentence", 0, 2, 5, __pyx_nargs); __PYX_ERR(1, 381, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.tag_sentence", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sentence), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "sentence", 0))) __PYX_ERR(1, 381, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_predicates), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "predicates", 0))) __PYX_ERR(1, 381, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arguments), (&PyList_Type), 1, "arguments", 1))) __PYX_ERR(1, 382, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_logprob), __pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool, 1, "logprob", 0))) __PYX_ERR(1, 382, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_allow_repeats), __pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool, 1, "allow_repeats", 0))) __PYX_ERR(1, 383, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_26tag_sentence(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v_sentence, __pyx_v_predicates, __pyx_v_arguments, __pyx_v_logprob, __pyx_v_allow_repeats);

  /* "nltkor/tag/libs/networkconv.pyx":381
 *                 self.float_errors += 1
 * 
 *     def tag_sentence(self, np.ndarray sentence, np.ndarray predicates,             # <<<<<<<<<<<<<<
 *                      list arguments=None, bool logprob=False,
 *                      bool allow_repeats=True):
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_26tag_sentence(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyArrayObject *__pyx_v_sentence, PyArrayObject *__pyx_v_predicates, PyObject *__pyx_v_arguments, PyLongObject *__pyx_v_logprob, PyLongObject *__pyx_v_allow_repeats) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[95]))
  __Pyx_RefNannySetupContext("tag_sentence", 0);
  __Pyx_TraceStartFunc("tag_sentence", __pyx_f[1], 381, 0, 0, 0, __PYX_ERR(1, 381, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":396
 *             argument classes (only for separate argument classification).
 *         """
 *         self.only_classify = arguments is not None             # <<<<<<<<<<<<<<
 *         return self._tag_sentence(sentence, predicates, argument_blocks=arguments,
 *                                   logprob=logprob, allow_repeats=allow_repeats)
*/
  __pyx_t_1 = (__pyx_v_arguments != ((PyObject*)Py_None));
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool)))) __PYX_ERR(1, 396, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->only_classify);
  __Pyx_DECREF((PyObject *)__pyx_v_self->only_classify);
  __pyx_v_self->only_classify = ((PyLongObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":397
 *         """
 *         self.only_classify = arguments is not None
 *         return self._tag_sentence(sentence, predicates, argument_blocks=arguments,             # <<<<<<<<<<<<<<
 *                                   logprob=logprob, allow_repeats=allow_repeats)
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_3);

  /* "nltkor/tag/libs/networkconv.pyx":398
 *         self.only_classify = arguments is not None
 *         return self._tag_sentence(sentence, predicates, argument_blocks=arguments,
 *                                   logprob=logprob, allow_repeats=allow_repeats)             # <<<<<<<<<<<<<<
 * 
 *     cdef np.ndarray argument_distances(self, positions, argument):
*/
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 3 : 0)] = {__pyx_t_3, ((PyObject *)__pyx_v_sentence), ((PyObject *)__pyx_v_predicates)};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_argument_blocks, __pyx_v_arguments, __pyx_t_5, __pyx_callargs+3, 0) < 0) __PYX_ERR(1, 397, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_logprob, ((PyObject *)__pyx_v_logprob), __pyx_t_5, __pyx_callargs+3, 1) < 0) __PYX_ERR(1, 397, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_allow_repeats, ((PyObject *)__pyx_v_allow_repeats), __pyx_t_5, __pyx_callargs+3, 2) < 0) __PYX_ERR(1, 397, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_tag_sentence, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 397, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  __Pyx_TraceReturnValue(__pyx_r, 9, 0, __PYX_ERR(1, 397, __pyx_L1_error));
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkconv.pyx":381
 *                 self.float_errors += 1
 * 
 *     def tag_sentence(self, np.ndarray sentence, np.ndarray predicates,             # <<<<<<<<<<<<<<
 *                      list arguments=None, bool logprob=False,
 *                      bool allow_repeats=True):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 381, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.tag_sentence", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":400
 *                                   logprob=logprob, allow_repeats=allow_repeats)
 * 
 *     cdef np.ndarray argument_distances(self, positions, argument):             # <<<<<<<<<<<<<<
 *         """
 *         Calculates the distance from each token in the sentence to the argument.
*/

static PyArrayObject *__pyx_f_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_argument_distances(CYTHON_UNUSED struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_positions, PyObject *__pyx_v_argument) {
  PyObject *__pyx_v_distances = NULL;
  PyObject *__pyx_v_lo = NULL;
  PyObject *__pyx_v_hi = NULL;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[96]))
  __Pyx_RefNannySetupContext("argument_distances", 0);
  __Pyx_TraceStartFunc("argument_distances", __pyx_f[1], 400, 0, 0, 0, __PYX_ERR(1, 400, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":404
 *         Calculates the distance from each token in the sentence to the argument.
 *         """
 *         distances = positions.copy()             # <<<<<<<<<<<<<<
 * 
 *         # the ones before the argument
*/
  __pyx_t_2 = __pyx_v_positions;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_distances = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":408
 *         # the ones before the argument
 *         #print(argument)
 *         lo = np.less(positions, argument[0])             # <<<<<<<<<<<<<<
 *         distances[lo] -= argument[0]
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_less); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_argument, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_3 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_positions, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_lo = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":409
 *         #print(argument)
 *         lo = np.less(positions, argument[0])
 *         distances[lo] -= argument[0]             # <<<<<<<<<<<<<<
 * 
 *         # the ones after the argument
*/
  __Pyx_INCREF(__pyx_v_lo);
  __pyx_t_1 = __pyx_v_lo;
  __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_distances, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_argument, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyNumber_InPlaceSubtract(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely((PyObject_SetItem(__pyx_v_distances, __pyx_t_1, __pyx_t_2) < 0))) __PYX_ERR(1, 409, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":412
 * 
 *         # the ones after the argument
 *         hi = np.greater(positions, argument[1])             # <<<<<<<<<<<<<<
 *         distances[hi] -= argument[1]
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_greater); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_argument, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_3 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_positions, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 412, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_hi = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":413
 *         # the ones after the argument
 *         hi = np.greater(positions, argument[1])
 *         distances[hi] -= argument[1]             # <<<<<<<<<<<<<<
 * 
 *         # the ones inside the argument
*/
  __Pyx_INCREF(__pyx_v_hi);
  __pyx_t_1 = __pyx_v_hi;
  __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_distances, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_argument, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyNumber_InPlaceSubtract(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely((PyObject_SetItem(__pyx_v_distances, __pyx_t_1, __pyx_t_2) < 0))) __PYX_ERR(1, 413, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":416
 * 
 *         # the ones inside the argument
 *         distances[np.logical_not(hi | lo)] = 0             # <<<<<<<<<<<<<<
 * 
 *         return distances
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_logical_not); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Or(__pyx_v_hi, __pyx_v_lo); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_3 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 416, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (unlikely((PyObject_SetItem(__pyx_v_distances, __pyx_t_1, __pyx_mstate_global->__pyx_int_0) < 0))) __PYX_ERR(1, 416, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":418
 *         distances[np.logical_not(hi | lo)] = 0
 * 
 *         return distances             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  if (!(likely(((__pyx_v_distances) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_distances, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 418, __pyx_L1_error)
  __Pyx_INCREF(__pyx_v_distances);
  __pyx_r = ((PyArrayObject *)__pyx_v_distances);
  __Pyx_TraceReturnValue((PyObject *)__pyx_r, 42, 0, __PYX_ERR(1, 418, __pyx_L1_error));
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkconv.pyx":400
 *                                   logprob=logprob, allow_repeats=allow_repeats)
 * 
 *     cdef np.ndarray argument_distances(self, positions, argument):             # <<<<<<<<<<<<<<
 *         """
 *         Calculates the distance from each token in the sentence to the argument.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 400, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.argument_distances", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_distances);
  __Pyx_XDECREF(__pyx_v_lo);
  __Pyx_XDECREF(__pyx_v_hi);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":421
 * 
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _sentence_convolution(self, sentence, predicate, argument_blocks=None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_29_sentence_convolution(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_28_sentence_convolution, "ConvolutionalNetwork._sentence_convolution(self, sentence, predicate, argument_blocks=None, training=False)\nPerform the convolution for a given predicate.\n\n:param sentence: a sequence of tokens, each represented as an array of \n    indices\n:param predicate: the index of the predicate in the sentence\n:param argument_blocks: (used only in SRL argument classification) the\n    starting and end positions of all delimited arguments\n:return: the scores for all tokens with respect to the given predicate");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_29_sentence_convolution = {"_sentence_convolution", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_29_sentence_convolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_28_sentence_convolution};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_29_sentence_convolution(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_sentence = 0;
  PyObject *__pyx_v_predicate = 0;
  PyObject *__pyx_v_argument_blocks = 0;
  PyObject *__pyx_v_training = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_sentence_convolution (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sentence,&__pyx_mstate_global->__pyx_n_u_predicate,&__pyx_mstate_global->__pyx_n_u_argument_blocks,&__pyx_mstate_global->__pyx_n_u_training,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 421, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 421, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 421, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 421, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 421, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_sentence_convolution", 0) < 0) __PYX_ERR(1, 421, __pyx_L3_error)

      /* "nltkor/tag/libs/networkconv.pyx":423
 *     @cython.boundscheck(False)
 *     @cython.wraparound(False)
 *     def _sentence_convolution(self, sentence, predicate, argument_blocks=None,             # <<<<<<<<<<<<<<
 *                               training=False):
 *         """
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "nltkor/tag/libs/networkconv.pyx":424
 *     @cython.wraparound(False)
 *     def _sentence_convolution(self, sentence, predicate, argument_blocks=None,
 *                               training=False):             # <<<<<<<<<<<<<<
 *         """
 *         Perform the convolution for a given predicate.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_False));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_sentence_convolution", 0, 2, 4, i); __PYX_ERR(1, 421, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 421, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 421, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 421, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 421, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "nltkor/tag/libs/networkconv.pyx":423
 *     @cython.boundscheck(False)
 *     @cython.wraparound(False)
 *     def _sentence_convolution(self, sentence, predicate, argument_blocks=None,             # <<<<<<<<<<<<<<
 *                               training=False):
 *         """
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "nltkor/tag/libs/networkconv.pyx":424
 *     @cython.wraparound(False)
 *     def _sentence_convolution(self, sentence, predicate, argument_blocks=None,
 *                               training=False):             # <<<<<<<<<<<<<<
 *         """
 *         Perform the convolution for a given predicate.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_sentence = values[0];
    __pyx_v_predicate = values[1];
    __pyx_v_argument_blocks = values[2];
    __pyx_v_training = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_sentence_convolution", 0, 2, 4, __pyx_nargs); __PYX_ERR(1, 421, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._sentence_convolution", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_28_sentence_convolution(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v_sentence, __pyx_v_predicate, __pyx_v_argument_blocks, __pyx_v_training);

  /* "nltkor/tag/libs/networkconv.pyx":421
 * 
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _sentence_convolution(self, sentence, predicate, argument_blocks=None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_28_sentence_convolution(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_sentence, PyObject *__pyx_v_predicate, PyObject *__pyx_v_argument_blocks, PyObject *__pyx_v_training) {
  PyArrayObject *__pyx_v_convolution_values = 0;
  PyArrayObject *__pyx_v_scores = 0;
  PyArrayObject *__pyx_v_input_and_pred_dist_values = 0;
  PyObject *__pyx_v_pred_dist_indices = NULL;
  PyObject *__pyx_v_pred_dist_values = NULL;
  PyObject *__pyx_v_target = NULL;
  PyObject *__pyx_v_target_dist_indices = NULL;
  PyObject *__pyx_v_argument = NULL;
  PyObject *__pyx_v_target_dist_values = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_convolution_values;
  __Pyx_Buffer __pyx_pybuffer_convolution_values;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_input_and_pred_dist_values;
  __Pyx_Buffer __pyx_pybuffer_input_and_pred_dist_values;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_scores;
  __Pyx_Buffer __pyx_pybuffer_scores;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  size_t __pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *(*__pyx_t_15)(PyObject *);
  struct __pyx_opt_args_6nltkor_3tag_4libs_7network_hardtanh __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[97]))
  __Pyx_RefNannySetupContext("_sentence_convolution", 0);
  __Pyx_TraceStartFunc("_sentence_convolution", __pyx_f[1], 421, 0, 0, 0, __PYX_ERR(1, 421, __pyx_L1_error));
  __pyx_pybuffer_convolution_values.pybuffer.buf = NULL;
  __pyx_pybuffer_convolution_values.refcount = 0;
  __pyx_pybuffernd_convolution_values.data = NULL;
  __pyx_pybuffernd_convolution_values.rcbuffer = &__pyx_pybuffer_convolution_values;
  __pyx_pybuffer_scores.pybuffer.buf = NULL;
  __pyx_pybuffer_scores.refcount = 0;
  __pyx_pybuffernd_scores.data = NULL;
  __pyx_pybuffernd_scores.rcbuffer = &__pyx_pybuffer_scores;
  __pyx_pybuffer_input_and_pred_dist_values.pybuffer.buf = NULL;
  __pyx_pybuffer_input_and_pred_dist_values.refcount = 0;
  __pyx_pybuffernd_input_and_pred_dist_values.data = NULL;
  __pyx_pybuffernd_input_and_pred_dist_values.rcbuffer = &__pyx_pybuffer_input_and_pred_dist_values;

  /* "nltkor/tag/libs/networkconv.pyx":444
 *         cdef np.ndarray[FLOAT_t, ndim=2] input_and_pred_dist_values
 * 
 *         self.num_targets = len(sentence) if argument_blocks is None else len(argument_blocks)             # <<<<<<<<<<<<<<
 * 
 *         # maximum values found by convolution
*/
  __pyx_t_2 = (__pyx_v_argument_blocks == Py_None);
  if (__pyx_t_2) {
    __pyx_t_3 = PyObject_Length(__pyx_v_sentence); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 444, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_3;
  } else {
    __pyx_t_3 = PyObject_Length(__pyx_v_argument_blocks); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 444, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_3;
  }
  __pyx_v_self->num_targets = __pyx_t_1;

  /* "nltkor/tag/libs/networkconv.pyx":447
 * 
 *         # maximum values found by convolution
 *         self.hidden_values = np.zeros((self.num_targets, self.hidden_size))             # <<<<<<<<<<<<<<
 * 
 *         if training:
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_self->num_targets); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.hidden_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6) != (0)) __PYX_ERR(1, 447, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8) != (0)) __PYX_ERR(1, 447, __pyx_L1_error);
  __pyx_t_6 = 0;
  __pyx_t_8 = 0;
  __pyx_t_10 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
    __pyx_t_10 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_9};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 447, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 447, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.hidden_values);
  __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.hidden_values);
  __pyx_v_self->__pyx_base.hidden_values = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":449
 *         self.hidden_values = np.zeros((self.num_targets, self.hidden_size))
 * 
 *         if training:             # <<<<<<<<<<<<<<
 *             # hidden sent values: results after tanh
 *             self.hidden_values = np.zeros((self.num_targets, self.hidden_size))
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_training); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 449, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "nltkor/tag/libs/networkconv.pyx":451
 *         if training:
 *             # hidden sent values: results after tanh
 *             self.hidden_values = np.zeros((self.num_targets, self.hidden_size))             # <<<<<<<<<<<<<<
 *             self.max_indices = np.empty((self.num_targets, self.hidden_size), int)
 *             #self.max_indices = np.empty((self.num_targets, self.hidden_size), np.int)
*/
    __pyx_t_7 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyLong_From_int(__pyx_v_self->num_targets); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.hidden_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_9);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9) != (0)) __PYX_ERR(1, 451, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_8) != (0)) __PYX_ERR(1, 451, __pyx_L1_error);
    __pyx_t_9 = 0;
    __pyx_t_8 = 0;
    __pyx_t_10 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_7);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_10 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 451, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 451, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.hidden_values);
    __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.hidden_values);
    __pyx_v_self->__pyx_base.hidden_values = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":452
 *             # hidden sent values: results after tanh
 *             self.hidden_values = np.zeros((self.num_targets, self.hidden_size))
 *             self.max_indices = np.empty((self.num_targets, self.hidden_size), int)             # <<<<<<<<<<<<<<
 *             #self.max_indices = np.empty((self.num_targets, self.hidden_size), np.int)
 * 
*/
    __pyx_t_5 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_self->num_targets); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.hidden_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6) != (0)) __PYX_ERR(1, 452, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8) != (0)) __PYX_ERR(1, 452, __pyx_L1_error);
    __pyx_t_6 = 0;
    __pyx_t_8 = 0;
    __pyx_t_10 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
      __pyx_t_10 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_9, ((PyObject *)(&PyLong_Type))};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 452, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 452, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->max_indices);
    __Pyx_DECREF((PyObject *)__pyx_v_self->max_indices);
    __pyx_v_self->max_indices = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":449
 *         self.hidden_values = np.zeros((self.num_targets, self.hidden_size))
 * 
 *         if training:             # <<<<<<<<<<<<<<
 *             # hidden sent values: results after tanh
 *             self.hidden_values = np.zeros((self.num_targets, self.hidden_size))
*/
  }

  /* "nltkor/tag/libs/networkconv.pyx":456
 * 
 *         # predicate distances are the same across all targets
 *         pred_dist_indices = np.arange(len(sentence)) - predicate             # <<<<<<<<<<<<<<
 *         pred_dist_values = self.pred_convolution_lookup.take(pred_dist_indices + self.pred_dist_offset,
 *                                                              0, mode='clip')
*/
  __pyx_t_7 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_arange); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_1 = PyObject_Length(__pyx_v_sentence); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 456, __pyx_L1_error)
  __pyx_t_9 = PyLong_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_7);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_10 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_9};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 456, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_5 = PyNumber_Subtract(__pyx_t_4, __pyx_v_predicate); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_pred_dist_indices = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":457
 *         # predicate distances are the same across all targets
 *         pred_dist_indices = np.arange(len(sentence)) - predicate
 *         pred_dist_values = self.pred_convolution_lookup.take(pred_dist_indices + self.pred_dist_offset,             # <<<<<<<<<<<<<<
 *                                                              0, mode='clip')
 * 
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_self->pred_convolution_lookup);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_PyLong_From_int(__pyx_v_self->pred_dist_offset); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_7 = PyNumber_Add(__pyx_v_pred_dist_indices, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_t_7, __pyx_mstate_global->__pyx_int_0};
    __pyx_t_9 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 457, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_n_u_clip, __pyx_t_9, __pyx_callargs+3, 0) < 0) __PYX_ERR(1, 457, __pyx_L1_error)
    __pyx_t_5 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_take, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 457, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __pyx_v_pred_dist_values = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":460
 *                                                              0, mode='clip')
 * 
 *         input_and_pred_dist_values = pred_dist_values + self.convolution_lookup             # <<<<<<<<<<<<<<
 * 
 *         for target in range(self.num_targets):
*/
  __pyx_t_5 = PyNumber_Add(__pyx_v_pred_dist_values, ((PyObject *)__pyx_v_self->convolution_lookup)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 460, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_and_pred_dist_values.rcbuffer->pybuffer);
    __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_and_pred_dist_values.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_5), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_11 < 0)) {
      PyErr_Fetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_and_pred_dist_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_input_and_pred_dist_values, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      }
      __pyx_t_12 = __pyx_t_13 = __pyx_t_14 = 0;
    }
    __pyx_pybuffernd_input_and_pred_dist_values.diminfo[0].strides = __pyx_pybuffernd_input_and_pred_dist_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input_and_pred_dist_values.diminfo[0].shape = __pyx_pybuffernd_input_and_pred_dist_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_input_and_pred_dist_values.diminfo[1].strides = __pyx_pybuffernd_input_and_pred_dist_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_input_and_pred_dist_values.diminfo[1].shape = __pyx_pybuffernd_input_and_pred_dist_values.rcbuffer->pybuffer.shape[1];
    if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(1, 460, __pyx_L1_error)
  }
  __pyx_v_input_and_pred_dist_values = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":462
 *         input_and_pred_dist_values = pred_dist_values + self.convolution_lookup
 * 
 *         for target in range(self.num_targets):             # <<<<<<<<<<<<<<
 *             # loop over targets and add the weighted distance features to each token
 *             # this is necessary for the convolution layer
*/
  __pyx_t_9 = NULL;
  __Pyx_INCREF(__pyx_builtin_range);
  __pyx_t_7 = __pyx_builtin_range; 
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_self->num_targets); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_4};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 462, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_7 = __pyx_t_5; __Pyx_INCREF(__pyx_t_7);
    __pyx_t_1 = 0;
    __pyx_t_15 = NULL;
  } else {
    __pyx_t_1 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 462, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 462, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_15)) {
      if (likely(PyList_CheckExact(__pyx_t_7))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 462, __pyx_L1_error)
          #endif
          if (__pyx_t_1 >= __pyx_temp) break;
        }
        __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_1);
        ++__pyx_t_1;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 462, __pyx_L1_error)
          #endif
          if (__pyx_t_1 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_1));
        #else
        __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_1);
        #endif
        ++__pyx_t_1;
      }
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 462, __pyx_L1_error)
    } else {
      __pyx_t_5 = __pyx_t_15(__pyx_t_7);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 462, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_target, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":470
 *             # if we are classifying arguments, pick the distance to the closest boundary
 *             # of the argument (beginning or end)
 *             if argument_blocks is None:             # <<<<<<<<<<<<<<
 *                 target_dist_indices = np.arange(len(sentence)) - target
 *             else:
*/
    __pyx_t_2 = (__pyx_v_argument_blocks == Py_None);
    if (__pyx_t_2) {

      /* "nltkor/tag/libs/networkconv.pyx":471
 *             # of the argument (beginning or end)
 *             if argument_blocks is None:
 *                 target_dist_indices = np.arange(len(sentence)) - target             # <<<<<<<<<<<<<<
 *             else:
 *                 argument = argument_blocks[target]
*/
      __pyx_t_4 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 471, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_arange); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 471, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_3 = PyObject_Length(__pyx_v_sentence); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 471, __pyx_L1_error)
      __pyx_t_9 = PyLong_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 471, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
        assert(__pyx_t_4);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
        __pyx_t_10 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_9};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 471, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      }
      __pyx_t_8 = PyNumber_Subtract(__pyx_t_5, __pyx_v_target); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 471, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF_SET(__pyx_v_target_dist_indices, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":470
 *             # if we are classifying arguments, pick the distance to the closest boundary
 *             # of the argument (beginning or end)
 *             if argument_blocks is None:             # <<<<<<<<<<<<<<
 *                 target_dist_indices = np.arange(len(sentence)) - target
 *             else:
*/
      goto __pyx_L6;
    }

    /* "nltkor/tag/libs/networkconv.pyx":473
 *                 target_dist_indices = np.arange(len(sentence)) - target
 *             else:
 *                 argument = argument_blocks[target]             # <<<<<<<<<<<<<<
 *                 #print(argument_blocks)
 *                 target_dist_indices = self.argument_distances(np.arange(len(sentence)), argument)
*/
    /*else*/ {
      __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_argument_blocks, __pyx_v_target); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 473, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_XDECREF_SET(__pyx_v_argument, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":475
 *                 argument = argument_blocks[target]
 *                 #print(argument_blocks)
 *                 target_dist_indices = self.argument_distances(np.arange(len(sentence)), argument)             # <<<<<<<<<<<<<<
 * 
 *             target_dist_values = self.target_convolution_lookup.take(target_dist_indices + self.target_dist_offset,
*/
      __pyx_t_5 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 475, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_arange); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 475, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_3 = PyObject_Length(__pyx_v_sentence); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 475, __pyx_L1_error)
      __pyx_t_9 = PyLong_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 475, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        assert(__pyx_t_5);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
        __pyx_t_10 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_9};
        __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 475, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self->__pyx_vtab)->argument_distances(__pyx_v_self, __pyx_t_8, __pyx_v_argument)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 475, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF_SET(__pyx_v_target_dist_indices, __pyx_t_4);
      __pyx_t_4 = 0;
    }
    __pyx_L6:;

    /* "nltkor/tag/libs/networkconv.pyx":477
 *                 target_dist_indices = self.argument_distances(np.arange(len(sentence)), argument)
 * 
 *             target_dist_values = self.target_convolution_lookup.take(target_dist_indices + self.target_dist_offset,             # <<<<<<<<<<<<<<
 *                                                                      0, mode='clip')
 * 
*/
    __pyx_t_8 = ((PyObject *)__pyx_v_self->target_convolution_lookup);
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyLong_From_int(__pyx_v_self->target_dist_offset); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 477, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_5 = PyNumber_Add(__pyx_v_target_dist_indices, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 477, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_10 = 0;
    {
      PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_8, __pyx_t_5, __pyx_mstate_global->__pyx_int_0};
      __pyx_t_9 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 477, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_n_u_clip, __pyx_t_9, __pyx_callargs+3, 0) < 0) __PYX_ERR(1, 477, __pyx_L1_error)
      __pyx_t_4 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_take, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 477, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_target_dist_values, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":480
 *                                                                      0, mode='clip')
 * 
 *             convolution_values = target_dist_values + input_and_pred_dist_values             # <<<<<<<<<<<<<<
 * 
 *             # now, find the maximum values
*/
    __pyx_t_4 = PyNumber_Add(__pyx_v_target_dist_values, ((PyObject *)__pyx_v_input_and_pred_dist_values)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 480, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 480, __pyx_L1_error)
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_convolution_values.rcbuffer->pybuffer);
      __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_convolution_values.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_4), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_11 < 0)) {
        PyErr_Fetch(&__pyx_t_14, &__pyx_t_13, &__pyx_t_12);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_convolution_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_convolution_values, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_14, __pyx_t_13, __pyx_t_12);
        }
        __pyx_t_14 = __pyx_t_13 = __pyx_t_12 = 0;
      }
      __pyx_pybuffernd_convolution_values.diminfo[0].strides = __pyx_pybuffernd_convolution_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_convolution_values.diminfo[0].shape = __pyx_pybuffernd_convolution_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_convolution_values.diminfo[1].strides = __pyx_pybuffernd_convolution_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_convolution_values.diminfo[1].shape = __pyx_pybuffernd_convolution_values.rcbuffer->pybuffer.shape[1];
      if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(1, 480, __pyx_L1_error)
    }
    __Pyx_XDECREF_SET(__pyx_v_convolution_values, ((PyArrayObject *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":483
 * 
 *             # now, find the maximum values
 *             if training:             # <<<<<<<<<<<<<<
 *                 self.max_indices[target] = convolution_values.argmax(0)
 *             self.hidden_values[target] = convolution_values.max(0)
*/
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_training); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 483, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "nltkor/tag/libs/networkconv.pyx":484
 *             # now, find the maximum values
 *             if training:
 *                 self.max_indices[target] = convolution_values.argmax(0)             # <<<<<<<<<<<<<<
 *             self.hidden_values[target] = convolution_values.max(0)
 * 
*/
      __pyx_t_9 = ((PyObject *)__pyx_v_convolution_values);
      __Pyx_INCREF(__pyx_t_9);
      __pyx_t_10 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_int_0};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_argmax, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 484, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->max_indices), __pyx_v_target, __pyx_t_4) < 0))) __PYX_ERR(1, 484, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":483
 * 
 *             # now, find the maximum values
 *             if training:             # <<<<<<<<<<<<<<
 *                 self.max_indices[target] = convolution_values.argmax(0)
 *             self.hidden_values[target] = convolution_values.max(0)
*/
    }

    /* "nltkor/tag/libs/networkconv.pyx":485
 *             if training:
 *                 self.max_indices[target] = convolution_values.argmax(0)
 *             self.hidden_values[target] = convolution_values.max(0)             # <<<<<<<<<<<<<<
 * 
 *         # apply the bias and proceed to the next layer
*/
    __pyx_t_9 = ((PyObject *)__pyx_v_convolution_values);
    __Pyx_INCREF(__pyx_t_9);
    __pyx_t_10 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_int_0};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_max, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 485, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->__pyx_base.hidden_values), __pyx_v_target, __pyx_t_4) < 0))) __PYX_ERR(1, 485, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":462
 *         input_and_pred_dist_values = pred_dist_values + self.convolution_lookup
 * 
 *         for target in range(self.num_targets):             # <<<<<<<<<<<<<<
 *             # loop over targets and add the weighted distance features to each token
 *             # this is necessary for the convolution layer
*/
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":488
 * 
 *         # apply the bias and proceed to the next layer
 *         self.hidden_values += self.hidden_bias             # <<<<<<<<<<<<<<
 * 
 *         if self.hidden2_weights is not None:
*/
  __pyx_t_7 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_self->__pyx_base.hidden_values), ((PyObject *)__pyx_v_self->__pyx_base.hidden_bias)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 488, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_7);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.hidden_values);
  __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.hidden_values);
  __pyx_v_self->__pyx_base.hidden_values = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":490
 *         self.hidden_values += self.hidden_bias
 * 
 *         if self.hidden2_weights is not None:             # <<<<<<<<<<<<<<
 *             self.hidden2_values = self.hidden_values.dot(self.hidden2_weights.T) + self.hidden2_bias
 * 
*/
  __pyx_t_2 = (((PyObject *)__pyx_v_self->hidden2_weights) != Py_None);
  if (__pyx_t_2) {

    /* "nltkor/tag/libs/networkconv.pyx":491
 * 
 *         if self.hidden2_weights is not None:
 *             self.hidden2_values = self.hidden_values.dot(self.hidden2_weights.T) + self.hidden2_bias             # <<<<<<<<<<<<<<
 * 
 *             if training:
*/
    __pyx_t_4 = ((PyObject *)__pyx_v_self->__pyx_base.hidden_values);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->hidden2_weights), __pyx_mstate_global->__pyx_n_u_T); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 491, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_9};
      __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_dot, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 491, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __pyx_t_9 = PyNumber_Add(__pyx_t_7, ((PyObject *)__pyx_v_self->hidden2_bias)); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 491, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 491, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_9);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden2_values);
    __Pyx_DECREF((PyObject *)__pyx_v_self->hidden2_values);
    __pyx_v_self->hidden2_values = ((PyArrayObject *)__pyx_t_9);
    __pyx_t_9 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":493
 *             self.hidden2_values = self.hidden_values.dot(self.hidden2_weights.T) + self.hidden2_bias
 * 
 *             if training:             # <<<<<<<<<<<<<<
 *                 self.hidden2_before_activation = self.hidden2_values.copy()
 * 
*/
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_training); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 493, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "nltkor/tag/libs/networkconv.pyx":494
 * 
 *             if training:
 *                 self.hidden2_before_activation = self.hidden2_values.copy()             # <<<<<<<<<<<<<<
 * 
 *             hardtanh(self.hidden2_values, inplace=True)
*/
      __pyx_t_7 = ((PyObject *)__pyx_v_self->hidden2_values);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_10 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
        __pyx_t_9 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 494, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
      }
      if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 494, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_9);
      __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden2_before_activation);
      __Pyx_DECREF((PyObject *)__pyx_v_self->hidden2_before_activation);
      __pyx_v_self->hidden2_before_activation = ((PyArrayObject *)__pyx_t_9);
      __pyx_t_9 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":493
 *             self.hidden2_values = self.hidden_values.dot(self.hidden2_weights.T) + self.hidden2_bias
 * 
 *             if training:             # <<<<<<<<<<<<<<
 *                 self.hidden2_before_activation = self.hidden2_values.copy()
 * 
*/
    }

    /* "nltkor/tag/libs/networkconv.pyx":496
 *                 self.hidden2_before_activation = self.hidden2_values.copy()
 * 
 *             hardtanh(self.hidden2_values, inplace=True)             # <<<<<<<<<<<<<<
 *         else:
 *             # apply non-linearity here
*/
    __pyx_t_9 = ((PyObject *)__pyx_v_self->hidden2_values);
    __Pyx_INCREF(__pyx_t_9);
    __pyx_t_16.__pyx_n = 1;
    __pyx_t_16.inplace = Py_True;
    __pyx_t_7 = __pyx_f_6nltkor_3tag_4libs_7network_hardtanh(((PyArrayObject *)__pyx_t_9), &__pyx_t_16); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":490
 *         self.hidden_values += self.hidden_bias
 * 
 *         if self.hidden2_weights is not None:             # <<<<<<<<<<<<<<
 *             self.hidden2_values = self.hidden_values.dot(self.hidden2_weights.T) + self.hidden2_bias
 * 
*/
    goto __pyx_L9;
  }

  /* "nltkor/tag/libs/networkconv.pyx":499
 *         else:
 *             # apply non-linearity here
 *             if training:             # <<<<<<<<<<<<<<
 *                 self.hidden_before_activation = self.hidden_values.copy()
 * 
*/
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_training); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 499, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "nltkor/tag/libs/networkconv.pyx":500
 *             # apply non-linearity here
 *             if training:
 *                 self.hidden_before_activation = self.hidden_values.copy()             # <<<<<<<<<<<<<<
 * 
 *             self.hidden2_values = self.hidden_values
*/
      __pyx_t_9 = ((PyObject *)__pyx_v_self->__pyx_base.hidden_values);
      __Pyx_INCREF(__pyx_t_9);
      __pyx_t_10 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
        __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 500, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 500, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_7);
      __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden_before_activation);
      __Pyx_DECREF((PyObject *)__pyx_v_self->hidden_before_activation);
      __pyx_v_self->hidden_before_activation = ((PyArrayObject *)__pyx_t_7);
      __pyx_t_7 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":499
 *         else:
 *             # apply non-linearity here
 *             if training:             # <<<<<<<<<<<<<<
 *                 self.hidden_before_activation = self.hidden_values.copy()
 * 
*/
    }

    /* "nltkor/tag/libs/networkconv.pyx":502
 *                 self.hidden_before_activation = self.hidden_values.copy()
 * 
 *             self.hidden2_values = self.hidden_values             # <<<<<<<<<<<<<<
 *             hardtanh(self.hidden_values, inplace=True)
 * 
*/
    __pyx_t_7 = ((PyObject *)__pyx_v_self->__pyx_base.hidden_values);
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden2_values);
    __Pyx_DECREF((PyObject *)__pyx_v_self->hidden2_values);
    __pyx_v_self->hidden2_values = ((PyArrayObject *)__pyx_t_7);
    __pyx_t_7 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":503
 * 
 *             self.hidden2_values = self.hidden_values
 *             hardtanh(self.hidden_values, inplace=True)             # <<<<<<<<<<<<<<
 * 
 *         scores = self.hidden2_values.dot(self.output_weights.T) + self.output_bias
*/
    __pyx_t_7 = ((PyObject *)__pyx_v_self->__pyx_base.hidden_values);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_16.__pyx_n = 1;
    __pyx_t_16.inplace = Py_True;
    __pyx_t_9 = __pyx_f_6nltkor_3tag_4libs_7network_hardtanh(((PyArrayObject *)__pyx_t_7), &__pyx_t_16); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __pyx_L9:;

  /* "nltkor/tag/libs/networkconv.pyx":505
 *             hardtanh(self.hidden_values, inplace=True)
 * 
 *         scores = self.hidden2_values.dot(self.output_weights.T) + self.output_bias             # <<<<<<<<<<<<<<
 * 
 *         return scores
*/
  __pyx_t_7 = ((PyObject *)__pyx_v_self->hidden2_values);
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.output_weights), __pyx_mstate_global->__pyx_n_u_T); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_4};
    __pyx_t_9 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_dot, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
  }
  __pyx_t_4 = PyNumber_Add(__pyx_t_9, ((PyObject *)__pyx_v_self->__pyx_base.output_bias)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 505, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_scores.rcbuffer->pybuffer);
    __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_scores.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_4), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_11 < 0)) {
      PyErr_Fetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_scores.rcbuffer->pybuffer, (PyObject*)__pyx_v_scores, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      }
      __pyx_t_12 = __pyx_t_13 = __pyx_t_14 = 0;
    }
    __pyx_pybuffernd_scores.diminfo[0].strides = __pyx_pybuffernd_scores.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_scores.diminfo[0].shape = __pyx_pybuffernd_scores.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_scores.diminfo[1].strides = __pyx_pybuffernd_scores.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_scores.diminfo[1].shape = __pyx_pybuffernd_scores.rcbuffer->pybuffer.shape[1];
    if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(1, 505, __pyx_L1_error)
  }
  __pyx_v_scores = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":507
 *         scores = self.hidden2_values.dot(self.output_weights.T) + self.output_bias
 * 
 *         return scores             # <<<<<<<<<<<<<<
 * 
 *     def _pre_tagging_setup(self, np.ndarray sentence, bool training):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_scores);
  __pyx_r = ((PyObject *)__pyx_v_scores);
  __Pyx_TraceReturnValue(__pyx_r, 200, 0, __PYX_ERR(1, 507, __pyx_L1_error));
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkconv.pyx":421
 * 
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _sentence_convolution(self, sentence, predicate, argument_blocks=None,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_convolution_values.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_and_pred_dist_values.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_scores.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 421, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._sentence_convolution", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_convolution_values.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_and_pred_dist_values.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_scores.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_convolution_values);
  __Pyx_XDECREF((PyObject *)__pyx_v_scores);
  __Pyx_XDECREF((PyObject *)__pyx_v_input_and_pred_dist_values);
  __Pyx_XDECREF(__pyx_v_pred_dist_indices);
  __Pyx_XDECREF(__pyx_v_pred_dist_values);
  __Pyx_XDECREF(__pyx_v_target);
  __Pyx_XDECREF(__pyx_v_target_dist_indices);
  __Pyx_XDECREF(__pyx_v_argument);
  __Pyx_XDECREF(__pyx_v_target_dist_values);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":509
 *         return scores
 * 
 *     def _pre_tagging_setup(self, np.ndarray sentence, bool training):             # <<<<<<<<<<<<<<
 *         """
 *         Perform some initialization actions before the actual tagging.
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_31_pre_tagging_setup(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_30_pre_tagging_setup, "ConvolutionalNetwork._pre_tagging_setup(self, ndarray sentence, bool training)\nPerform some initialization actions before the actual tagging.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_31_pre_tagging_setup = {"_pre_tagging_setup", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_31_pre_tagging_setup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_30_pre_tagging_setup};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_31_pre_tagging_setup(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyArrayObject *__pyx_v_sentence = 0;
  PyLongObject *__pyx_v_training = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_pre_tagging_setup (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sentence,&__pyx_mstate_global->__pyx_n_u_training,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 509, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 509, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 509, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_pre_tagging_setup", 0) < 0) __PYX_ERR(1, 509, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_pre_tagging_setup", 1, 2, 2, i); __PYX_ERR(1, 509, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 509, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 509, __pyx_L3_error)
    }
    __pyx_v_sentence = ((PyArrayObject *)values[0]);
    __pyx_v_training = ((PyLongObject *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_pre_tagging_setup", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 509, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._pre_tagging_setup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sentence), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "sentence", 0))) __PYX_ERR(1, 509, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_training), __pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool, 1, "training", 0))) __PYX_ERR(1, 509, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_30_pre_tagging_setup(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v_sentence, __pyx_v_training);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_30_pre_tagging_setup(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyArrayObject *__pyx_v_sentence, PyLongObject *__pyx_v_training) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[98]))
  __Pyx_RefNannySetupContext("_pre_tagging_setup", 0);
  __Pyx_TraceStartFunc("_pre_tagging_setup", __pyx_f[1], 509, 0, 0, 0, __PYX_ERR(1, 509, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":513
 *         Perform some initialization actions before the actual tagging.
 *         """
 *         if training:             # <<<<<<<<<<<<<<
 *             # this table will store the values of the neurons for each input token
 *             # they will be needed during weight adjustments
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_training)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 513, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "nltkor/tag/libs/networkconv.pyx":516
 *             # this table will store the values of the neurons for each input token
 *             # they will be needed during weight adjustments
 *             self.input_sent_values = np.empty((len(sentence), self.input_size))             # <<<<<<<<<<<<<<
 * 
 *         # store the convolution values to save time
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = PyObject_Length(((PyObject *)__pyx_v_sentence)); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(1, 516, __pyx_L1_error)
    __pyx_t_4 = PyLong_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.input_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4) != (0)) __PYX_ERR(1, 516, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_7);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7) != (0)) __PYX_ERR(1, 516, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_7 = 0;
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_8};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 516, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 516, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.input_sent_values);
    __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.input_sent_values);
    __pyx_v_self->__pyx_base.input_sent_values = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":513
 *         Perform some initialization actions before the actual tagging.
 *         """
 *         if training:             # <<<<<<<<<<<<<<
 *             # this table will store the values of the neurons for each input token
 *             # they will be needed during weight adjustments
*/
  }

  /* "nltkor/tag/libs/networkconv.pyx":519
 * 
 *         # store the convolution values to save time
 *         self._create_convolution_lookup(sentence, training)             # <<<<<<<<<<<<<<
 * 
 *         if self.target_dist_lookup is None: self._create_target_lookup()
*/
  __pyx_t_5 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_9 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_5, ((PyObject *)__pyx_v_sentence), ((PyObject *)__pyx_v_training)};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_create_convolution_lookup, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 519, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":521
 *         self._create_convolution_lookup(sentence, training)
 * 
 *         if self.target_dist_lookup is None: self._create_target_lookup()             # <<<<<<<<<<<<<<
 *         if self.pred_dist_lookup is None: self._create_pred_lookup()
 * 
*/
  __pyx_t_1 = (((PyObject *)__pyx_v_self->target_dist_lookup) == Py_None);
  if (__pyx_t_1) {
    __pyx_t_5 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_create_target_lookup, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 521, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "nltkor/tag/libs/networkconv.pyx":522
 * 
 *         if self.target_dist_lookup is None: self._create_target_lookup()
 *         if self.pred_dist_lookup is None: self._create_pred_lookup()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = (((PyObject *)__pyx_v_self->pred_dist_lookup) == Py_None);
  if (__pyx_t_1) {
    __pyx_t_5 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_create_pred_lookup, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 522, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "nltkor/tag/libs/networkconv.pyx":509
 *         return scores
 * 
 *     def _pre_tagging_setup(self, np.ndarray sentence, bool training):             # <<<<<<<<<<<<<<
 *         """
 *         Perform some initialization actions before the actual tagging.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 509, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 509, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._pre_tagging_setup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":525
 * 
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _tag_sentence(self, np.ndarray sentence, np.ndarray predicates,
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_33_tag_sentence(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_32_tag_sentence, "ConvolutionalNetwork._tag_sentence(self, ndarray sentence, ndarray predicates, list tags=None, list argument_blocks=None, bool allow_repeats=True, bool logprob=False)\nRuns the network for every predicate in the sentence.\nRefer to the Network class for more information.\n\n:param tags: this is a list rather than a numpy array because in\n    argument classification, each predicate may have a differente number\n    of arguments.\n:param argument_blocks: (used only in SRL argument classification) a list\n    with the starting and end positions of all delimited arguments (one for \n    each predicate)\n:param predicates: a numpy array with the indices of the predicates in the sentence.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_33_tag_sentence = {"_tag_sentence", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_33_tag_sentence, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_32_tag_sentence};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_33_tag_sentence(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyArrayObject *__pyx_v_sentence = 0;
  PyArrayObject *__pyx_v_predicates = 0;
  PyObject *__pyx_v_tags = 0;
  PyObject *__pyx_v_argument_blocks = 0;
  PyLongObject *__pyx_v_allow_repeats = 0;
  PyLongObject *__pyx_v_logprob = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_tag_sentence (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sentence,&__pyx_mstate_global->__pyx_n_u_predicates,&__pyx_mstate_global->__pyx_n_u_tags,&__pyx_mstate_global->__pyx_n_u_argument_blocks,&__pyx_mstate_global->__pyx_n_u_allow_repeats,&__pyx_mstate_global->__pyx_n_u_logprob,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 525, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(1, 525, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 525, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 525, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 525, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 525, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 525, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_tag_sentence", 0) < 0) __PYX_ERR(1, 525, __pyx_L3_error)

      /* "nltkor/tag/libs/networkconv.pyx":528
 *     @cython.wraparound(False)
 *     def _tag_sentence(self, np.ndarray sentence, np.ndarray predicates,
 *                       list tags=None, list argument_blocks=None,             # <<<<<<<<<<<<<<
 *                       bool allow_repeats=True, bool logprob=False):
 *         """
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)Py_None));

      /* "nltkor/tag/libs/networkconv.pyx":529
 *     def _tag_sentence(self, np.ndarray sentence, np.ndarray predicates,
 *                       list tags=None, list argument_blocks=None,
 *                       bool allow_repeats=True, bool logprob=False):             # <<<<<<<<<<<<<<
 *         """
 *         Runs the network for every predicate in the sentence.
*/
      if (!values[4]) values[4] = __Pyx_NewRef((PyObject *)((PyLongObject *)Py_True));
      if (!values[5]) values[5] = __Pyx_NewRef((PyObject *)((PyLongObject *)Py_False));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_tag_sentence", 0, 2, 6, i); __PYX_ERR(1, 525, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(1, 525, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 525, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 525, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 525, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 525, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 525, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "nltkor/tag/libs/networkconv.pyx":528
 *     @cython.wraparound(False)
 *     def _tag_sentence(self, np.ndarray sentence, np.ndarray predicates,
 *                       list tags=None, list argument_blocks=None,             # <<<<<<<<<<<<<<
 *                       bool allow_repeats=True, bool logprob=False):
 *         """
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)Py_None));

      /* "nltkor/tag/libs/networkconv.pyx":529
 *     def _tag_sentence(self, np.ndarray sentence, np.ndarray predicates,
 *                       list tags=None, list argument_blocks=None,
 *                       bool allow_repeats=True, bool logprob=False):             # <<<<<<<<<<<<<<
 *         """
 *         Runs the network for every predicate in the sentence.
*/
      if (!values[4]) values[4] = __Pyx_NewRef((PyObject *)((PyLongObject *)Py_True));
      if (!values[5]) values[5] = __Pyx_NewRef((PyObject *)((PyLongObject *)Py_False));
    }
    __pyx_v_sentence = ((PyArrayObject *)values[0]);
    __pyx_v_predicates = ((PyArrayObject *)values[1]);
    __pyx_v_tags = ((PyObject*)values[2]);
    __pyx_v_argument_blocks = ((PyObject*)values[3]);
    __pyx_v_allow_repeats = ((PyLongObject *)values[4]);
    __pyx_v_logprob = ((PyLongObject *)values[5]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_tag_sentence", 0, 2, 6, __pyx_nargs); __PYX_ERR(1, 525, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._tag_sentence", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sentence), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "sentence", 0))) __PYX_ERR(1, 527, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_predicates), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "predicates", 0))) __PYX_ERR(1, 527, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tags), (&PyList_Type), 1, "tags", 1))) __PYX_ERR(1, 528, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_argument_blocks), (&PyList_Type), 1, "argument_blocks", 1))) __PYX_ERR(1, 528, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_allow_repeats), __pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool, 1, "allow_repeats", 0))) __PYX_ERR(1, 529, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_logprob), __pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool, 1, "logprob", 0))) __PYX_ERR(1, 529, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_32_tag_sentence(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v_sentence, __pyx_v_predicates, __pyx_v_tags, __pyx_v_argument_blocks, __pyx_v_allow_repeats, __pyx_v_logprob);

  /* "nltkor/tag/libs/networkconv.pyx":525
 * 
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _tag_sentence(self, np.ndarray sentence, np.ndarray predicates,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_32_tag_sentence(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyArrayObject *__pyx_v_sentence, PyArrayObject *__pyx_v_predicates, PyObject *__pyx_v_tags, PyObject *__pyx_v_argument_blocks, PyLongObject *__pyx_v_allow_repeats, PyLongObject *__pyx_v_logprob) {
  PyObject *__pyx_v_answer = NULL;
  PyObject *__pyx_v_training = NULL;
  PyArrayObject *__pyx_v_token_scores = 0;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_predicate = NULL;
  PyObject *__pyx_v_pred_arguments = NULL;
  PyObject *__pyx_v_pred_answer = NULL;
  PyObject *__pyx_v_pred_tags = NULL;
  PyObject *__pyx_v_all_scores = NULL;
  Py_ssize_t __pyx_v_last_token;
  PyObject *__pyx_v_logadd = NULL;
  PyObject *__pyx_v_confidence = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_token_scores;
  __Pyx_Buffer __pyx_pybuffer_token_scores;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  Py_ssize_t __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  int __pyx_t_23;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[99]))
  __Pyx_RefNannySetupContext("_tag_sentence", 0);
  __Pyx_TraceStartFunc("_tag_sentence", __pyx_f[1], 525, 0, 0, 0, __PYX_ERR(1, 525, __pyx_L1_error));
  __pyx_pybuffer_token_scores.pybuffer.buf = NULL;
  __pyx_pybuffer_token_scores.refcount = 0;
  __pyx_pybuffernd_token_scores.data = NULL;
  __pyx_pybuffernd_token_scores.rcbuffer = &__pyx_pybuffer_token_scores;

  /* "nltkor/tag/libs/networkconv.pyx":542
 *         :param predicates: a numpy array with the indices of the predicates in the sentence.
 *         """
 *         answer = []             # <<<<<<<<<<<<<<
 *         training = tags is not None
 *         self._pre_tagging_setup(sentence, training)
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_answer = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":543
 *         """
 *         answer = []
 *         training = tags is not None             # <<<<<<<<<<<<<<
 *         self._pre_tagging_setup(sentence, training)
 *         cdef np.ndarray[FLOAT_t, ndim=2] token_scores
*/
  __pyx_t_2 = (__pyx_v_tags != ((PyObject*)Py_None));
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_training = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":544
 *         answer = []
 *         training = tags is not None
 *         self._pre_tagging_setup(sentence, training)             # <<<<<<<<<<<<<<
 *         cdef np.ndarray[FLOAT_t, ndim=2] token_scores
 * 
*/
  __pyx_t_3 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_3, ((PyObject *)__pyx_v_sentence), __pyx_v_training};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_pre_tagging_setup, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":547
 *         cdef np.ndarray[FLOAT_t, ndim=2] token_scores
 * 
 *         for i, predicate in enumerate(predicates):             # <<<<<<<<<<<<<<
 *             pred_arguments = None if not self.only_classify else argument_blocks[i]
 *             pred_arguments = argument_blocks[i]
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_t_1 = __pyx_mstate_global->__pyx_int_0;
  if (likely(PyList_CheckExact(((PyObject *)__pyx_v_predicates))) || PyTuple_CheckExact(((PyObject *)__pyx_v_predicates))) {
    __pyx_t_3 = ((PyObject *)__pyx_v_predicates); __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(((PyObject *)__pyx_v_predicates)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 547, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 547, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 547, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_5);
        ++__pyx_t_5;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 547, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5));
        #else
        __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5);
        #endif
        ++__pyx_t_5;
      }
      if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 547, __pyx_L1_error)
    } else {
      __pyx_t_7 = __pyx_t_6(__pyx_t_3);
      if (unlikely(!__pyx_t_7)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 547, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_XDECREF_SET(__pyx_v_predicate, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_7 = __Pyx_PyLong_AddObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 547, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":548
 * 
 *         for i, predicate in enumerate(predicates):
 *             pred_arguments = None if not self.only_classify else argument_blocks[i]             # <<<<<<<<<<<<<<
 *             pred_arguments = argument_blocks[i]
 * 
*/
    __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->only_classify)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 548, __pyx_L1_error)
    __pyx_t_8 = (!__pyx_t_2);
    if (__pyx_t_8) {
      __Pyx_INCREF(Py_None);
      __pyx_t_7 = Py_None;
    } else {
      if (unlikely(__pyx_v_argument_blocks == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(1, 548, __pyx_L1_error)
      }
      __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_argument_blocks, __pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 548, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_7 = __pyx_t_9;
      __pyx_t_9 = 0;
    }
    __Pyx_XDECREF_SET(__pyx_v_pred_arguments, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":549
 *         for i, predicate in enumerate(predicates):
 *             pred_arguments = None if not self.only_classify else argument_blocks[i]
 *             pred_arguments = argument_blocks[i]             # <<<<<<<<<<<<<<
 * 
 *             token_scores = self._sentence_convolution(sentence, predicate, pred_arguments, training)
*/
    if (unlikely(__pyx_v_argument_blocks == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(1, 549, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_argument_blocks, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF_SET(__pyx_v_pred_arguments, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":551
 *             pred_arguments = argument_blocks[i]
 * 
 *             token_scores = self._sentence_convolution(sentence, predicate, pred_arguments, training)             # <<<<<<<<<<<<<<
 *             pred_answer = self._viterbi(token_scores, allow_repeats)
 * 
*/
    __pyx_t_9 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_9);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_9, ((PyObject *)__pyx_v_sentence), __pyx_v_predicate, __pyx_v_pred_arguments, __pyx_v_training};
      __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_sentence_convolution, __pyx_callargs+__pyx_t_4, (5-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 551, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 551, __pyx_L1_error)
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_token_scores.rcbuffer->pybuffer);
      __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_token_scores.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_7), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_10 < 0)) {
        PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_token_scores.rcbuffer->pybuffer, (PyObject*)__pyx_v_token_scores, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
        }
        __pyx_t_11 = __pyx_t_12 = __pyx_t_13 = 0;
      }
      __pyx_pybuffernd_token_scores.diminfo[0].strides = __pyx_pybuffernd_token_scores.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_token_scores.diminfo[0].shape = __pyx_pybuffernd_token_scores.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_token_scores.diminfo[1].strides = __pyx_pybuffernd_token_scores.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_token_scores.diminfo[1].shape = __pyx_pybuffernd_token_scores.rcbuffer->pybuffer.shape[1];
      if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(1, 551, __pyx_L1_error)
    }
    __Pyx_XDECREF_SET(__pyx_v_token_scores, ((PyArrayObject *)__pyx_t_7));
    __pyx_t_7 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":552
 * 
 *             token_scores = self._sentence_convolution(sentence, predicate, pred_arguments, training)
 *             pred_answer = self._viterbi(token_scores, allow_repeats)             # <<<<<<<<<<<<<<
 * 
 *             if training:
*/
    __pyx_t_9 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_9);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_9, ((PyObject *)__pyx_v_token_scores), ((PyObject *)__pyx_v_allow_repeats)};
      __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_viterbi, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 552, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_XDECREF_SET(__pyx_v_pred_answer, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":554
 *             pred_answer = self._viterbi(token_scores, allow_repeats)
 * 
 *             if training:             # <<<<<<<<<<<<<<
 *                 pred_tags = tags[i]
 *                 if self._calculate_gradients(pred_tags, token_scores):
*/
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_training); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 554, __pyx_L1_error)
    if (__pyx_t_8) {

      /* "nltkor/tag/libs/networkconv.pyx":555
 * 
 *             if training:
 *                 pred_tags = tags[i]             # <<<<<<<<<<<<<<
 *                 if self._calculate_gradients(pred_tags, token_scores):
 *                     self._backpropagate()
*/
      if (unlikely(__pyx_v_tags == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(1, 555, __pyx_L1_error)
      }
      __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_tags, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 555, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_v_pred_tags, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":556
 *             if training:
 *                 pred_tags = tags[i]
 *                 if self._calculate_gradients(pred_tags, token_scores):             # <<<<<<<<<<<<<<
 *                     self._backpropagate()
 *                     self._calculate_input_deltas(sentence, predicate, pred_arguments)
*/
      __pyx_t_9 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_9);
      __pyx_t_4 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_v_pred_tags, ((PyObject *)__pyx_v_token_scores)};
        __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_calculate_gradients, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 556, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 556, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_8) {

        /* "nltkor/tag/libs/networkconv.pyx":557
 *                 pred_tags = tags[i]
 *                 if self._calculate_gradients(pred_tags, token_scores):
 *                     self._backpropagate()             # <<<<<<<<<<<<<<
 *                     self._calculate_input_deltas(sentence, predicate, pred_arguments)
 *                     self._adjust_weights(predicate, pred_arguments)
*/
        __pyx_t_9 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_4 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
          __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_backpropagate, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 557, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "nltkor/tag/libs/networkconv.pyx":558
 *                 if self._calculate_gradients(pred_tags, token_scores):
 *                     self._backpropagate()
 *                     self._calculate_input_deltas(sentence, predicate, pred_arguments)             # <<<<<<<<<<<<<<
 *                     self._adjust_weights(predicate, pred_arguments)
 *                     self._adjust_features(sentence, predicate)
*/
        __pyx_t_9 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_4 = 0;
        {
          PyObject *__pyx_callargs[4] = {__pyx_t_9, ((PyObject *)__pyx_v_sentence), __pyx_v_predicate, __pyx_v_pred_arguments};
          __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_calculate_input_deltas, __pyx_callargs+__pyx_t_4, (4-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 558, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "nltkor/tag/libs/networkconv.pyx":559
 *                     self._backpropagate()
 *                     self._calculate_input_deltas(sentence, predicate, pred_arguments)
 *                     self._adjust_weights(predicate, pred_arguments)             # <<<<<<<<<<<<<<
 *                     self._adjust_features(sentence, predicate)
 * 
*/
        __pyx_t_9 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_4 = 0;
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_v_predicate, __pyx_v_pred_arguments};
          __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_adjust_weights, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 559, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "nltkor/tag/libs/networkconv.pyx":560
 *                     self._calculate_input_deltas(sentence, predicate, pred_arguments)
 *                     self._adjust_weights(predicate, pred_arguments)
 *                     self._adjust_features(sentence, predicate)             # <<<<<<<<<<<<<<
 * 
 *             if logprob:
*/
        __pyx_t_9 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_4 = 0;
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_9, ((PyObject *)__pyx_v_sentence), __pyx_v_predicate};
          __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_adjust_features, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 560, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "nltkor/tag/libs/networkconv.pyx":556
 *             if training:
 *                 pred_tags = tags[i]
 *                 if self._calculate_gradients(pred_tags, token_scores):             # <<<<<<<<<<<<<<
 *                     self._backpropagate()
 *                     self._calculate_input_deltas(sentence, predicate, pred_arguments)
*/
      }

      /* "nltkor/tag/libs/networkconv.pyx":554
 *             pred_answer = self._viterbi(token_scores, allow_repeats)
 * 
 *             if training:             # <<<<<<<<<<<<<<
 *                 pred_tags = tags[i]
 *                 if self._calculate_gradients(pred_tags, token_scores):
*/
    }

    /* "nltkor/tag/libs/networkconv.pyx":562
 *                     self._adjust_features(sentence, predicate)
 * 
 *             if logprob:             # <<<<<<<<<<<<<<
 *                 if self.only_classify:
 *                     raise NotImplementedError('Confidence measure not implemented for argument classifying')
*/
    __pyx_t_8 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_logprob)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 562, __pyx_L1_error)
    if (__pyx_t_8) {

      /* "nltkor/tag/libs/networkconv.pyx":563
 * 
 *             if logprob:
 *                 if self.only_classify:             # <<<<<<<<<<<<<<
 *                     raise NotImplementedError('Confidence measure not implemented for argument classifying')
 * 
*/
      __pyx_t_8 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->only_classify)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 563, __pyx_L1_error)
      if (unlikely(__pyx_t_8)) {

        /* "nltkor/tag/libs/networkconv.pyx":564
 *             if logprob:
 *                 if self.only_classify:
 *                     raise NotImplementedError('Confidence measure not implemented for argument classifying')             # <<<<<<<<<<<<<<
 * 
 *                 all_scores = self._calculate_all_scores(token_scores)
*/
        __pyx_t_9 = NULL;
        __Pyx_INCREF(__pyx_builtin_NotImplementedError);
        __pyx_t_14 = __pyx_builtin_NotImplementedError; 
        __pyx_t_4 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_Confidence_measure_not_implement};
          __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 564, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
        }
        __Pyx_Raise(__pyx_t_7, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __PYX_ERR(1, 564, __pyx_L1_error)

        /* "nltkor/tag/libs/networkconv.pyx":563
 * 
 *             if logprob:
 *                 if self.only_classify:             # <<<<<<<<<<<<<<
 *                     raise NotImplementedError('Confidence measure not implemented for argument classifying')
 * 
*/
      }

      /* "nltkor/tag/libs/networkconv.pyx":566
 *                     raise NotImplementedError('Confidence measure not implemented for argument classifying')
 * 
 *                 all_scores = self._calculate_all_scores(token_scores)             # <<<<<<<<<<<<<<
 *                 last_token = len(sentence) - 1
 *                 logadd = np.log(np.sum(np.exp(all_scores[last_token])))
*/
      __pyx_t_14 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_14);
      __pyx_t_4 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_14, ((PyObject *)__pyx_v_token_scores)};
        __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_calculate_all_scores, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 566, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_v_all_scores, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":567
 * 
 *                 all_scores = self._calculate_all_scores(token_scores)
 *                 last_token = len(sentence) - 1             # <<<<<<<<<<<<<<
 *                 logadd = np.log(np.sum(np.exp(all_scores[last_token])))
 *                 confidence = self.answer_score - logadd
*/
      __pyx_t_15 = PyObject_Length(((PyObject *)__pyx_v_sentence)); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(1, 567, __pyx_L1_error)
      __pyx_v_last_token = (__pyx_t_15 - 1);

      /* "nltkor/tag/libs/networkconv.pyx":568
 *                 all_scores = self._calculate_all_scores(token_scores)
 *                 last_token = len(sentence) - 1
 *                 logadd = np.log(np.sum(np.exp(all_scores[last_token])))             # <<<<<<<<<<<<<<
 *                 confidence = self.answer_score - logadd
 *                 pred_answer = (pred_answer, confidence)
*/
      __pyx_t_14 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_log); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_17 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_18);
      __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_sum); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
      __pyx_t_20 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_21)) __PYX_ERR(1, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_21);
      __pyx_t_22 = __Pyx_PyObject_GetAttrStr(__pyx_t_21, __pyx_mstate_global->__pyx_n_u_exp); if (unlikely(!__pyx_t_22)) __PYX_ERR(1, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_22);
      __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
      __pyx_t_21 = __Pyx_GetItemInt(__pyx_v_all_scores, __pyx_v_last_token, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_21)) __PYX_ERR(1, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_21);
      __pyx_t_4 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_22))) {
        __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_22);
        assert(__pyx_t_20);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_22);
        __Pyx_INCREF(__pyx_t_20);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_22, __pyx__function);
        __pyx_t_4 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_20, __pyx_t_21};
        __pyx_t_18 = __Pyx_PyObject_FastCall(__pyx_t_22, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
        __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
        if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 568, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_18);
      }
      __pyx_t_4 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_19))) {
        __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_19);
        assert(__pyx_t_17);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_19);
        __Pyx_INCREF(__pyx_t_17);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_19, __pyx__function);
        __pyx_t_4 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_17, __pyx_t_18};
        __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_19, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
        __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 568, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
      }
      __pyx_t_4 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_16))) {
        __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_16);
        assert(__pyx_t_14);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_16);
        __Pyx_INCREF(__pyx_t_14);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_16, __pyx__function);
        __pyx_t_4 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_9};
        __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 568, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_v_logadd, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":569
 *                 last_token = len(sentence) - 1
 *                 logadd = np.log(np.sum(np.exp(all_scores[last_token])))
 *                 confidence = self.answer_score - logadd             # <<<<<<<<<<<<<<
 *                 pred_answer = (pred_answer, confidence)
 * 
*/
      __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.answer_score); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 569, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_16 = PyNumber_Subtract(__pyx_t_7, __pyx_v_logadd); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 569, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF_SET(__pyx_v_confidence, __pyx_t_16);
      __pyx_t_16 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":570
 *                 logadd = np.log(np.sum(np.exp(all_scores[last_token])))
 *                 confidence = self.answer_score - logadd
 *                 pred_answer = (pred_answer, confidence)             # <<<<<<<<<<<<<<
 * 
 *             answer.append(pred_answer)
*/
      __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 570, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_INCREF(__pyx_v_pred_answer);
      __Pyx_GIVEREF(__pyx_v_pred_answer);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_v_pred_answer) != (0)) __PYX_ERR(1, 570, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_confidence);
      __Pyx_GIVEREF(__pyx_v_confidence);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_v_confidence) != (0)) __PYX_ERR(1, 570, __pyx_L1_error);
      __Pyx_DECREF_SET(__pyx_v_pred_answer, __pyx_t_16);
      __pyx_t_16 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":562
 *                     self._adjust_features(sentence, predicate)
 * 
 *             if logprob:             # <<<<<<<<<<<<<<
 *                 if self.only_classify:
 *                     raise NotImplementedError('Confidence measure not implemented for argument classifying')
*/
    }

    /* "nltkor/tag/libs/networkconv.pyx":572
 *                 pred_answer = (pred_answer, confidence)
 * 
 *             answer.append(pred_answer)             # <<<<<<<<<<<<<<
 * 
 *         return answer
*/
    __pyx_t_23 = __Pyx_PyList_Append(__pyx_v_answer, __pyx_v_pred_answer); if (unlikely(__pyx_t_23 == ((int)-1))) __PYX_ERR(1, 572, __pyx_L1_error)

    /* "nltkor/tag/libs/networkconv.pyx":547
 *         cdef np.ndarray[FLOAT_t, ndim=2] token_scores
 * 
 *         for i, predicate in enumerate(predicates):             # <<<<<<<<<<<<<<
 *             pred_arguments = None if not self.only_classify else argument_blocks[i]
 *             pred_arguments = argument_blocks[i]
*/
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":574
 *             answer.append(pred_answer)
 * 
 *         return answer             # <<<<<<<<<<<<<<
 * 
 *     def _validate(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_answer);
  __pyx_r = __pyx_v_answer;
  __Pyx_TraceReturnValue(__pyx_r, 124, 0, __PYX_ERR(1, 574, __pyx_L1_error));
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkconv.pyx":525
 * 
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _tag_sentence(self, np.ndarray sentence, np.ndarray predicates,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_XDECREF(__pyx_t_21);
  __Pyx_XDECREF(__pyx_t_22);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_token_scores.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 525, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._tag_sentence", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_token_scores.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_answer);
  __Pyx_XDECREF(__pyx_v_training);
  __Pyx_XDECREF((PyObject *)__pyx_v_token_scores);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_predicate);
  __Pyx_XDECREF(__pyx_v_pred_arguments);
  __Pyx_XDECREF(__pyx_v_pred_answer);
  __Pyx_XDECREF(__pyx_v_pred_tags);
  __Pyx_XDECREF(__pyx_v_all_scores);
  __Pyx_XDECREF(__pyx_v_logadd);
  __Pyx_XDECREF(__pyx_v_confidence);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":576
 *         return answer
 * 
 *     def _validate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Evaluates the network performance, updating its hits count.
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_35_validate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_34_validate, "ConvolutionalNetwork._validate(self)\nEvaluates the network performance, updating its hits count.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_35_validate = {"_validate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_35_validate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_34_validate};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_35_validate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_validate (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_validate", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_validate", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_34_validate(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_34_validate(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_v_num_items = NULL;
  PyObject *__pyx_v_hits = NULL;
  PyObject *__pyx_v_i_args = NULL;
  PyObject *__pyx_v_sent_args = NULL;
  PyObject *__pyx_v_sent = NULL;
  PyObject *__pyx_v_sent_preds = NULL;
  PyObject *__pyx_v_sent_tags = NULL;
  PyObject *__pyx_v_answer = NULL;
  PyObject *__pyx_v_predicate_answer = NULL;
  PyObject *__pyx_v_predicate_tags = NULL;
  PyObject *__pyx_v_net_tag = NULL;
  PyObject *__pyx_v_gold_tag = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  Py_ssize_t __pyx_t_14;
  PyObject *(*__pyx_t_15)(PyObject *);
  PyObject *__pyx_t_16 = NULL;
  float __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[100]))
  __Pyx_RefNannySetupContext("_validate", 0);
  __Pyx_TraceStartFunc("_validate", __pyx_f[1], 576, 0, 0, 0, __PYX_ERR(1, 576, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":582
 *         # call it "item" instead of token because the same token may be counted
 *         # more than once (sentences with multiple predicates)
 *         num_items = 0             # <<<<<<<<<<<<<<
 *         hits = 0
 * 
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_v_num_items = __pyx_mstate_global->__pyx_int_0;

  /* "nltkor/tag/libs/networkconv.pyx":583
 *         # more than once (sentences with multiple predicates)
 *         num_items = 0
 *         hits = 0             # <<<<<<<<<<<<<<
 * 
 *         if self.validation_arguments is not None:
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_v_hits = __pyx_mstate_global->__pyx_int_0;

  /* "nltkor/tag/libs/networkconv.pyx":585
 *         hits = 0
 * 
 *         if self.validation_arguments is not None:             # <<<<<<<<<<<<<<
 *             i_args = iter(self.validation_arguments)
 *         else:
*/
  __pyx_t_1 = (__pyx_v_self->validation_arguments != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "nltkor/tag/libs/networkconv.pyx":586
 * 
 *         if self.validation_arguments is not None:
 *             i_args = iter(self.validation_arguments)             # <<<<<<<<<<<<<<
 *         else:
 *             sent_args = None
*/
    __pyx_t_2 = __pyx_v_self->validation_arguments;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 586, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_i_args = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":585
 *         hits = 0
 * 
 *         if self.validation_arguments is not None:             # <<<<<<<<<<<<<<
 *             i_args = iter(self.validation_arguments)
 *         else:
*/
    goto __pyx_L3;
  }

  /* "nltkor/tag/libs/networkconv.pyx":588
 *             i_args = iter(self.validation_arguments)
 *         else:
 *             sent_args = None             # <<<<<<<<<<<<<<
 * 
 *         for sent, sent_preds, sent_tags in zip(self.validation_sentences,
*/
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __pyx_v_sent_args = Py_None;
  }
  __pyx_L3:;

  /* "nltkor/tag/libs/networkconv.pyx":590
 *             sent_args = None
 * 
 *         for sent, sent_preds, sent_tags in zip(self.validation_sentences,             # <<<<<<<<<<<<<<
 *                                                 self.validation_predicates,
 *                                                 self.validation_tags):
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_builtin_zip);
  __pyx_t_4 = __pyx_builtin_zip; 

  /* "nltkor/tag/libs/networkconv.pyx":592
 *         for sent, sent_preds, sent_tags in zip(self.validation_sentences,
 *                                                 self.validation_predicates,
 *                                                 self.validation_tags):             # <<<<<<<<<<<<<<
 *             if self.validation_arguments is not None:
 *                 sent_args = next(i_args)
*/
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_self->__pyx_base.validation_sentences, __pyx_v_self->validation_predicates, __pyx_v_self->__pyx_base.validation_tags};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }

  /* "nltkor/tag/libs/networkconv.pyx":590
 *             sent_args = None
 * 
 *         for sent, sent_preds, sent_tags in zip(self.validation_sentences,             # <<<<<<<<<<<<<<
 *                                                 self.validation_predicates,
 *                                                 self.validation_tags):
*/
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4);
    __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 590, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 590, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_6);
        ++__pyx_t_6;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 590, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6));
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6);
        #endif
        ++__pyx_t_6;
      }
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 590, __pyx_L1_error)
    } else {
      __pyx_t_3 = __pyx_t_7(__pyx_t_4);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 590, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_3);
    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
      PyObject* sequence = __pyx_t_3;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(1, 590, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_8);
        __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2);
        __Pyx_INCREF(__pyx_t_9);
      } else {
        __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0);
        if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 590, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_2);
        __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1);
        if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 590, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_8);
        __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 2);
        if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 590, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_9);
      }
      #else
      __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 590, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 590, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 590, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 590, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10);
      index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      index = 1; __pyx_t_8 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_8);
      index = 2; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_9);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 3) < 0) __PYX_ERR(1, 590, __pyx_L1_error)
      __pyx_t_11 = NULL;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_11 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(1, 590, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_sent, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_sent_preds, __pyx_t_8);
    __pyx_t_8 = 0;
    __Pyx_XDECREF_SET(__pyx_v_sent_tags, __pyx_t_9);
    __pyx_t_9 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":593
 *                                                 self.validation_predicates,
 *                                                 self.validation_tags):
 *             if self.validation_arguments is not None:             # <<<<<<<<<<<<<<
 *                 sent_args = next(i_args)
 *                 #sent_args = i_args.next()
*/
    __pyx_t_1 = (__pyx_v_self->validation_arguments != ((PyObject*)Py_None));
    if (__pyx_t_1) {

      /* "nltkor/tag/libs/networkconv.pyx":594
 *                                                 self.validation_tags):
 *             if self.validation_arguments is not None:
 *                 sent_args = next(i_args)             # <<<<<<<<<<<<<<
 *                 #sent_args = i_args.next()
 * 
*/
      if (unlikely(!__pyx_v_i_args)) { __Pyx_RaiseUnboundLocalError("i_args"); __PYX_ERR(1, 594, __pyx_L1_error) }
      __pyx_t_3 = __Pyx_PyIter_Next(__pyx_v_i_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 594, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_sent_args, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":593
 *                                                 self.validation_predicates,
 *                                                 self.validation_tags):
 *             if self.validation_arguments is not None:             # <<<<<<<<<<<<<<
 *                 sent_args = next(i_args)
 *                 #sent_args = i_args.next()
*/
    }

    /* "nltkor/tag/libs/networkconv.pyx":597
 *                 #sent_args = i_args.next()
 * 
 *             answer = self._tag_sentence(sent, sent_preds, None, sent_args)             # <<<<<<<<<<<<<<
 *             for predicate_answer, predicate_tags in zip(answer, sent_tags):
 *                 for net_tag, gold_tag in zip(predicate_answer, predicate_tags):
*/
    __pyx_t_9 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_9);
    if (unlikely(!__pyx_v_sent_args)) { __Pyx_RaiseUnboundLocalError("sent_args"); __PYX_ERR(1, 597, __pyx_L1_error) }
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_9, __pyx_v_sent, __pyx_v_sent_preds, Py_None, __pyx_v_sent_args};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_tag_sentence, __pyx_callargs+__pyx_t_5, (5-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 597, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_answer, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":598
 * 
 *             answer = self._tag_sentence(sent, sent_preds, None, sent_args)
 *             for predicate_answer, predicate_tags in zip(answer, sent_tags):             # <<<<<<<<<<<<<<
 *                 for net_tag, gold_tag in zip(predicate_answer, predicate_tags):
 *                     if net_tag == gold_tag:
*/
    __pyx_t_9 = NULL;
    __Pyx_INCREF(__pyx_builtin_zip);
    __pyx_t_8 = __pyx_builtin_zip; 
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_v_answer, __pyx_v_sent_tags};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 598, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_8 = __pyx_t_3; __Pyx_INCREF(__pyx_t_8);
      __pyx_t_12 = 0;
      __pyx_t_13 = NULL;
    } else {
      __pyx_t_12 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 598, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 598, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_13)) {
        if (likely(PyList_CheckExact(__pyx_t_8))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 598, __pyx_L1_error)
            #endif
            if (__pyx_t_12 >= __pyx_temp) break;
          }
          __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_8, __pyx_t_12);
          ++__pyx_t_12;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 598, __pyx_L1_error)
            #endif
            if (__pyx_t_12 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_12));
          #else
          __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_12);
          #endif
          ++__pyx_t_12;
        }
        if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 598, __pyx_L1_error)
      } else {
        __pyx_t_3 = __pyx_t_13(__pyx_t_8);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 598, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_3);
      if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
        PyObject* sequence = __pyx_t_3;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(1, 598, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0);
          __Pyx_INCREF(__pyx_t_9);
          __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_2);
        } else {
          __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 0);
          if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 598, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_9);
          __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1);
          if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_2);
        }
        #else
        __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 598, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 598, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10);
        index = 0; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L11_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_9);
        index = 1; __pyx_t_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L11_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_2);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(1, 598, __pyx_L1_error)
        __pyx_t_11 = NULL;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L12_unpacking_done;
        __pyx_L11_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_11 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(1, 598, __pyx_L1_error)
        __pyx_L12_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_predicate_answer, __pyx_t_9);
      __pyx_t_9 = 0;
      __Pyx_XDECREF_SET(__pyx_v_predicate_tags, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":599
 *             answer = self._tag_sentence(sent, sent_preds, None, sent_args)
 *             for predicate_answer, predicate_tags in zip(answer, sent_tags):
 *                 for net_tag, gold_tag in zip(predicate_answer, predicate_tags):             # <<<<<<<<<<<<<<
 *                     if net_tag == gold_tag:
 *                         hits += 1
*/
      __pyx_t_2 = NULL;
      __Pyx_INCREF(__pyx_builtin_zip);
      __pyx_t_9 = __pyx_builtin_zip; 
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_predicate_answer, __pyx_v_predicate_tags};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 599, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
        __pyx_t_9 = __pyx_t_3; __Pyx_INCREF(__pyx_t_9);
        __pyx_t_14 = 0;
        __pyx_t_15 = NULL;
      } else {
        __pyx_t_14 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 599, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 599, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      for (;;) {
        if (likely(!__pyx_t_15)) {
          if (likely(PyList_CheckExact(__pyx_t_9))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 599, __pyx_L1_error)
              #endif
              if (__pyx_t_14 >= __pyx_temp) break;
            }
            __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_9, __pyx_t_14);
            ++__pyx_t_14;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 599, __pyx_L1_error)
              #endif
              if (__pyx_t_14 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_14));
            #else
            __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_14);
            #endif
            ++__pyx_t_14;
          }
          if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 599, __pyx_L1_error)
        } else {
          __pyx_t_3 = __pyx_t_15(__pyx_t_9);
          if (unlikely(!__pyx_t_3)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 599, __pyx_L1_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_3);
        if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
          PyObject* sequence = __pyx_t_3;
          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(1, 599, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
            __Pyx_INCREF(__pyx_t_2);
            __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1);
            __Pyx_INCREF(__pyx_t_10);
          } else {
            __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0);
            if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 599, __pyx_L1_error)
            __Pyx_XGOTREF(__pyx_t_2);
            __pyx_t_10 = __Pyx_PyList_GetItemRef(sequence, 1);
            if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 599, __pyx_L1_error)
            __Pyx_XGOTREF(__pyx_t_10);
          }
          #else
          __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 599, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 599, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_16 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 599, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_16);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_16);
          index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_16); if (unlikely(!__pyx_t_2)) goto __pyx_L15_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_2);
          index = 1; __pyx_t_10 = __pyx_t_11(__pyx_t_16); if (unlikely(!__pyx_t_10)) goto __pyx_L15_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_10);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_16), 2) < 0) __PYX_ERR(1, 599, __pyx_L1_error)
          __pyx_t_11 = NULL;
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          goto __pyx_L16_unpacking_done;
          __pyx_L15_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          __pyx_t_11 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(1, 599, __pyx_L1_error)
          __pyx_L16_unpacking_done:;
        }
        __Pyx_XDECREF_SET(__pyx_v_net_tag, __pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_XDECREF_SET(__pyx_v_gold_tag, __pyx_t_10);
        __pyx_t_10 = 0;

        /* "nltkor/tag/libs/networkconv.pyx":600
 *             for predicate_answer, predicate_tags in zip(answer, sent_tags):
 *                 for net_tag, gold_tag in zip(predicate_answer, predicate_tags):
 *                     if net_tag == gold_tag:             # <<<<<<<<<<<<<<
 *                         hits += 1
 * 
*/
        __pyx_t_3 = PyObject_RichCompare(__pyx_v_net_tag, __pyx_v_gold_tag, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 600, __pyx_L1_error)
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 600, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (__pyx_t_1) {

          /* "nltkor/tag/libs/networkconv.pyx":601
 *                 for net_tag, gold_tag in zip(predicate_answer, predicate_tags):
 *                     if net_tag == gold_tag:
 *                         hits += 1             # <<<<<<<<<<<<<<
 * 
 *                 num_items += len(predicate_answer)
*/
          __pyx_t_3 = __Pyx_PyLong_AddObjC(__pyx_v_hits, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 601, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF_SET(__pyx_v_hits, __pyx_t_3);
          __pyx_t_3 = 0;

          /* "nltkor/tag/libs/networkconv.pyx":600
 *             for predicate_answer, predicate_tags in zip(answer, sent_tags):
 *                 for net_tag, gold_tag in zip(predicate_answer, predicate_tags):
 *                     if net_tag == gold_tag:             # <<<<<<<<<<<<<<
 *                         hits += 1
 * 
*/
        }

        /* "nltkor/tag/libs/networkconv.pyx":599
 *             answer = self._tag_sentence(sent, sent_preds, None, sent_args)
 *             for predicate_answer, predicate_tags in zip(answer, sent_tags):
 *                 for net_tag, gold_tag in zip(predicate_answer, predicate_tags):             # <<<<<<<<<<<<<<
 *                     if net_tag == gold_tag:
 *                         hits += 1
*/
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":603
 *                         hits += 1
 * 
 *                 num_items += len(predicate_answer)             # <<<<<<<<<<<<<<
 * 
 *         self.accuracy = float(hits) / num_items
*/
      __pyx_t_14 = PyObject_Length(__pyx_v_predicate_answer); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(1, 603, __pyx_L1_error)
      __pyx_t_9 = PyLong_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 603, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_num_items, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 603, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF_SET(__pyx_v_num_items, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":598
 * 
 *             answer = self._tag_sentence(sent, sent_preds, None, sent_args)
 *             for predicate_answer, predicate_tags in zip(answer, sent_tags):             # <<<<<<<<<<<<<<
 *                 for net_tag, gold_tag in zip(predicate_answer, predicate_tags):
 *                     if net_tag == gold_tag:
*/
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":590
 *             sent_args = None
 * 
 *         for sent, sent_preds, sent_tags in zip(self.validation_sentences,             # <<<<<<<<<<<<<<
 *                                                 self.validation_predicates,
 *                                                 self.validation_tags):
*/
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":605
 *                 num_items += len(predicate_answer)
 * 
 *         self.accuracy = float(hits) / num_items             # <<<<<<<<<<<<<<
 *         # normalize error
 *         self.error /= num_items
*/
  __pyx_t_4 = __Pyx_PyNumber_Float(__pyx_v_hits); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_v_num_items); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_17 = __Pyx_PyFloat_AsFloat(__pyx_t_8); if (unlikely((__pyx_t_17 == (float)-1) && PyErr_Occurred())) __PYX_ERR(1, 605, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_v_self->__pyx_base.accuracy = __pyx_t_17;

  /* "nltkor/tag/libs/networkconv.pyx":607
 *         self.accuracy = float(hits) / num_items
 *         # normalize error
 *         self.error /= num_items             # <<<<<<<<<<<<<<
 * 
 *     def _calculate_gradients(self, tags, scores):
*/
  __pyx_t_8 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.error); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = __Pyx_PyNumber_InPlaceDivide(__pyx_t_8, __pyx_v_num_items); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_17 = __Pyx_PyFloat_AsFloat(__pyx_t_4); if (unlikely((__pyx_t_17 == (float)-1) && PyErr_Occurred())) __PYX_ERR(1, 607, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_self->__pyx_base.error = __pyx_t_17;

  /* "nltkor/tag/libs/networkconv.pyx":576
 *         return answer
 * 
 *     def _validate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Evaluates the network performance, updating its hits count.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 576, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 576, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._validate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_num_items);
  __Pyx_XDECREF(__pyx_v_hits);
  __Pyx_XDECREF(__pyx_v_i_args);
  __Pyx_XDECREF(__pyx_v_sent_args);
  __Pyx_XDECREF(__pyx_v_sent);
  __Pyx_XDECREF(__pyx_v_sent_preds);
  __Pyx_XDECREF(__pyx_v_sent_tags);
  __Pyx_XDECREF(__pyx_v_answer);
  __Pyx_XDECREF(__pyx_v_predicate_answer);
  __Pyx_XDECREF(__pyx_v_predicate_tags);
  __Pyx_XDECREF(__pyx_v_net_tag);
  __Pyx_XDECREF(__pyx_v_gold_tag);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":609
 *         self.error /= num_items
 * 
 *     def _calculate_gradients(self, tags, scores):             # <<<<<<<<<<<<<<
 *         """Delegates the call to the appropriate function."""
 *         if self.only_classify:
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_37_calculate_gradients(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_36_calculate_gradients, "ConvolutionalNetwork._calculate_gradients(self, tags, scores)\nDelegates the call to the appropriate function.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_37_calculate_gradients = {"_calculate_gradients", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_37_calculate_gradients, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_36_calculate_gradients};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_37_calculate_gradients(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_tags = 0;
  PyObject *__pyx_v_scores = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_calculate_gradients (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_tags,&__pyx_mstate_global->__pyx_n_u_scores,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 609, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 609, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 609, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_calculate_gradients", 0) < 0) __PYX_ERR(1, 609, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_calculate_gradients", 1, 2, 2, i); __PYX_ERR(1, 609, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 609, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 609, __pyx_L3_error)
    }
    __pyx_v_tags = values[0];
    __pyx_v_scores = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_calculate_gradients", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 609, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._calculate_gradients", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_36_calculate_gradients(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v_tags, __pyx_v_scores);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_36_calculate_gradients(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_tags, PyObject *__pyx_v_scores) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[101]))
  __Pyx_RefNannySetupContext("_calculate_gradients", 0);
  __Pyx_TraceStartFunc("_calculate_gradients", __pyx_f[1], 609, 0, 0, 0, __PYX_ERR(1, 609, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":611
 *     def _calculate_gradients(self, tags, scores):
 *         """Delegates the call to the appropriate function."""
 *         if self.only_classify:             # <<<<<<<<<<<<<<
 *             return self._calculate_gradients_classify(tags, scores)
 *         else:
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->only_classify)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 611, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "nltkor/tag/libs/networkconv.pyx":612
 *         """Delegates the call to the appropriate function."""
 *         if self.only_classify:
 *             return self._calculate_gradients_classify(tags, scores)             # <<<<<<<<<<<<<<
 *         else:
 *             return self._calculate_gradients_sll(tags, scores)
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_tags, __pyx_v_scores};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_calculate_gradients_classify, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_TraceReturnValue(__pyx_r, 4, 0, __PYX_ERR(1, 612, __pyx_L1_error));
    goto __pyx_L0;

    /* "nltkor/tag/libs/networkconv.pyx":611
 *     def _calculate_gradients(self, tags, scores):
 *         """Delegates the call to the appropriate function."""
 *         if self.only_classify:             # <<<<<<<<<<<<<<
 *             return self._calculate_gradients_classify(tags, scores)
 *         else:
*/
  }

  /* "nltkor/tag/libs/networkconv.pyx":614
 *             return self._calculate_gradients_classify(tags, scores)
 *         else:
 *             return self._calculate_gradients_sll(tags, scores)             # <<<<<<<<<<<<<<
 * 
 *     def _calculate_gradients_classify(self, tags, scores):
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_tags, __pyx_v_scores};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_calculate_gradients_sll, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 614, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_TraceReturnValue(__pyx_r, 10, 0, __PYX_ERR(1, 614, __pyx_L1_error));
    goto __pyx_L0;
  }

  /* "nltkor/tag/libs/networkconv.pyx":609
 *         self.error /= num_items
 * 
 *     def _calculate_gradients(self, tags, scores):             # <<<<<<<<<<<<<<
 *         """Delegates the call to the appropriate function."""
 *         if self.only_classify:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 609, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._calculate_gradients", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":616
 *             return self._calculate_gradients_sll(tags, scores)
 * 
 *     def _calculate_gradients_classify(self, tags, scores):             # <<<<<<<<<<<<<<
 *         """
 *         Calculates the output deltas for each target in a network that only
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_39_calculate_gradients_classify(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_38_calculate_gradients_classify, "ConvolutionalNetwork._calculate_gradients_classify(self, tags, scores)\nCalculates the output deltas for each target in a network that only \nclassifies predelimited arguments.\nThe aim is to minimize the cost, for each argument:\nlogadd(score for all possible tags) - score(correct tag)\n\n:returns: whether a correction is necessary or not.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_39_calculate_gradients_classify = {"_calculate_gradients_classify", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_39_calculate_gradients_classify, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_38_calculate_gradients_classify};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_39_calculate_gradients_classify(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_tags = 0;
  PyObject *__pyx_v_scores = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_calculate_gradients_classify (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_tags,&__pyx_mstate_global->__pyx_n_u_scores,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 616, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 616, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 616, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_calculate_gradients_classify", 0) < 0) __PYX_ERR(1, 616, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_calculate_gradients_classify", 1, 2, 2, i); __PYX_ERR(1, 616, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 616, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 616, __pyx_L3_error)
    }
    __pyx_v_tags = values[0];
    __pyx_v_scores = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_calculate_gradients_classify", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 616, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._calculate_gradients_classify", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_38_calculate_gradients_classify(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v_tags, __pyx_v_scores);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_38_calculate_gradients_classify(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_tags, PyObject *__pyx_v_scores) {
  int __pyx_v_correction;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_tag_scores = NULL;
  PyObject *__pyx_v_tag = NULL;
  PyObject *__pyx_v_exponentials = NULL;
  PyObject *__pyx_v_exp_sum = NULL;
  PyObject *__pyx_v_logadd = NULL;
  PyObject *__pyx_v_error = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  float __pyx_t_10;
  int __pyx_t_11;
  PyArrayObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[102]))
  __Pyx_RefNannySetupContext("_calculate_gradients_classify", 0);
  __Pyx_TraceStartFunc("_calculate_gradients_classify", __pyx_f[1], 616, 0, 0, 0, __PYX_ERR(1, 616, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":625
 *         :returns: whether a correction is necessary or not.
 *         """
 *         self.net_gradients = np.zeros_like(scores, float)             # <<<<<<<<<<<<<<
 *         #self.net_gradients = np.zeros_like(scores, np.float)
 *         correction = False
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_zeros_like); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_scores, ((PyObject *)(&PyFloat_Type))};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 625, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 625, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.net_gradients);
  __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.net_gradients);
  __pyx_v_self->__pyx_base.net_gradients = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":627
 *         self.net_gradients = np.zeros_like(scores, float)
 *         #self.net_gradients = np.zeros_like(scores, np.float)
 *         correction = False             # <<<<<<<<<<<<<<
 * 
 *         for i, tag_scores in enumerate(scores):
*/
  __pyx_v_correction = 0;

  /* "nltkor/tag/libs/networkconv.pyx":629
 *         correction = False
 * 
 *         for i, tag_scores in enumerate(scores):             # <<<<<<<<<<<<<<
 *             tag = tags[i]
 * 
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_t_1 = __pyx_mstate_global->__pyx_int_0;
  if (likely(PyList_CheckExact(__pyx_v_scores)) || PyTuple_CheckExact(__pyx_v_scores)) {
    __pyx_t_4 = __pyx_v_scores; __Pyx_INCREF(__pyx_t_4);
    __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_scores); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 629, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 629, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 629, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_6);
        ++__pyx_t_6;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 629, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6));
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6);
        #endif
        ++__pyx_t_6;
      }
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error)
    } else {
      __pyx_t_2 = __pyx_t_7(__pyx_t_4);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 629, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_tag_scores, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_2 = __Pyx_PyLong_AddObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":630
 * 
 *         for i, tag_scores in enumerate(scores):
 *             tag = tags[i]             # <<<<<<<<<<<<<<
 * 
 *             exponentials = np.exp(tag_scores)
*/
    __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_tags, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 630, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_tag, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":632
 *             tag = tags[i]
 * 
 *             exponentials = np.exp(tag_scores)             # <<<<<<<<<<<<<<
 *             exp_sum = np.sum(exponentials)
 *             logadd = np.log(exp_sum)
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 632, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_exp); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 632, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_tag_scores};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_exponentials, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":633
 * 
 *             exponentials = np.exp(tag_scores)
 *             exp_sum = np.sum(exponentials)             # <<<<<<<<<<<<<<
 *             logadd = np.log(exp_sum)
 * 
*/
    __pyx_t_9 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 633, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_sum); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 633, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
      assert(__pyx_t_9);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_exponentials};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 633, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_exp_sum, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":634
 *             exponentials = np.exp(tag_scores)
 *             exp_sum = np.sum(exponentials)
 *             logadd = np.log(exp_sum)             # <<<<<<<<<<<<<<
 * 
 *             # update the total error
*/
    __pyx_t_8 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 634, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_log); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 634, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_8);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_exp_sum};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 634, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_logadd, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":637
 * 
 *             # update the total error
 *             error = logadd - tag_scores[tag]             # <<<<<<<<<<<<<<
 *             self.error += error
 * 
*/
    __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_tag_scores, __pyx_v_tag); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 637, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_Subtract(__pyx_v_logadd, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 637, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_error, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":638
 *             # update the total error
 *             error = logadd - tag_scores[tag]
 *             self.error += error             # <<<<<<<<<<<<<<
 * 
 *             # like the non-convolutional network, don't adjust weights if the error
*/
    __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_v_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_10 = __Pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_10 == (float)-1) && PyErr_Occurred())) __PYX_ERR(1, 638, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_self->__pyx_base.error = __pyx_t_10;

    /* "nltkor/tag/libs/networkconv.pyx":643
 *             # is too low. An error of 0.01 means a log-prob of -0.01 for the right
 *             # tag, i.e., more than 99% probability
 *             if error <= 0.01:             # <<<<<<<<<<<<<<
 *                 self.skips += 1
 *                 continue
*/
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_error, __pyx_mstate_global->__pyx_float_0_01, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 643, __pyx_L1_error)
    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(1, 643, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_11) {

      /* "nltkor/tag/libs/networkconv.pyx":644
 *             # tag, i.e., more than 99% probability
 *             if error <= 0.01:
 *                 self.skips += 1             # <<<<<<<<<<<<<<
 *                 continue
 * 
*/
      __pyx_v_self->__pyx_base.skips = (__pyx_v_self->__pyx_base.skips + 1);

      /* "nltkor/tag/libs/networkconv.pyx":645
 *             if error <= 0.01:
 *                 self.skips += 1
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             correction = True
*/
      goto __pyx_L3_continue;

      /* "nltkor/tag/libs/networkconv.pyx":643
 *             # is too low. An error of 0.01 means a log-prob of -0.01 for the right
 *             # tag, i.e., more than 99% probability
 *             if error <= 0.01:             # <<<<<<<<<<<<<<
 *                 self.skips += 1
 *                 continue
*/
    }

    /* "nltkor/tag/libs/networkconv.pyx":647
 *                 continue
 * 
 *             correction = True             # <<<<<<<<<<<<<<
 *             self.net_gradients[i] = - exponentials / exp_sum
 *             self.net_gradients[i, tag] += 1
*/
    __pyx_v_correction = 1;

    /* "nltkor/tag/libs/networkconv.pyx":648
 * 
 *             correction = True
 *             self.net_gradients[i] = - exponentials / exp_sum             # <<<<<<<<<<<<<<
 *             self.net_gradients[i, tag] += 1
 * 
*/
    __pyx_t_2 = PyNumber_Negative(__pyx_v_exponentials); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_v_exp_sum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->__pyx_base.net_gradients), __pyx_v_i, __pyx_t_3) < 0))) __PYX_ERR(1, 648, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":649
 *             correction = True
 *             self.net_gradients[i] = - exponentials / exp_sum
 *             self.net_gradients[i, tag] += 1             # <<<<<<<<<<<<<<
 * 
 *         return correction
*/
    __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.net_gradients);
    __pyx_t_12 = __pyx_v_self->__pyx_base.net_gradients;
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 649, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_i);
    __Pyx_GIVEREF(__pyx_v_i);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_i) != (0)) __PYX_ERR(1, 649, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_tag);
    __Pyx_GIVEREF(__pyx_v_tag);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_tag) != (0)) __PYX_ERR(1, 649, __pyx_L1_error);
    __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_t_12), __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 649, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = __Pyx_PyLong_AddObjC(__pyx_t_2, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 649, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_t_12), __pyx_t_3, __pyx_t_8) < 0))) __PYX_ERR(1, 649, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF((PyObject *)__pyx_t_12); __pyx_t_12 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":629
 *         correction = False
 * 
 *         for i, tag_scores in enumerate(scores):             # <<<<<<<<<<<<<<
 *             tag = tags[i]
 * 
*/
    __pyx_L3_continue:;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":651
 *             self.net_gradients[i, tag] += 1
 * 
 *         return correction             # <<<<<<<<<<<<<<
 * 
 *     def _backpropagate(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_correction); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_TraceReturnValue(__pyx_r, 68, 0, __PYX_ERR(1, 651, __pyx_L1_error));
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkconv.pyx":616
 *             return self._calculate_gradients_sll(tags, scores)
 * 
 *     def _calculate_gradients_classify(self, tags, scores):             # <<<<<<<<<<<<<<
 *         """
 *         Calculates the output deltas for each target in a network that only
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF((PyObject *)__pyx_t_12);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 616, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._calculate_gradients_classify", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_tag_scores);
  __Pyx_XDECREF(__pyx_v_tag);
  __Pyx_XDECREF(__pyx_v_exponentials);
  __Pyx_XDECREF(__pyx_v_exp_sum);
  __Pyx_XDECREF(__pyx_v_logadd);
  __Pyx_XDECREF(__pyx_v_error);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":653
 *         return correction
 * 
 *     def _backpropagate(self):             # <<<<<<<<<<<<<<
 *         """Backpropagates the error gradient."""
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_41_backpropagate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_40_backpropagate, "ConvolutionalNetwork._backpropagate(self)\nBackpropagates the error gradient.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_41_backpropagate = {"_backpropagate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_41_backpropagate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_40_backpropagate};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_41_backpropagate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_backpropagate (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_backpropagate", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_backpropagate", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_40_backpropagate(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_40_backpropagate(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_v_dCd_tanh = NULL;
  PyObject *__pyx_v_dCd_hidden2 = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[103]))
  __Pyx_RefNannySetupContext("_backpropagate", 0);
  __Pyx_TraceStartFunc("_backpropagate", __pyx_f[1], 653, 0, 0, 0, __PYX_ERR(1, 653, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":663
 * 
 *         # derivative with respect to the non-linearity layer (tanh)
 *         dCd_tanh = self.net_gradients.dot(self.output_weights)             # <<<<<<<<<<<<<<
 * 
 *         if self.hidden2_weights is not None:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.net_gradients);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self->__pyx_base.output_weights)};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_dot, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 663, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_dCd_tanh = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":665
 *         dCd_tanh = self.net_gradients.dot(self.output_weights)
 * 
 *         if self.hidden2_weights is not None:             # <<<<<<<<<<<<<<
 *             # derivative with respect to the second hidden layer
 *             dCd_hidden2 = dCd_tanh * hardtanhd(self.hidden2_before_activation)
*/
  __pyx_t_4 = (((PyObject *)__pyx_v_self->hidden2_weights) != Py_None);
  if (__pyx_t_4) {

    /* "nltkor/tag/libs/networkconv.pyx":667
 *         if self.hidden2_weights is not None:
 *             # derivative with respect to the second hidden layer
 *             dCd_hidden2 = dCd_tanh * hardtanhd(self.hidden2_before_activation)             # <<<<<<<<<<<<<<
 *             self.hidden2_gradients = dCd_hidden2
 * 
*/
    __pyx_t_1 = ((PyObject *)__pyx_v_self->hidden2_before_activation);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = __pyx_f_6nltkor_3tag_4libs_7network_hardtanhd(((PyArrayObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Multiply(__pyx_v_dCd_tanh, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_dCd_hidden2 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":668
 *             # derivative with respect to the second hidden layer
 *             dCd_hidden2 = dCd_tanh * hardtanhd(self.hidden2_before_activation)
 *             self.hidden2_gradients = dCd_hidden2             # <<<<<<<<<<<<<<
 * 
 *             self.hidden_gradients = self.hidden2_gradients.dot(self.hidden2_weights)
*/
    __pyx_t_1 = __pyx_v_dCd_hidden2;
    __Pyx_INCREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 668, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden2_gradients);
    __Pyx_DECREF((PyObject *)__pyx_v_self->hidden2_gradients);
    __pyx_v_self->hidden2_gradients = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":670
 *             self.hidden2_gradients = dCd_hidden2
 * 
 *             self.hidden_gradients = self.hidden2_gradients.dot(self.hidden2_weights)             # <<<<<<<<<<<<<<
 *         else:
 *             # the non-linearity appears right after the convolution max
*/
    __pyx_t_2 = ((PyObject *)__pyx_v_self->hidden2_gradients);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self->hidden2_weights)};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_dot, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 670, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 670, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden_gradients);
    __Pyx_DECREF((PyObject *)__pyx_v_self->hidden_gradients);
    __pyx_v_self->hidden_gradients = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":665
 *         dCd_tanh = self.net_gradients.dot(self.output_weights)
 * 
 *         if self.hidden2_weights is not None:             # <<<<<<<<<<<<<<
 *             # derivative with respect to the second hidden layer
 *             dCd_hidden2 = dCd_tanh * hardtanhd(self.hidden2_before_activation)
*/
    goto __pyx_L3;
  }

  /* "nltkor/tag/libs/networkconv.pyx":673
 *         else:
 *             # the non-linearity appears right after the convolution max
 *             self.hidden_gradients = dCd_tanh * hardtanhd(self.hidden_before_activation)             # <<<<<<<<<<<<<<
 * 
 *     @cython.boundscheck(False)
*/
  /*else*/ {
    __pyx_t_1 = ((PyObject *)__pyx_v_self->hidden_before_activation);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = __pyx_f_6nltkor_3tag_4libs_7network_hardtanhd(((PyArrayObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 673, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Multiply(__pyx_v_dCd_tanh, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 673, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 673, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden_gradients);
    __Pyx_DECREF((PyObject *)__pyx_v_self->hidden_gradients);
    __pyx_v_self->hidden_gradients = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "nltkor/tag/libs/networkconv.pyx":653
 *         return correction
 * 
 *     def _backpropagate(self):             # <<<<<<<<<<<<<<
 *         """Backpropagates the error gradient."""
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 653, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 653, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._backpropagate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dCd_tanh);
  __Pyx_XDECREF(__pyx_v_dCd_hidden2);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":675
 *             self.hidden_gradients = dCd_tanh * hardtanhd(self.hidden_before_activation)
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _adjust_weights(self, predicate, arguments=None):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_43_adjust_weights(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_42_adjust_weights, "ConvolutionalNetwork._adjust_weights(self, predicate, arguments=None)\nAdjusts the network weights after gradients have been calculated.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_43_adjust_weights = {"_adjust_weights", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_43_adjust_weights, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_42_adjust_weights};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_43_adjust_weights(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_predicate = 0;
  PyObject *__pyx_v_arguments = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_adjust_weights (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_predicate,&__pyx_mstate_global->__pyx_n_u_arguments,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 675, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 675, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 675, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_adjust_weights", 0) < 0) __PYX_ERR(1, 675, __pyx_L3_error)

      /* "nltkor/tag/libs/networkconv.pyx":677
 *     @cython.boundscheck(False)
 *     @cython.wraparound(False)
 *     def _adjust_weights(self, predicate, arguments=None):             # <<<<<<<<<<<<<<
 *         """
 *         Adjusts the network weights after gradients have been calculated.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_adjust_weights", 0, 1, 2, i); __PYX_ERR(1, 675, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 675, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 675, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_predicate = values[0];
    __pyx_v_arguments = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_adjust_weights", 0, 1, 2, __pyx_nargs); __PYX_ERR(1, 675, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._adjust_weights", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_42_adjust_weights(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v_predicate, __pyx_v_arguments);

  /* "nltkor/tag/libs/networkconv.pyx":675
 *             self.hidden_gradients = dCd_tanh * hardtanhd(self.hidden_before_activation)
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _adjust_weights(self, predicate, arguments=None):
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_42_adjust_weights(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_predicate, PyObject *__pyx_v_arguments) {
  int __pyx_v_i;
  PyArrayObject *__pyx_v_gradients_t = 0;
  PyArrayObject *__pyx_v_last_values = 0;
  PyArrayObject *__pyx_v_deltas = 0;
  PyArrayObject *__pyx_v_grad_matrix = 0;
  PyArrayObject *__pyx_v_input_values = 0;
  PyObject *__pyx_v_neuron_maxes = NULL;
  PyObject *__pyx_v_target_dists = NULL;
  PyObject *__pyx_v_argument = NULL;
  PyObject *__pyx_v_dist_features = NULL;
  PyObject *__pyx_v_pred_dists = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_deltas;
  __Pyx_Buffer __pyx_pybuffer_deltas;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_grad_matrix;
  __Pyx_Buffer __pyx_pybuffer_grad_matrix;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_gradients_t;
  __Pyx_Buffer __pyx_pybuffer_gradients_t;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_input_values;
  __Pyx_Buffer __pyx_pybuffer_input_values;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_last_values;
  __Pyx_Buffer __pyx_pybuffer_last_values;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  npy_intp *__pyx_t_16;
  npy_intp *__pyx_t_17;
  int __pyx_t_18;
  int __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[104]))
  __Pyx_RefNannySetupContext("_adjust_weights", 0);
  __Pyx_TraceStartFunc("_adjust_weights", __pyx_f[1], 675, 0, 0, 0, __PYX_ERR(1, 675, __pyx_L1_error));
  __pyx_pybuffer_gradients_t.pybuffer.buf = NULL;
  __pyx_pybuffer_gradients_t.refcount = 0;
  __pyx_pybuffernd_gradients_t.data = NULL;
  __pyx_pybuffernd_gradients_t.rcbuffer = &__pyx_pybuffer_gradients_t;
  __pyx_pybuffer_last_values.pybuffer.buf = NULL;
  __pyx_pybuffer_last_values.refcount = 0;
  __pyx_pybuffernd_last_values.data = NULL;
  __pyx_pybuffernd_last_values.rcbuffer = &__pyx_pybuffer_last_values;
  __pyx_pybuffer_deltas.pybuffer.buf = NULL;
  __pyx_pybuffer_deltas.refcount = 0;
  __pyx_pybuffernd_deltas.data = NULL;
  __pyx_pybuffernd_deltas.rcbuffer = &__pyx_pybuffer_deltas;
  __pyx_pybuffer_grad_matrix.pybuffer.buf = NULL;
  __pyx_pybuffer_grad_matrix.refcount = 0;
  __pyx_pybuffernd_grad_matrix.data = NULL;
  __pyx_pybuffernd_grad_matrix.rcbuffer = &__pyx_pybuffer_grad_matrix;
  __pyx_pybuffer_input_values.pybuffer.buf = NULL;
  __pyx_pybuffer_input_values.refcount = 0;
  __pyx_pybuffernd_input_values.data = NULL;
  __pyx_pybuffernd_input_values.rcbuffer = &__pyx_pybuffer_input_values;

  /* "nltkor/tag/libs/networkconv.pyx":685
 *         cdef np.ndarray[FLOAT_t, ndim=2] last_values, deltas, grad_matrix, input_values
 * 
 *         last_values = self.hidden2_values if self.hidden2_weights is not None else self.hidden_values             # <<<<<<<<<<<<<<
 *         deltas = self.net_gradients.T.dot(last_values) * self.learning_rate
 *         self.output_weights += deltas
*/
  __pyx_t_2 = (((PyObject *)__pyx_v_self->hidden2_weights) != Py_None);
  if (__pyx_t_2) {
    __Pyx_INCREF((PyObject *)__pyx_v_self->hidden2_values);
    __pyx_t_1 = ((PyObject *)__pyx_v_self->hidden2_values);
  } else {
    __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.hidden_values);
    __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.hidden_values);
  }
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_last_values.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_last_values.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_last_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_last_values, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
      }
      __pyx_t_4 = __pyx_t_5 = __pyx_t_6 = 0;
    }
    __pyx_pybuffernd_last_values.diminfo[0].strides = __pyx_pybuffernd_last_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_last_values.diminfo[0].shape = __pyx_pybuffernd_last_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_last_values.diminfo[1].strides = __pyx_pybuffernd_last_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_last_values.diminfo[1].shape = __pyx_pybuffernd_last_values.rcbuffer->pybuffer.shape[1];
    if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 685, __pyx_L1_error)
  }
  __pyx_v_last_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":686
 * 
 *         last_values = self.hidden2_values if self.hidden2_weights is not None else self.hidden_values
 *         deltas = self.net_gradients.T.dot(last_values) * self.learning_rate             # <<<<<<<<<<<<<<
 *         self.output_weights += deltas
 *         self.output_bias += self.net_gradients.sum(0) * self.learning_rate
*/
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.net_gradients), __pyx_mstate_global->__pyx_n_u_T); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __pyx_t_8;
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_9 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, ((PyObject *)__pyx_v_last_values)};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_dot, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 686, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_8 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.learning_rate); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = PyNumber_Multiply(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 686, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_7), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_v_deltas, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4);
      }
      __pyx_t_6 = __pyx_t_5 = __pyx_t_4 = 0;
    }
    __pyx_pybuffernd_deltas.diminfo[0].strides = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_deltas.diminfo[0].shape = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_deltas.diminfo[1].strides = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_deltas.diminfo[1].shape = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.shape[1];
    if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 686, __pyx_L1_error)
  }
  __pyx_v_deltas = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":687
 *         last_values = self.hidden2_values if self.hidden2_weights is not None else self.hidden_values
 *         deltas = self.net_gradients.T.dot(last_values) * self.learning_rate
 *         self.output_weights += deltas             # <<<<<<<<<<<<<<
 *         self.output_bias += self.net_gradients.sum(0) * self.learning_rate
 * 
*/
  __pyx_t_7 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_self->__pyx_base.output_weights), ((PyObject *)__pyx_v_deltas)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 687, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_7);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.output_weights);
  __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.output_weights);
  __pyx_v_self->__pyx_base.output_weights = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":688
 *         deltas = self.net_gradients.T.dot(last_values) * self.learning_rate
 *         self.output_weights += deltas
 *         self.output_bias += self.net_gradients.sum(0) * self.learning_rate             # <<<<<<<<<<<<<<
 * 
 *         if self.hidden2_weights is not None:
*/
  __pyx_t_8 = ((PyObject *)__pyx_v_self->__pyx_base.net_gradients);
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_9 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_int_0};
    __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_sum, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  }
  __pyx_t_8 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.learning_rate); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = PyNumber_Multiply(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_self->__pyx_base.output_bias), __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 688, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_8);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.output_bias);
  __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.output_bias);
  __pyx_v_self->__pyx_base.output_bias = ((PyArrayObject *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":690
 *         self.output_bias += self.net_gradients.sum(0) * self.learning_rate
 * 
 *         if self.hidden2_weights is not None:             # <<<<<<<<<<<<<<
 *             deltas = self.hidden2_gradients.T.dot(self.hidden_values) * self.learning_rate
 *             self.hidden2_weights += deltas
*/
  __pyx_t_2 = (((PyObject *)__pyx_v_self->hidden2_weights) != Py_None);
  if (__pyx_t_2) {

    /* "nltkor/tag/libs/networkconv.pyx":691
 * 
 *         if self.hidden2_weights is not None:
 *             deltas = self.hidden2_gradients.T.dot(self.hidden_values) * self.learning_rate             # <<<<<<<<<<<<<<
 *             self.hidden2_weights += deltas
 *             self.hidden2_bias += self.hidden2_gradients.sum(0) * self.learning_rate
*/
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->hidden2_gradients), __pyx_mstate_global->__pyx_n_u_T); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = __pyx_t_7;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_v_self->__pyx_base.hidden_values)};
      __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_dot, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
    }
    __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.learning_rate); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = PyNumber_Multiply(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 691, __pyx_L1_error)
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer);
      __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_3 < 0)) {
        PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer, (PyObject*)__pyx_v_deltas, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        }
        __pyx_t_4 = __pyx_t_5 = __pyx_t_6 = 0;
      }
      __pyx_pybuffernd_deltas.diminfo[0].strides = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_deltas.diminfo[0].shape = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_deltas.diminfo[1].strides = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_deltas.diminfo[1].shape = __pyx_pybuffernd_deltas.rcbuffer->pybuffer.shape[1];
      if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 691, __pyx_L1_error)
    }
    __Pyx_DECREF_SET(__pyx_v_deltas, ((PyArrayObject *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":692
 *         if self.hidden2_weights is not None:
 *             deltas = self.hidden2_gradients.T.dot(self.hidden_values) * self.learning_rate
 *             self.hidden2_weights += deltas             # <<<<<<<<<<<<<<
 *             self.hidden2_bias += self.hidden2_gradients.sum(0) * self.learning_rate
 * 
*/
    __pyx_t_1 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_self->hidden2_weights), ((PyObject *)__pyx_v_deltas)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 692, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 692, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden2_weights);
    __Pyx_DECREF((PyObject *)__pyx_v_self->hidden2_weights);
    __pyx_v_self->hidden2_weights = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":693
 *             deltas = self.hidden2_gradients.T.dot(self.hidden_values) * self.learning_rate
 *             self.hidden2_weights += deltas
 *             self.hidden2_bias += self.hidden2_gradients.sum(0) * self.learning_rate             # <<<<<<<<<<<<<<
 * 
 *         # now adjust weights from input to convolution. these will be trickier.
*/
    __pyx_t_7 = ((PyObject *)__pyx_v_self->hidden2_gradients);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_mstate_global->__pyx_int_0};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_sum, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 693, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.learning_rate); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyNumber_Multiply(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_self->hidden2_bias), __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 693, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_7);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->hidden2_bias);
    __Pyx_DECREF((PyObject *)__pyx_v_self->hidden2_bias);
    __pyx_v_self->hidden2_bias = ((PyArrayObject *)__pyx_t_7);
    __pyx_t_7 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":690
 *         self.output_bias += self.net_gradients.sum(0) * self.learning_rate
 * 
 *         if self.hidden2_weights is not None:             # <<<<<<<<<<<<<<
 *             deltas = self.hidden2_gradients.T.dot(self.hidden_values) * self.learning_rate
 *             self.hidden2_weights += deltas
*/
  }

  /* "nltkor/tag/libs/networkconv.pyx":700
 *         # I tried vectorizing this loop but it got a bit slower, probably because
 *         # of the overhead in building matrices/tensors with the max indices
 *         for i, neuron_maxes in enumerate(self.max_indices):             # <<<<<<<<<<<<<<
 *             # i indicates the i-th target
 * 
*/
  __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(((PyObject *)__pyx_v_self->max_indices))) || PyTuple_CheckExact(((PyObject *)__pyx_v_self->max_indices))) {
    __pyx_t_7 = ((PyObject *)__pyx_v_self->max_indices); __Pyx_INCREF(__pyx_t_7);
    __pyx_t_10 = 0;
    __pyx_t_11 = NULL;
  } else {
    __pyx_t_10 = -1; __pyx_t_7 = PyObject_GetIter(((PyObject *)__pyx_v_self->max_indices)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 700, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 700, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_11)) {
      if (likely(PyList_CheckExact(__pyx_t_7))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 700, __pyx_L1_error)
          #endif
          if (__pyx_t_10 >= __pyx_temp) break;
        }
        __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_10);
        ++__pyx_t_10;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 700, __pyx_L1_error)
          #endif
          if (__pyx_t_10 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_10));
        #else
        __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_10);
        #endif
        ++__pyx_t_10;
      }
      if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 700, __pyx_L1_error)
    } else {
      __pyx_t_8 = __pyx_t_11(__pyx_t_7);
      if (unlikely(!__pyx_t_8)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 700, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_XDECREF_SET(__pyx_v_neuron_maxes, __pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_v_i = __pyx_t_3;
    __pyx_t_3 = (__pyx_t_3 + 1);

    /* "nltkor/tag/libs/networkconv.pyx":703
 *             # i indicates the i-th target
 * 
 *             gradients_t = self.hidden_gradients[i] * self.learning_rate             # <<<<<<<<<<<<<<
 * 
 *             # table containing in each line the input values selected for each convolution neuron
*/
    __pyx_t_8 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->hidden_gradients), __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.learning_rate); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_12 = PyNumber_Multiply(__pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 703, __pyx_L1_error)
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gradients_t.rcbuffer->pybuffer);
      __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gradients_t.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_12), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_13 < 0)) {
        PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gradients_t.rcbuffer->pybuffer, (PyObject*)__pyx_v_gradients_t, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4);
        }
        __pyx_t_6 = __pyx_t_5 = __pyx_t_4 = 0;
      }
      __pyx_pybuffernd_gradients_t.diminfo[0].strides = __pyx_pybuffernd_gradients_t.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gradients_t.diminfo[0].shape = __pyx_pybuffernd_gradients_t.rcbuffer->pybuffer.shape[0];
      if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(1, 703, __pyx_L1_error)
    }
    __Pyx_XDECREF_SET(__pyx_v_gradients_t, ((PyArrayObject *)__pyx_t_12));
    __pyx_t_12 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":706
 * 
 *             # table containing in each line the input values selected for each convolution neuron
 *             input_values = self.input_sent_values.take(neuron_maxes, 0)             # <<<<<<<<<<<<<<
 * 
 *             # stack the gradients to multiply all weights for a neuron
*/
    __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.input_sent_values);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_neuron_maxes, __pyx_mstate_global->__pyx_int_0};
      __pyx_t_12 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_take, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 706, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
    }
    if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 706, __pyx_L1_error)
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_values.rcbuffer->pybuffer);
      __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_values.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_12), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_13 < 0)) {
        PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_input_values, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        }
        __pyx_t_4 = __pyx_t_5 = __pyx_t_6 = 0;
      }
      __pyx_pybuffernd_input_values.diminfo[0].strides = __pyx_pybuffernd_input_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input_values.diminfo[0].shape = __pyx_pybuffernd_input_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_input_values.diminfo[1].strides = __pyx_pybuffernd_input_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_input_values.diminfo[1].shape = __pyx_pybuffernd_input_values.rcbuffer->pybuffer.shape[1];
      if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(1, 706, __pyx_L1_error)
    }
    __Pyx_XDECREF_SET(__pyx_v_input_values, ((PyArrayObject *)__pyx_t_12));
    __pyx_t_12 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":709
 * 
 *             # stack the gradients to multiply all weights for a neuron
 *             grad_matrix = np.tile(gradients_t, [self.input_size, 1]).T             # <<<<<<<<<<<<<<
 *             self.hidden_weights += grad_matrix * input_values
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_tile); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.input_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_15 = PyList_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_GIVEREF(__pyx_t_8);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_15, 0, __pyx_t_8) != (0)) __PYX_ERR(1, 709, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_15, 1, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(1, 709, __pyx_L1_error);
    __pyx_t_8 = 0;
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_14))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_14);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, ((PyObject *)__pyx_v_gradients_t), __pyx_t_15};
      __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 709, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
    }
    __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_T); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 709, __pyx_L1_error)
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer);
      __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_14), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_13 < 0)) {
        PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer, (PyObject*)__pyx_v_grad_matrix, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4);
        }
        __pyx_t_6 = __pyx_t_5 = __pyx_t_4 = 0;
      }
      __pyx_pybuffernd_grad_matrix.diminfo[0].strides = __pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_grad_matrix.diminfo[0].shape = __pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_grad_matrix.diminfo[1].strides = __pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_grad_matrix.diminfo[1].shape = __pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer.shape[1];
      if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(1, 709, __pyx_L1_error)
    }
    __Pyx_XDECREF_SET(__pyx_v_grad_matrix, ((PyArrayObject *)__pyx_t_14));
    __pyx_t_14 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":710
 *             # stack the gradients to multiply all weights for a neuron
 *             grad_matrix = np.tile(gradients_t, [self.input_size, 1]).T
 *             self.hidden_weights += grad_matrix * input_values             # <<<<<<<<<<<<<<
 * 
 *             # target distance weights
*/
    __pyx_t_14 = PyNumber_Multiply(((PyObject *)__pyx_v_grad_matrix), ((PyObject *)__pyx_v_input_values)); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 710, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_12 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_self->__pyx_base.hidden_weights), __pyx_t_14); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 710, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 710, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_12);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.hidden_weights);
    __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.hidden_weights);
    __pyx_v_self->__pyx_base.hidden_weights = ((PyArrayObject *)__pyx_t_12);
    __pyx_t_12 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":714
 *             # target distance weights
 *             # get the relative distance from each max token to its target
 *             if arguments is None:             # <<<<<<<<<<<<<<
 *                 target_dists = neuron_maxes - i
 *             else:
*/
    __pyx_t_2 = (__pyx_v_arguments == Py_None);
    if (__pyx_t_2) {

      /* "nltkor/tag/libs/networkconv.pyx":715
 *             # get the relative distance from each max token to its target
 *             if arguments is None:
 *                 target_dists = neuron_maxes - i             # <<<<<<<<<<<<<<
 *             else:
 *                 argument = arguments[i]
*/
      __pyx_t_12 = __Pyx_PyLong_From_int(__pyx_v_i); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 715, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_14 = PyNumber_Subtract(__pyx_v_neuron_maxes, __pyx_t_12); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 715, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF_SET(__pyx_v_target_dists, __pyx_t_14);
      __pyx_t_14 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":714
 *             # target distance weights
 *             # get the relative distance from each max token to its target
 *             if arguments is None:             # <<<<<<<<<<<<<<
 *                 target_dists = neuron_maxes - i
 *             else:
*/
      goto __pyx_L6;
    }

    /* "nltkor/tag/libs/networkconv.pyx":717
 *                 target_dists = neuron_maxes - i
 *             else:
 *                 argument = arguments[i]             # <<<<<<<<<<<<<<
 *                 target_dists = self.argument_distances(neuron_maxes, argument)
 * 
*/
    /*else*/ {
      __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_arguments, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 717, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_XDECREF_SET(__pyx_v_argument, __pyx_t_14);
      __pyx_t_14 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":718
 *             else:
 *                 argument = arguments[i]
 *                 target_dists = self.argument_distances(neuron_maxes, argument)             # <<<<<<<<<<<<<<
 * 
 *             dist_features = self.target_dist_lookup.take(target_dists + self.target_dist_offset,
*/
      __pyx_t_14 = ((PyObject *)((struct __pyx_vtabstruct_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self->__pyx_vtab)->argument_distances(__pyx_v_self, __pyx_v_neuron_maxes, __pyx_v_argument)); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 718, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_XDECREF_SET(__pyx_v_target_dists, __pyx_t_14);
      __pyx_t_14 = 0;
    }
    __pyx_L6:;

    /* "nltkor/tag/libs/networkconv.pyx":720
 *                 target_dists = self.argument_distances(neuron_maxes, argument)
 * 
 *             dist_features = self.target_dist_lookup.take(target_dists + self.target_dist_offset,             # <<<<<<<<<<<<<<
 *                                                          0, mode='clip')
 *             grad_matrix = np.tile(gradients_t, [self.target_dist_weights.shape[0], 1]).T
*/
    __pyx_t_12 = ((PyObject *)__pyx_v_self->target_dist_lookup);
    __Pyx_INCREF(__pyx_t_12);
    __pyx_t_15 = __Pyx_PyLong_From_int(__pyx_v_self->target_dist_offset); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_1 = PyNumber_Add(__pyx_v_target_dists, __pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_12, __pyx_t_1, __pyx_mstate_global->__pyx_int_0};
      __pyx_t_15 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 720, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_n_u_clip, __pyx_t_15, __pyx_callargs+3, 0) < 0) __PYX_ERR(1, 720, __pyx_L1_error)
      __pyx_t_14 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_take, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_15);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 720, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
    }
    __Pyx_XDECREF_SET(__pyx_v_dist_features, __pyx_t_14);
    __pyx_t_14 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":722
 *             dist_features = self.target_dist_lookup.take(target_dists + self.target_dist_offset,
 *                                                          0, mode='clip')
 *             grad_matrix = np.tile(gradients_t, [self.target_dist_weights.shape[0], 1]).T             # <<<<<<<<<<<<<<
 *             self.target_dist_weights += (grad_matrix * dist_features).T
 * 
*/
    __pyx_t_15 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_tile); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)__pyx_v_self->target_dist_weights);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_16 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_1)); if (unlikely(__pyx_t_16 == ((npy_intp *)0) && PyErr_Occurred())) __PYX_ERR(1, 722, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyLong_From_Py_intptr_t((__pyx_t_16[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_1) != (0)) __PYX_ERR(1, 722, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(1, 722, __pyx_L1_error);
    __pyx_t_1 = 0;
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_12);
      assert(__pyx_t_15);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_15);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_15, ((PyObject *)__pyx_v_gradients_t), __pyx_t_8};
      __pyx_t_14 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 722, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
    }
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_T); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 722, __pyx_L1_error)
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer);
      __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_12), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_13 < 0)) {
        PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer, (PyObject*)__pyx_v_grad_matrix, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        }
        __pyx_t_4 = __pyx_t_5 = __pyx_t_6 = 0;
      }
      __pyx_pybuffernd_grad_matrix.diminfo[0].strides = __pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_grad_matrix.diminfo[0].shape = __pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_grad_matrix.diminfo[1].strides = __pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_grad_matrix.diminfo[1].shape = __pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer.shape[1];
      if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(1, 722, __pyx_L1_error)
    }
    __Pyx_DECREF_SET(__pyx_v_grad_matrix, ((PyArrayObject *)__pyx_t_12));
    __pyx_t_12 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":723
 *                                                          0, mode='clip')
 *             grad_matrix = np.tile(gradients_t, [self.target_dist_weights.shape[0], 1]).T
 *             self.target_dist_weights += (grad_matrix * dist_features).T             # <<<<<<<<<<<<<<
 * 
 *             # predicate distance weights
*/
    __pyx_t_12 = PyNumber_Multiply(((PyObject *)__pyx_v_grad_matrix), __pyx_v_dist_features); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_T); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_self->target_dist_weights), __pyx_t_14); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 723, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_12);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->target_dist_weights);
    __Pyx_DECREF((PyObject *)__pyx_v_self->target_dist_weights);
    __pyx_v_self->target_dist_weights = ((PyArrayObject *)__pyx_t_12);
    __pyx_t_12 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":727
 *             # predicate distance weights
 *             # get the distance from each max token to its predicate
 *             pred_dists = neuron_maxes - predicate             # <<<<<<<<<<<<<<
 *             dist_features = self.pred_dist_lookup.take(pred_dists + self.pred_dist_offset,
 *                                                        0, mode='clip')
*/
    __pyx_t_12 = PyNumber_Subtract(__pyx_v_neuron_maxes, __pyx_v_predicate); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 727, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_XDECREF_SET(__pyx_v_pred_dists, __pyx_t_12);
    __pyx_t_12 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":728
 *             # get the distance from each max token to its predicate
 *             pred_dists = neuron_maxes - predicate
 *             dist_features = self.pred_dist_lookup.take(pred_dists + self.pred_dist_offset,             # <<<<<<<<<<<<<<
 *                                                        0, mode='clip')
 *             # try to recycle the grad_matrix if sizes match
*/
    __pyx_t_14 = ((PyObject *)__pyx_v_self->pred_dist_lookup);
    __Pyx_INCREF(__pyx_t_14);
    __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_self->pred_dist_offset); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 728, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_15 = PyNumber_Add(__pyx_v_pred_dists, __pyx_t_8); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 728, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_14, __pyx_t_15, __pyx_mstate_global->__pyx_int_0};
      __pyx_t_8 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 728, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_n_u_clip, __pyx_t_8, __pyx_callargs+3, 0) < 0) __PYX_ERR(1, 728, __pyx_L1_error)
      __pyx_t_12 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_take, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_8);
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 728, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
    }
    __Pyx_DECREF_SET(__pyx_v_dist_features, __pyx_t_12);
    __pyx_t_12 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":731
 *                                                        0, mode='clip')
 *             # try to recycle the grad_matrix if sizes match
 *             if self.target_dist_weights.shape[0] != self.pred_dist_weights.shape[0]:             # <<<<<<<<<<<<<<
 *                 grad_matrix = np.tile(gradients_t, [self.pred_dist_weights.shape[0], 1]).T
 * 
*/
    __pyx_t_12 = ((PyObject *)__pyx_v_self->target_dist_weights);
    __Pyx_INCREF(__pyx_t_12);
    __pyx_t_16 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_12)); if (unlikely(__pyx_t_16 == ((npy_intp *)0) && PyErr_Occurred())) __PYX_ERR(1, 731, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = ((PyObject *)__pyx_v_self->pred_dist_weights);
    __Pyx_INCREF(__pyx_t_12);
    __pyx_t_17 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_12)); if (unlikely(__pyx_t_17 == ((npy_intp *)0) && PyErr_Occurred())) __PYX_ERR(1, 731, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_2 = ((__pyx_t_16[0]) != (__pyx_t_17[0]));
    if (__pyx_t_2) {

      /* "nltkor/tag/libs/networkconv.pyx":732
 *             # try to recycle the grad_matrix if sizes match
 *             if self.target_dist_weights.shape[0] != self.pred_dist_weights.shape[0]:
 *                 grad_matrix = np.tile(gradients_t, [self.pred_dist_weights.shape[0], 1]).T             # <<<<<<<<<<<<<<
 * 
 *             self.pred_dist_weights += (grad_matrix * dist_features).T
*/
      __pyx_t_8 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 732, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_tile); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 732, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_15 = ((PyObject *)__pyx_v_self->pred_dist_weights);
      __Pyx_INCREF(__pyx_t_15);
      __pyx_t_17 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_15)); if (unlikely(__pyx_t_17 == ((npy_intp *)0) && PyErr_Occurred())) __PYX_ERR(1, 732, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_15 = __Pyx_PyLong_From_Py_intptr_t((__pyx_t_17[0])); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 732, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 732, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_15);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_15) != (0)) __PYX_ERR(1, 732, __pyx_L1_error);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(1, 732, __pyx_L1_error);
      __pyx_t_15 = 0;
      __pyx_t_9 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_14))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_14);
        assert(__pyx_t_8);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
        __pyx_t_9 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_8, ((PyObject *)__pyx_v_gradients_t), __pyx_t_1};
        __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 732, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
      }
      __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_T); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 732, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 732, __pyx_L1_error)
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer);
        __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_14), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
        if (unlikely(__pyx_t_13 < 0)) {
          PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer, (PyObject*)__pyx_v_grad_matrix, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4);
          }
          __pyx_t_6 = __pyx_t_5 = __pyx_t_4 = 0;
        }
        __pyx_pybuffernd_grad_matrix.diminfo[0].strides = __pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_grad_matrix.diminfo[0].shape = __pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_grad_matrix.diminfo[1].strides = __pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_grad_matrix.diminfo[1].shape = __pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer.shape[1];
        if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(1, 732, __pyx_L1_error)
      }
      __Pyx_DECREF_SET(__pyx_v_grad_matrix, ((PyArrayObject *)__pyx_t_14));
      __pyx_t_14 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":731
 *                                                        0, mode='clip')
 *             # try to recycle the grad_matrix if sizes match
 *             if self.target_dist_weights.shape[0] != self.pred_dist_weights.shape[0]:             # <<<<<<<<<<<<<<
 *                 grad_matrix = np.tile(gradients_t, [self.pred_dist_weights.shape[0], 1]).T
 * 
*/
    }

    /* "nltkor/tag/libs/networkconv.pyx":734
 *                 grad_matrix = np.tile(gradients_t, [self.pred_dist_weights.shape[0], 1]).T
 * 
 *             self.pred_dist_weights += (grad_matrix * dist_features).T             # <<<<<<<<<<<<<<
 * 
 *         self.hidden_bias += self.hidden_gradients.sum(0) * self.learning_rate
*/
    __pyx_t_14 = PyNumber_Multiply(((PyObject *)__pyx_v_grad_matrix), __pyx_v_dist_features); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 734, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_T); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 734, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_self->pred_dist_weights), __pyx_t_12); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 734, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 734, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_14);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->pred_dist_weights);
    __Pyx_DECREF((PyObject *)__pyx_v_self->pred_dist_weights);
    __pyx_v_self->pred_dist_weights = ((PyArrayObject *)__pyx_t_14);
    __pyx_t_14 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":700
 *         # I tried vectorizing this loop but it got a bit slower, probably because
 *         # of the overhead in building matrices/tensors with the max indices
 *         for i, neuron_maxes in enumerate(self.max_indices):             # <<<<<<<<<<<<<<
 *             # i indicates the i-th target
 * 
*/
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":736
 *             self.pred_dist_weights += (grad_matrix * dist_features).T
 * 
 *         self.hidden_bias += self.hidden_gradients.sum(0) * self.learning_rate             # <<<<<<<<<<<<<<
 * 
 *         # Adjusts the transition scores table with the calculated gradients.
*/
  __pyx_t_14 = ((PyObject *)__pyx_v_self->hidden_gradients);
  __Pyx_INCREF(__pyx_t_14);
  __pyx_t_9 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_mstate_global->__pyx_int_0};
    __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_sum, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  }
  __pyx_t_14 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.learning_rate); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_12 = PyNumber_Multiply(__pyx_t_7, __pyx_t_14); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_self->__pyx_base.hidden_bias), __pyx_t_12); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 736, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_14);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.hidden_bias);
  __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.hidden_bias);
  __pyx_v_self->__pyx_base.hidden_bias = ((PyArrayObject *)__pyx_t_14);
  __pyx_t_14 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":739
 * 
 *         # Adjusts the transition scores table with the calculated gradients.
 *         if not self.only_classify and self.transitions is not None:             # <<<<<<<<<<<<<<
 *             self.transitions += self.trans_gradients * self.learning_rate_trans
 * 
*/
  __pyx_t_18 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->only_classify)); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(1, 739, __pyx_L1_error)
  __pyx_t_19 = (!__pyx_t_18);
  if (__pyx_t_19) {
  } else {
    __pyx_t_2 = __pyx_t_19;
    goto __pyx_L10_bool_binop_done;
  }
  __pyx_t_19 = (((PyObject *)__pyx_v_self->__pyx_base.transitions) != Py_None);
  __pyx_t_2 = __pyx_t_19;
  __pyx_L10_bool_binop_done:;
  if (__pyx_t_2) {

    /* "nltkor/tag/libs/networkconv.pyx":740
 *         # Adjusts the transition scores table with the calculated gradients.
 *         if not self.only_classify and self.transitions is not None:
 *             self.transitions += self.trans_gradients * self.learning_rate_trans             # <<<<<<<<<<<<<<
 * 
 *     @cython.boundscheck(False)
*/
    __pyx_t_14 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.learning_rate_trans); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 740, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_12 = PyNumber_Multiply(((PyObject *)__pyx_v_self->__pyx_base.trans_gradients), __pyx_t_14); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 740, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_self->__pyx_base.transitions), __pyx_t_12); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 740, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 740, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_14);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.transitions);
    __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.transitions);
    __pyx_v_self->__pyx_base.transitions = ((PyArrayObject *)__pyx_t_14);
    __pyx_t_14 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":739
 * 
 *         # Adjusts the transition scores table with the calculated gradients.
 *         if not self.only_classify and self.transitions is not None:             # <<<<<<<<<<<<<<
 *             self.transitions += self.trans_gradients * self.learning_rate_trans
 * 
*/
  }

  /* "nltkor/tag/libs/networkconv.pyx":675
 *             self.hidden_gradients = dCd_tanh * hardtanhd(self.hidden_before_activation)
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _adjust_weights(self, predicate, arguments=None):
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 675, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gradients_t.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_values.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_last_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 675, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._adjust_weights", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_deltas.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_grad_matrix.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gradients_t.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_values.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_last_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_gradients_t);
  __Pyx_XDECREF((PyObject *)__pyx_v_last_values);
  __Pyx_XDECREF((PyObject *)__pyx_v_deltas);
  __Pyx_XDECREF((PyObject *)__pyx_v_grad_matrix);
  __Pyx_XDECREF((PyObject *)__pyx_v_input_values);
  __Pyx_XDECREF(__pyx_v_neuron_maxes);
  __Pyx_XDECREF(__pyx_v_target_dists);
  __Pyx_XDECREF(__pyx_v_argument);
  __Pyx_XDECREF(__pyx_v_dist_features);
  __Pyx_XDECREF(__pyx_v_pred_dists);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":742
 *             self.transitions += self.trans_gradients * self.learning_rate_trans
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _calculate_input_deltas(self, np.ndarray sentence, int predicate,
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_45_calculate_input_deltas(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_44_calculate_input_deltas, "ConvolutionalNetwork._calculate_input_deltas(self, ndarray sentence, int predicate, arguments=None)\nCalculates the input deltas to be applied in the feature tables.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_45_calculate_input_deltas = {"_calculate_input_deltas", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_45_calculate_input_deltas, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_44_calculate_input_deltas};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_45_calculate_input_deltas(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyArrayObject *__pyx_v_sentence = 0;
  int __pyx_v_predicate;
  PyObject *__pyx_v_arguments = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_calculate_input_deltas (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sentence,&__pyx_mstate_global->__pyx_n_u_predicate,&__pyx_mstate_global->__pyx_n_u_arguments,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 742, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_calculate_input_deltas", 0) < 0) __PYX_ERR(1, 742, __pyx_L3_error)

      /* "nltkor/tag/libs/networkconv.pyx":745
 *     @cython.wraparound(False)
 *     def _calculate_input_deltas(self, np.ndarray sentence, int predicate,
 *                                  object arguments=None):             # <<<<<<<<<<<<<<
 *         """
 *         Calculates the input deltas to be applied in the feature tables.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_calculate_input_deltas", 0, 2, 3, i); __PYX_ERR(1, 742, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 742, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 742, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_sentence = ((PyArrayObject *)values[0]);
    __pyx_v_predicate = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_predicate == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 744, __pyx_L3_error)
    __pyx_v_arguments = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_calculate_input_deltas", 0, 2, 3, __pyx_nargs); __PYX_ERR(1, 742, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._calculate_input_deltas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sentence), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "sentence", 0))) __PYX_ERR(1, 744, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_44_calculate_input_deltas(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v_sentence, __pyx_v_predicate, __pyx_v_arguments);

  /* "nltkor/tag/libs/networkconv.pyx":742
 *             self.transitions += self.trans_gradients * self.learning_rate_trans
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _calculate_input_deltas(self, np.ndarray sentence, int predicate,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_44_calculate_input_deltas(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyArrayObject *__pyx_v_sentence, int __pyx_v_predicate, PyObject *__pyx_v_arguments) {
  PyArrayObject *__pyx_v_hidden_gradients = 0;
  PyArrayObject *__pyx_v_input_gradients = 0;
  PyArrayObject *__pyx_v_target_dist_gradients = 0;
  PyArrayObject *__pyx_v_pred_dist_gradients = 0;
  PyArrayObject *__pyx_v_gradients = 0;
  PyArrayObject *__pyx_v_convolution_max = 0;
  PyArrayObject *__pyx_v_target_dists = 0;
  CYTHON_UNUSED PyArrayObject *__pyx_v_column_numbers = 0;
  PyObject *__pyx_v_target = NULL;
  PyObject *__pyx_v_argument = NULL;
  PyObject *__pyx_v_pred_dists = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_column_numbers;
  __Pyx_Buffer __pyx_pybuffer_column_numbers;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_convolution_max;
  __Pyx_Buffer __pyx_pybuffer_convolution_max;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_gradients;
  __Pyx_Buffer __pyx_pybuffer_gradients;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_hidden_gradients;
  __Pyx_Buffer __pyx_pybuffer_hidden_gradients;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_input_gradients;
  __Pyx_Buffer __pyx_pybuffer_input_gradients;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_pred_dist_gradients;
  __Pyx_Buffer __pyx_pybuffer_pred_dist_gradients;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_target_dist_gradients;
  __Pyx_Buffer __pyx_pybuffer_target_dist_gradients;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_target_dists;
  __Pyx_Buffer __pyx_pybuffer_target_dists;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  npy_intp *__pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  int __pyx_t_15;
  int __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[105]))
  __Pyx_RefNannySetupContext("_calculate_input_deltas", 0);
  __Pyx_TraceStartFunc("_calculate_input_deltas", __pyx_f[1], 742, 0, 0, 0, __PYX_ERR(1, 742, __pyx_L1_error));
  __pyx_pybuffer_hidden_gradients.pybuffer.buf = NULL;
  __pyx_pybuffer_hidden_gradients.refcount = 0;
  __pyx_pybuffernd_hidden_gradients.data = NULL;
  __pyx_pybuffernd_hidden_gradients.rcbuffer = &__pyx_pybuffer_hidden_gradients;
  __pyx_pybuffer_input_gradients.pybuffer.buf = NULL;
  __pyx_pybuffer_input_gradients.refcount = 0;
  __pyx_pybuffernd_input_gradients.data = NULL;
  __pyx_pybuffernd_input_gradients.rcbuffer = &__pyx_pybuffer_input_gradients;
  __pyx_pybuffer_target_dist_gradients.pybuffer.buf = NULL;
  __pyx_pybuffer_target_dist_gradients.refcount = 0;
  __pyx_pybuffernd_target_dist_gradients.data = NULL;
  __pyx_pybuffernd_target_dist_gradients.rcbuffer = &__pyx_pybuffer_target_dist_gradients;
  __pyx_pybuffer_pred_dist_gradients.pybuffer.buf = NULL;
  __pyx_pybuffer_pred_dist_gradients.refcount = 0;
  __pyx_pybuffernd_pred_dist_gradients.data = NULL;
  __pyx_pybuffernd_pred_dist_gradients.rcbuffer = &__pyx_pybuffer_pred_dist_gradients;
  __pyx_pybuffer_gradients.pybuffer.buf = NULL;
  __pyx_pybuffer_gradients.refcount = 0;
  __pyx_pybuffernd_gradients.data = NULL;
  __pyx_pybuffernd_gradients.rcbuffer = &__pyx_pybuffer_gradients;
  __pyx_pybuffer_convolution_max.pybuffer.buf = NULL;
  __pyx_pybuffer_convolution_max.refcount = 0;
  __pyx_pybuffernd_convolution_max.data = NULL;
  __pyx_pybuffernd_convolution_max.rcbuffer = &__pyx_pybuffer_convolution_max;
  __pyx_pybuffer_target_dists.pybuffer.buf = NULL;
  __pyx_pybuffer_target_dists.refcount = 0;
  __pyx_pybuffernd_target_dists.data = NULL;
  __pyx_pybuffernd_target_dists.rcbuffer = &__pyx_pybuffer_target_dists;
  __pyx_pybuffer_column_numbers.pybuffer.buf = NULL;
  __pyx_pybuffer_column_numbers.refcount = 0;
  __pyx_pybuffernd_column_numbers.data = NULL;
  __pyx_pybuffernd_column_numbers.rcbuffer = &__pyx_pybuffer_column_numbers;

  /* "nltkor/tag/libs/networkconv.pyx":756
 *         # matrices accumulating gradients over each target
 *         # each matrix has a whole window in each line
 *         input_gradients = np.zeros((len(sentence), self.hidden_size))             # <<<<<<<<<<<<<<
 *         target_dist_gradients = np.zeros((self.target_dist_lookup.shape[0], self.hidden_size))
 *         pred_dist_gradients = np.zeros((self.pred_dist_lookup.shape[0], self.hidden_size))
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = PyObject_Length(((PyObject *)__pyx_v_sentence)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 756, __pyx_L1_error)
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.hidden_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3) != (0)) __PYX_ERR(1, 756, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6) != (0)) __PYX_ERR(1, 756, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_6 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 756, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 756, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_gradients.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_gradients.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_gradients.rcbuffer->pybuffer, (PyObject*)__pyx_v_input_gradients, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
      __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
    }
    __pyx_pybuffernd_input_gradients.diminfo[0].strides = __pyx_pybuffernd_input_gradients.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input_gradients.diminfo[0].shape = __pyx_pybuffernd_input_gradients.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_input_gradients.diminfo[1].strides = __pyx_pybuffernd_input_gradients.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_input_gradients.diminfo[1].shape = __pyx_pybuffernd_input_gradients.rcbuffer->pybuffer.shape[1];
    if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(1, 756, __pyx_L1_error)
  }
  __pyx_v_input_gradients = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":757
 *         # each matrix has a whole window in each line
 *         input_gradients = np.zeros((len(sentence), self.hidden_size))
 *         target_dist_gradients = np.zeros((self.target_dist_lookup.shape[0], self.hidden_size))             # <<<<<<<<<<<<<<
 *         pred_dist_gradients = np.zeros((self.pred_dist_lookup.shape[0], self.hidden_size))
 * 
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = ((PyObject *)__pyx_v_self->target_dist_lookup);
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_13 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_7)); if (unlikely(__pyx_t_13 == ((npy_intp *)0) && PyErr_Occurred())) __PYX_ERR(1, 757, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyLong_From_Py_intptr_t((__pyx_t_13[0])); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.hidden_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7) != (0)) __PYX_ERR(1, 757, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6) != (0)) __PYX_ERR(1, 757, __pyx_L1_error);
  __pyx_t_7 = 0;
  __pyx_t_6 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 757, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 757, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_target_dist_gradients.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_target_dist_gradients.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_target_dist_gradients.rcbuffer->pybuffer, (PyObject*)__pyx_v_target_dist_gradients, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
      }
      __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
    }
    __pyx_pybuffernd_target_dist_gradients.diminfo[0].strides = __pyx_pybuffernd_target_dist_gradients.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_target_dist_gradients.diminfo[0].shape = __pyx_pybuffernd_target_dist_gradients.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_target_dist_gradients.diminfo[1].strides = __pyx_pybuffernd_target_dist_gradients.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_target_dist_gradients.diminfo[1].shape = __pyx_pybuffernd_target_dist_gradients.rcbuffer->pybuffer.shape[1];
    if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(1, 757, __pyx_L1_error)
  }
  __pyx_v_target_dist_gradients = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":758
 *         input_gradients = np.zeros((len(sentence), self.hidden_size))
 *         target_dist_gradients = np.zeros((self.target_dist_lookup.shape[0], self.hidden_size))
 *         pred_dist_gradients = np.zeros((self.pred_dist_lookup.shape[0], self.hidden_size))             # <<<<<<<<<<<<<<
 * 
 *         # avoid multiplying by the learning rate multiple times
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = ((PyObject *)__pyx_v_self->pred_dist_lookup);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_13 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_3)); if (unlikely(__pyx_t_13 == ((npy_intp *)0) && PyErr_Occurred())) __PYX_ERR(1, 758, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyLong_From_Py_intptr_t((__pyx_t_13[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.hidden_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3) != (0)) __PYX_ERR(1, 758, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6) != (0)) __PYX_ERR(1, 758, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_6 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 758, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 758, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pred_dist_gradients.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pred_dist_gradients.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pred_dist_gradients.rcbuffer->pybuffer, (PyObject*)__pyx_v_pred_dist_gradients, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
      __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
    }
    __pyx_pybuffernd_pred_dist_gradients.diminfo[0].strides = __pyx_pybuffernd_pred_dist_gradients.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pred_dist_gradients.diminfo[0].shape = __pyx_pybuffernd_pred_dist_gradients.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_pred_dist_gradients.diminfo[1].strides = __pyx_pybuffernd_pred_dist_gradients.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_pred_dist_gradients.diminfo[1].shape = __pyx_pybuffernd_pred_dist_gradients.rcbuffer->pybuffer.shape[1];
    if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(1, 758, __pyx_L1_error)
  }
  __pyx_v_pred_dist_gradients = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":761
 * 
 *         # avoid multiplying by the learning rate multiple times
 *         hidden_gradients = self.hidden_gradients * self.learning_rate_features             # <<<<<<<<<<<<<<
 *         cdef np.ndarray[INT_t, ndim=1] column_numbers = np.arange(self.hidden_size)
 * 
*/
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.learning_rate_features); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyNumber_Multiply(((PyObject *)__pyx_v_self->hidden_gradients), __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 761, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_hidden_gradients.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_hidden_gradients.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_4), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_hidden_gradients.rcbuffer->pybuffer, (PyObject*)__pyx_v_hidden_gradients, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
      }
      __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
    }
    __pyx_pybuffernd_hidden_gradients.diminfo[0].strides = __pyx_pybuffernd_hidden_gradients.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_hidden_gradients.diminfo[0].shape = __pyx_pybuffernd_hidden_gradients.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_hidden_gradients.diminfo[1].strides = __pyx_pybuffernd_hidden_gradients.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_hidden_gradients.diminfo[1].shape = __pyx_pybuffernd_hidden_gradients.rcbuffer->pybuffer.shape[1];
    if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(1, 761, __pyx_L1_error)
  }
  __pyx_v_hidden_gradients = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":762
 *         # avoid multiplying by the learning rate multiple times
 *         hidden_gradients = self.hidden_gradients * self.learning_rate_features
 *         cdef np.ndarray[INT_t, ndim=1] column_numbers = np.arange(self.hidden_size)             # <<<<<<<<<<<<<<
 * 
 *         for target in range(self.num_targets):
*/
  __pyx_t_1 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 762, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_arange); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 762, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.hidden_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 762, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_7};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 762, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 762, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_column_numbers.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_4), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_INT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_column_numbers = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_column_numbers.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(1, 762, __pyx_L1_error)
    } else {__pyx_pybuffernd_column_numbers.diminfo[0].strides = __pyx_pybuffernd_column_numbers.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_column_numbers.diminfo[0].shape = __pyx_pybuffernd_column_numbers.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_v_column_numbers = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":764
 *         cdef np.ndarray[INT_t, ndim=1] column_numbers = np.arange(self.hidden_size)
 * 
 *         for target in range(self.num_targets):             # <<<<<<<<<<<<<<
 * 
 *             # array with the tokens that yielded the maximum value in each neuron
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_builtin_range);
  __pyx_t_7 = __pyx_builtin_range; 
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->num_targets); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_1};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 764, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_7 = __pyx_t_4; __Pyx_INCREF(__pyx_t_7);
    __pyx_t_5 = 0;
    __pyx_t_14 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 764, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 764, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_14)) {
      if (likely(PyList_CheckExact(__pyx_t_7))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 764, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_5);
        ++__pyx_t_5;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 764, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_5));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_5);
        #endif
        ++__pyx_t_5;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 764, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_14(__pyx_t_7);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 764, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_target, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":768
 *             # array with the tokens that yielded the maximum value in each neuron
 *             # for this target
 *             convolution_max = self.max_indices[target]             # <<<<<<<<<<<<<<
 * 
 *             if not self.only_classify:
*/
    __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->max_indices), __pyx_v_target); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 768, __pyx_L1_error)
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_convolution_max.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_convolution_max.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_4), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_INT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_convolution_max.rcbuffer->pybuffer, (PyObject*)__pyx_v_convolution_max, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_INT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        }
        __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
      }
      __pyx_pybuffernd_convolution_max.diminfo[0].strides = __pyx_pybuffernd_convolution_max.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_convolution_max.diminfo[0].shape = __pyx_pybuffernd_convolution_max.rcbuffer->pybuffer.shape[0];
      if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(1, 768, __pyx_L1_error)
    }
    __Pyx_XDECREF_SET(__pyx_v_convolution_max, ((PyArrayObject *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":770
 *             convolution_max = self.max_indices[target]
 * 
 *             if not self.only_classify:             # <<<<<<<<<<<<<<
 *                 target_dists = convolution_max - target
 *             else:
*/
    __pyx_t_15 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->only_classify)); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(1, 770, __pyx_L1_error)
    __pyx_t_16 = (!__pyx_t_15);
    if (__pyx_t_16) {

      /* "nltkor/tag/libs/networkconv.pyx":771
 * 
 *             if not self.only_classify:
 *                 target_dists = convolution_max - target             # <<<<<<<<<<<<<<
 *             else:
 *                 argument = arguments[target]
*/
      __pyx_t_4 = PyNumber_Subtract(((PyObject *)__pyx_v_convolution_max), __pyx_v_target); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 771, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 771, __pyx_L1_error)
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_target_dists.rcbuffer->pybuffer);
        __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_target_dists.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_4), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_INT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_9 < 0)) {
          PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_target_dists.rcbuffer->pybuffer, (PyObject*)__pyx_v_target_dists, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_INT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
          }
          __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
        }
        __pyx_pybuffernd_target_dists.diminfo[0].strides = __pyx_pybuffernd_target_dists.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_target_dists.diminfo[0].shape = __pyx_pybuffernd_target_dists.rcbuffer->pybuffer.shape[0];
        if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(1, 771, __pyx_L1_error)
      }
      __Pyx_XDECREF_SET(__pyx_v_target_dists, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":770
 *             convolution_max = self.max_indices[target]
 * 
 *             if not self.only_classify:             # <<<<<<<<<<<<<<
 *                 target_dists = convolution_max - target
 *             else:
*/
      goto __pyx_L5;
    }

    /* "nltkor/tag/libs/networkconv.pyx":773
 *                 target_dists = convolution_max - target
 *             else:
 *                 argument = arguments[target]             # <<<<<<<<<<<<<<
 *                 target_dists = self.argument_distances(convolution_max, argument)
 * 
*/
    /*else*/ {
      __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_arguments, __pyx_v_target); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 773, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_argument, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":774
 *             else:
 *                 argument = arguments[target]
 *                 target_dists = self.argument_distances(convolution_max, argument)             # <<<<<<<<<<<<<<
 * 
 *             target_dists = np.clip(target_dists + self.target_dist_offset, 0,
*/
      __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self->__pyx_vtab)->argument_distances(__pyx_v_self, ((PyObject *)__pyx_v_convolution_max), __pyx_v_argument)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 774, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_target_dists.rcbuffer->pybuffer);
        __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_target_dists.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_4), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_INT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_9 < 0)) {
          PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_target_dists.rcbuffer->pybuffer, (PyObject*)__pyx_v_target_dists, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_INT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
          }
          __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
        }
        __pyx_pybuffernd_target_dists.diminfo[0].strides = __pyx_pybuffernd_target_dists.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_target_dists.diminfo[0].shape = __pyx_pybuffernd_target_dists.rcbuffer->pybuffer.shape[0];
        if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(1, 774, __pyx_L1_error)
      }
      __Pyx_XDECREF_SET(__pyx_v_target_dists, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;
    }
    __pyx_L5:;

    /* "nltkor/tag/libs/networkconv.pyx":776
 *                 target_dists = self.argument_distances(convolution_max, argument)
 * 
 *             target_dists = np.clip(target_dists + self.target_dist_offset, 0,             # <<<<<<<<<<<<<<
 *                                    self.target_dist_lookup.shape[0] - 1)
 *             pred_dists = convolution_max - predicate
*/
    __pyx_t_1 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 776, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_clip); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 776, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_self->target_dist_offset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 776, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_v_target_dists), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 776, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":777
 * 
 *             target_dists = np.clip(target_dists + self.target_dist_offset, 0,
 *                                    self.target_dist_lookup.shape[0] - 1)             # <<<<<<<<<<<<<<
 *             pred_dists = convolution_max - predicate
 *             pred_dists = np.clip(pred_dists + self.pred_dist_offset, 0,
*/
    __pyx_t_2 = ((PyObject *)__pyx_v_self->target_dist_lookup);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_13 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_2)); if (unlikely(__pyx_t_13 == ((npy_intp *)0) && PyErr_Occurred())) __PYX_ERR(1, 777, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyLong_From_long(((__pyx_t_13[0]) - 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 777, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_t_3, __pyx_mstate_global->__pyx_int_0, __pyx_t_2};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 776, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }

    /* "nltkor/tag/libs/networkconv.pyx":776
 *                 target_dists = self.argument_distances(convolution_max, argument)
 * 
 *             target_dists = np.clip(target_dists + self.target_dist_offset, 0,             # <<<<<<<<<<<<<<
 *                                    self.target_dist_lookup.shape[0] - 1)
 *             pred_dists = convolution_max - predicate
*/
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 776, __pyx_L1_error)
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_target_dists.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_target_dists.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_4), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_INT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_target_dists.rcbuffer->pybuffer, (PyObject*)__pyx_v_target_dists, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_INT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
        }
        __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
      }
      __pyx_pybuffernd_target_dists.diminfo[0].strides = __pyx_pybuffernd_target_dists.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_target_dists.diminfo[0].shape = __pyx_pybuffernd_target_dists.rcbuffer->pybuffer.shape[0];
      if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(1, 776, __pyx_L1_error)
    }
    __Pyx_DECREF_SET(__pyx_v_target_dists, ((PyArrayObject *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":778
 *             target_dists = np.clip(target_dists + self.target_dist_offset, 0,
 *                                    self.target_dist_lookup.shape[0] - 1)
 *             pred_dists = convolution_max - predicate             # <<<<<<<<<<<<<<
 *             pred_dists = np.clip(pred_dists + self.pred_dist_offset, 0,
 *                                  self.pred_dist_lookup.shape[0] - 1)
*/
    __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_predicate); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 778, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyNumber_Subtract(((PyObject *)__pyx_v_convolution_max), __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 778, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_pred_dists, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":779
 *                                    self.target_dist_lookup.shape[0] - 1)
 *             pred_dists = convolution_max - predicate
 *             pred_dists = np.clip(pred_dists + self.pred_dist_offset, 0,             # <<<<<<<<<<<<<<
 *                                  self.pred_dist_lookup.shape[0] - 1)
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 779, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_clip); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 779, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_self->pred_dist_offset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 779, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyNumber_Add(__pyx_v_pred_dists, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 779, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":780
 *             pred_dists = convolution_max - predicate
 *             pred_dists = np.clip(pred_dists + self.pred_dist_offset, 0,
 *                                  self.pred_dist_lookup.shape[0] - 1)             # <<<<<<<<<<<<<<
 * 
 *             gradients = hidden_gradients[target]
*/
    __pyx_t_2 = ((PyObject *)__pyx_v_self->pred_dist_lookup);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_13 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_2)); if (unlikely(__pyx_t_13 == ((npy_intp *)0) && PyErr_Occurred())) __PYX_ERR(1, 780, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyLong_From_long(((__pyx_t_13[0]) - 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 780, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_t_1, __pyx_mstate_global->__pyx_int_0, __pyx_t_2};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 779, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_DECREF_SET(__pyx_v_pred_dists, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":782
 *                                  self.pred_dist_lookup.shape[0] - 1)
 * 
 *             gradients = hidden_gradients[target]             # <<<<<<<<<<<<<<
 * 
 *             # sparse matrix with gradients to be applied over the input
*/
    __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_hidden_gradients), __pyx_v_target); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 782, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 782, __pyx_L1_error)
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gradients.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gradients.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_6), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gradients.rcbuffer->pybuffer, (PyObject*)__pyx_v_gradients, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        }
        __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
      }
      __pyx_pybuffernd_gradients.diminfo[0].strides = __pyx_pybuffernd_gradients.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gradients.diminfo[0].shape = __pyx_pybuffernd_gradients.rcbuffer->pybuffer.shape[0];
      if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(1, 782, __pyx_L1_error)
    }
    __Pyx_XDECREF_SET(__pyx_v_gradients, ((PyArrayObject *)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":786
 *             # sparse matrix with gradients to be applied over the input
 *             # line i has the gradients for the i-th token in the sentence
 *             input_gradients[convolution_max, np.arange(self.hidden_size)] += gradients             # <<<<<<<<<<<<<<
 * 
 *             # distance deltas
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_arange); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.hidden_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_2};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 786, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF((PyObject *)__pyx_v_convolution_max);
    __Pyx_GIVEREF((PyObject *)__pyx_v_convolution_max);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_convolution_max)) != (0)) __PYX_ERR(1, 786, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6) != (0)) __PYX_ERR(1, 786, __pyx_L1_error);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_input_gradients), __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_6, ((PyObject *)__pyx_v_gradients)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_input_gradients), __pyx_t_1, __pyx_t_2) < 0))) __PYX_ERR(1, 786, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":789
 * 
 *             # distance deltas
 *             target_dist_gradients[target_dists, np.arange(self.hidden_size)] += gradients             # <<<<<<<<<<<<<<
 *             pred_dist_gradients[pred_dists, np.arange(self.hidden_size)] += gradients
 * 
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_arange); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.hidden_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_6};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 789, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF((PyObject *)__pyx_v_target_dists);
    __Pyx_GIVEREF((PyObject *)__pyx_v_target_dists);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_target_dists)) != (0)) __PYX_ERR(1, 789, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 789, __pyx_L1_error);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_target_dist_gradients), __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_t_1, ((PyObject *)__pyx_v_gradients)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_target_dist_gradients), __pyx_t_3, __pyx_t_6) < 0))) __PYX_ERR(1, 789, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":790
 *             # distance deltas
 *             target_dist_gradients[target_dists, np.arange(self.hidden_size)] += gradients
 *             pred_dist_gradients[pred_dists, np.arange(self.hidden_size)] += gradients             # <<<<<<<<<<<<<<
 * 
 *         self.input_deltas = input_gradients.dot(self.hidden_weights)
*/
    __pyx_t_6 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_arange); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.hidden_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
      assert(__pyx_t_6);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_1};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 790, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_pred_dists);
    __Pyx_GIVEREF(__pyx_v_pred_dists);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_pred_dists) != (0)) __PYX_ERR(1, 790, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3) != (0)) __PYX_ERR(1, 790, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_pred_dist_gradients), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_3, ((PyObject *)__pyx_v_gradients)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_pred_dist_gradients), __pyx_t_2, __pyx_t_1) < 0))) __PYX_ERR(1, 790, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":764
 *         cdef np.ndarray[INT_t, ndim=1] column_numbers = np.arange(self.hidden_size)
 * 
 *         for target in range(self.num_targets):             # <<<<<<<<<<<<<<
 * 
 *             # array with the tokens that yielded the maximum value in each neuron
*/
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":792
 *             pred_dist_gradients[pred_dists, np.arange(self.hidden_size)] += gradients
 * 
 *         self.input_deltas = input_gradients.dot(self.hidden_weights)             # <<<<<<<<<<<<<<
 *         self.target_dist_deltas = target_dist_gradients.dot(self.target_dist_weights.T)
 *         self.pred_dist_deltas = pred_dist_gradients.dot(self.pred_dist_weights.T)
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_input_gradients);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_8 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self->__pyx_base.hidden_weights)};
    __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_dot, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 792, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  }
  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 792, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_7);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->input_deltas);
  __Pyx_DECREF((PyObject *)__pyx_v_self->input_deltas);
  __pyx_v_self->input_deltas = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":793
 * 
 *         self.input_deltas = input_gradients.dot(self.hidden_weights)
 *         self.target_dist_deltas = target_dist_gradients.dot(self.target_dist_weights.T)             # <<<<<<<<<<<<<<
 *         self.pred_dist_deltas = pred_dist_gradients.dot(self.pred_dist_weights.T)
 * 
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_target_dist_gradients);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->target_dist_weights), __pyx_mstate_global->__pyx_n_u_T); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_1};
    __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_dot, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 793, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  }
  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 793, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_7);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->target_dist_deltas);
  __Pyx_DECREF((PyObject *)__pyx_v_self->target_dist_deltas);
  __pyx_v_self->target_dist_deltas = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":794
 *         self.input_deltas = input_gradients.dot(self.hidden_weights)
 *         self.target_dist_deltas = target_dist_gradients.dot(self.target_dist_weights.T)
 *         self.pred_dist_deltas = pred_dist_gradients.dot(self.pred_dist_weights.T)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = ((PyObject *)__pyx_v_pred_dist_gradients);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->pred_dist_weights), __pyx_mstate_global->__pyx_n_u_T); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 794, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_2};
    __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_dot, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 794, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  }
  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 794, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_7);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->pred_dist_deltas);
  __Pyx_DECREF((PyObject *)__pyx_v_self->pred_dist_deltas);
  __pyx_v_self->pred_dist_deltas = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":742
 *             self.transitions += self.trans_gradients * self.learning_rate_trans
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _calculate_input_deltas(self, np.ndarray sentence, int predicate,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 742, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_column_numbers.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_convolution_max.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gradients.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_hidden_gradients.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_gradients.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pred_dist_gradients.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_target_dist_gradients.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_target_dists.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 742, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._calculate_input_deltas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_column_numbers.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_convolution_max.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gradients.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_hidden_gradients.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_gradients.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pred_dist_gradients.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_target_dist_gradients.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_target_dists.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_hidden_gradients);
  __Pyx_XDECREF((PyObject *)__pyx_v_input_gradients);
  __Pyx_XDECREF((PyObject *)__pyx_v_target_dist_gradients);
  __Pyx_XDECREF((PyObject *)__pyx_v_pred_dist_gradients);
  __Pyx_XDECREF((PyObject *)__pyx_v_gradients);
  __Pyx_XDECREF((PyObject *)__pyx_v_convolution_max);
  __Pyx_XDECREF((PyObject *)__pyx_v_target_dists);
  __Pyx_XDECREF((PyObject *)__pyx_v_column_numbers);
  __Pyx_XDECREF(__pyx_v_target);
  __Pyx_XDECREF(__pyx_v_argument);
  __Pyx_XDECREF(__pyx_v_pred_dists);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":797
 * 
 * 
 *     def _adjust_features(self, sentence, predicate):             # <<<<<<<<<<<<<<
 *         """Adjusts the features in all feature tables."""
 *         # compute each token in the window separately and
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_47_adjust_features(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_46_adjust_features, "ConvolutionalNetwork._adjust_features(self, sentence, predicate)\nAdjusts the features in all feature tables.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_47_adjust_features = {"_adjust_features", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_47_adjust_features, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_46_adjust_features};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_47_adjust_features(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_sentence = 0;
  CYTHON_UNUSED PyObject *__pyx_v_predicate = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_adjust_features (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sentence,&__pyx_mstate_global->__pyx_n_u_predicate,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 797, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 797, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 797, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_adjust_features", 0) < 0) __PYX_ERR(1, 797, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_adjust_features", 1, 2, 2, i); __PYX_ERR(1, 797, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 797, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 797, __pyx_L3_error)
    }
    __pyx_v_sentence = values[0];
    __pyx_v_predicate = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_adjust_features", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 797, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._adjust_features", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_46_adjust_features(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v_sentence, __pyx_v_predicate);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_46_adjust_features(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_sentence, CYTHON_UNUSED PyObject *__pyx_v_predicate) {
  PyObject *__pyx_v_start_from = NULL;
  PyObject *__pyx_v_dist_target_from = NULL;
  PyObject *__pyx_v_dist_pred_from = NULL;
  PyObject *__pyx_v_pre_dist = NULL;
  PyObject *__pyx_v_pos_dist = NULL;
  PyObject *__pyx_v_padded_sentence = NULL;
  int __pyx_v_i;
  PyObject *__pyx_v_j = NULL;
  PyObject *__pyx_v_table = NULL;
  PyObject *__pyx_v_table_deltas = NULL;
  PyObject *__pyx_v_token = NULL;
  PyObject *__pyx_v_deltas = NULL;
  PyObject *__pyx_v_dist_deltas = NULL;
  PyObject *__pyx_v_pre_deltas = NULL;
  PyObject *__pyx_v_pos_deltas = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  Py_ssize_t __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  PyObject *__pyx_t_15 = NULL;
  PyObject *(*__pyx_t_16)(PyObject *);
  npy_intp *__pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyArrayObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[106]))
  __Pyx_RefNannySetupContext("_adjust_features", 0);
  __Pyx_TraceStartFunc("_adjust_features", __pyx_f[1], 797, 0, 0, 0, __PYX_ERR(1, 797, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":801
 *         # compute each token in the window separately and
 *         # separate the feature deltas into tables
 *         start_from = 0             # <<<<<<<<<<<<<<
 *         dist_target_from = 0
 *         dist_pred_from = 0
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_v_start_from = __pyx_mstate_global->__pyx_int_0;

  /* "nltkor/tag/libs/networkconv.pyx":802
 *         # separate the feature deltas into tables
 *         start_from = 0
 *         dist_target_from = 0             # <<<<<<<<<<<<<<
 *         dist_pred_from = 0
 * 
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_v_dist_target_from = __pyx_mstate_global->__pyx_int_0;

  /* "nltkor/tag/libs/networkconv.pyx":803
 *         start_from = 0
 *         dist_target_from = 0
 *         dist_pred_from = 0             # <<<<<<<<<<<<<<
 * 
 *         # number of times that the minimum and maximum distances are repeated
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_v_dist_pred_from = __pyx_mstate_global->__pyx_int_0;

  /* "nltkor/tag/libs/networkconv.pyx":807
 *         # number of times that the minimum and maximum distances are repeated
 *         # in the lookup distance tables
 *         pre_dist = self.word_window_size             # <<<<<<<<<<<<<<
 *         pos_dist = 1
 *         if self.word_window_size > 1:
*/
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.word_window_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_pre_dist = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":808
 *         # in the lookup distance tables
 *         pre_dist = self.word_window_size
 *         pos_dist = 1             # <<<<<<<<<<<<<<
 *         if self.word_window_size > 1:
 *             padded_sentence = np.concatenate((self.pre_padding,
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
  __pyx_v_pos_dist = __pyx_mstate_global->__pyx_int_1;

  /* "nltkor/tag/libs/networkconv.pyx":809
 *         pre_dist = self.word_window_size
 *         pos_dist = 1
 *         if self.word_window_size > 1:             # <<<<<<<<<<<<<<
 *             padded_sentence = np.concatenate((self.pre_padding,
 *                                               sentence,
*/
  __pyx_t_2 = (__pyx_v_self->__pyx_base.word_window_size > 1);
  if (__pyx_t_2) {

    /* "nltkor/tag/libs/networkconv.pyx":810
 *         pos_dist = 1
 *         if self.word_window_size > 1:
 *             padded_sentence = np.concatenate((self.pre_padding,             # <<<<<<<<<<<<<<
 *                                               sentence,
 *                                               self.pos_padding))
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 810, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_concatenate); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 810, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":812
 *             padded_sentence = np.concatenate((self.pre_padding,
 *                                               sentence,
 *                                               self.pos_padding))             # <<<<<<<<<<<<<<
 *         else:
 *             padded_sentence = sentence
*/
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 810, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.pre_padding);
    __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.pre_padding);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self->__pyx_base.pre_padding)) != (0)) __PYX_ERR(1, 810, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_sentence);
    __Pyx_GIVEREF(__pyx_v_sentence);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_sentence) != (0)) __PYX_ERR(1, 810, __pyx_L1_error);
    __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.pos_padding);
    __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.pos_padding);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_self->__pyx_base.pos_padding)) != (0)) __PYX_ERR(1, 810, __pyx_L1_error);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 810, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_v_padded_sentence = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":809
 *         pre_dist = self.word_window_size
 *         pos_dist = 1
 *         if self.word_window_size > 1:             # <<<<<<<<<<<<<<
 *             padded_sentence = np.concatenate((self.pre_padding,
 *                                               sentence,
*/
    goto __pyx_L3;
  }

  /* "nltkor/tag/libs/networkconv.pyx":814
 *                                               self.pos_padding))
 *         else:
 *             padded_sentence = sentence             # <<<<<<<<<<<<<<
 * 
 *         for i in range(self.word_window_size):
*/
  /*else*/ {
    __Pyx_INCREF(__pyx_v_sentence);
    __pyx_v_padded_sentence = __pyx_v_sentence;
  }
  __pyx_L3:;

  /* "nltkor/tag/libs/networkconv.pyx":816
 *             padded_sentence = sentence
 * 
 *         for i in range(self.word_window_size):             # <<<<<<<<<<<<<<
 * 
 *             for j, table in enumerate(self.feature_tables):
*/
  __pyx_t_7 = __pyx_v_self->__pyx_base.word_window_size;
  __pyx_t_8 = __pyx_t_7;
  for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
    __pyx_v_i = __pyx_t_9;

    /* "nltkor/tag/libs/networkconv.pyx":818
 *         for i in range(self.word_window_size):
 * 
 *             for j, table in enumerate(self.feature_tables):             # <<<<<<<<<<<<<<
 *                 # this is the column for the i-th position in the window
 *                 # regarding features from the j-th table
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __pyx_t_1 = __pyx_mstate_global->__pyx_int_0;
    __pyx_t_5 = __pyx_v_self->__pyx_base.feature_tables; __Pyx_INCREF(__pyx_t_5);
    __pyx_t_10 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 818, __pyx_L1_error)
        #endif
        if (__pyx_t_10 >= __pyx_temp) break;
      }
      __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_10);
      ++__pyx_t_10;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 818, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_table, __pyx_t_4);
      __pyx_t_4 = 0;
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_1);
      __pyx_t_4 = __Pyx_PyLong_AddObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 818, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1);
      __pyx_t_1 = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":821
 *                 # this is the column for the i-th position in the window
 *                 # regarding features from the j-th table
 *                 table_deltas = self.input_deltas[:, start_from:start_from + table.shape[1]]             # <<<<<<<<<<<<<<
 *                 start_from += table.shape[1]
 * 
*/
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_table, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 821, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_Add(__pyx_v_start_from, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PySlice_New(__pyx_v_start_from, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 821, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(1, 821, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_3);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(1, 821, __pyx_L1_error);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->input_deltas), __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 821, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_table_deltas, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":822
 *                 # regarding features from the j-th table
 *                 table_deltas = self.input_deltas[:, start_from:start_from + table.shape[1]]
 *                 start_from += table.shape[1]             # <<<<<<<<<<<<<<
 * 
 *                 for token, deltas in zip(padded_sentence[i:], table_deltas):
*/
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_table, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 822, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 822, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_start_from, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 822, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_start_from, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":824
 *                 start_from += table.shape[1]
 * 
 *                 for token, deltas in zip(padded_sentence[i:], table_deltas):             # <<<<<<<<<<<<<<
 *                     table[token[j]] += deltas
 * 
*/
      __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_builtin_zip);
      __pyx_t_11 = __pyx_builtin_zip; 
      __pyx_t_12 = __Pyx_PyObject_GetSlice(__pyx_v_padded_sentence, __pyx_v_i, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 824, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_12, __pyx_v_table_deltas};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 824, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
        __pyx_t_11 = __pyx_t_3; __Pyx_INCREF(__pyx_t_11);
        __pyx_t_13 = 0;
        __pyx_t_14 = NULL;
      } else {
        __pyx_t_13 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 824, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 824, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      for (;;) {
        if (likely(!__pyx_t_14)) {
          if (likely(PyList_CheckExact(__pyx_t_11))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_11);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 824, __pyx_L1_error)
              #endif
              if (__pyx_t_13 >= __pyx_temp) break;
            }
            __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_11, __pyx_t_13);
            ++__pyx_t_13;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_11);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 824, __pyx_L1_error)
              #endif
              if (__pyx_t_13 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_13));
            #else
            __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_13);
            #endif
            ++__pyx_t_13;
          }
          if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 824, __pyx_L1_error)
        } else {
          __pyx_t_3 = __pyx_t_14(__pyx_t_11);
          if (unlikely(!__pyx_t_3)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 824, __pyx_L1_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_3);
        if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
          PyObject* sequence = __pyx_t_3;
          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(1, 824, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0);
            __Pyx_INCREF(__pyx_t_12);
            __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
            __Pyx_INCREF(__pyx_t_4);
          } else {
            __pyx_t_12 = __Pyx_PyList_GetItemRef(sequence, 0);
            if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 824, __pyx_L1_error)
            __Pyx_XGOTREF(__pyx_t_12);
            __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1);
            if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 824, __pyx_L1_error)
            __Pyx_XGOTREF(__pyx_t_4);
          }
          #else
          __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 824, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 824, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_15 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 824, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_16 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_15);
          index = 0; __pyx_t_12 = __pyx_t_16(__pyx_t_15); if (unlikely(!__pyx_t_12)) goto __pyx_L10_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_12);
          index = 1; __pyx_t_4 = __pyx_t_16(__pyx_t_15); if (unlikely(!__pyx_t_4)) goto __pyx_L10_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_4);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_15), 2) < 0) __PYX_ERR(1, 824, __pyx_L1_error)
          __pyx_t_16 = NULL;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          goto __pyx_L11_unpacking_done;
          __pyx_L10_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __pyx_t_16 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(1, 824, __pyx_L1_error)
          __pyx_L11_unpacking_done:;
        }
        __Pyx_XDECREF_SET(__pyx_v_token, __pyx_t_12);
        __pyx_t_12 = 0;
        __Pyx_XDECREF_SET(__pyx_v_deltas, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "nltkor/tag/libs/networkconv.pyx":825
 * 
 *                 for token, deltas in zip(padded_sentence[i:], table_deltas):
 *                     table[token[j]] += deltas             # <<<<<<<<<<<<<<
 * 
 *             dist_deltas = self.target_dist_deltas[:, dist_target_from : dist_target_from + self.target_dist_table.shape[1] ]
*/
        __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_token, __pyx_v_j); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 825, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_table, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 825, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_12 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_v_deltas); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 825, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely((PyObject_SetItem(__pyx_v_table, __pyx_t_3, __pyx_t_12) < 0))) __PYX_ERR(1, 825, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "nltkor/tag/libs/networkconv.pyx":824
 *                 start_from += table.shape[1]
 * 
 *                 for token, deltas in zip(padded_sentence[i:], table_deltas):             # <<<<<<<<<<<<<<
 *                     table[token[j]] += deltas
 * 
*/
      }
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":818
 *         for i in range(self.word_window_size):
 * 
 *             for j, table in enumerate(self.feature_tables):             # <<<<<<<<<<<<<<
 *                 # this is the column for the i-th position in the window
 *                 # regarding features from the j-th table
*/
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":827
 *                     table[token[j]] += deltas
 * 
 *             dist_deltas = self.target_dist_deltas[:, dist_target_from : dist_target_from + self.target_dist_table.shape[1] ]             # <<<<<<<<<<<<<<
 *             pre_deltas = dist_deltas.take(np.arange(pre_dist), 0).sum(0)
 *             pos_deltas = dist_deltas.take(np.arange(-pos_dist, 0), 0).sum(0)
*/
    __pyx_t_1 = ((PyObject *)__pyx_v_self->target_dist_table);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_17 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_1)); if (unlikely(__pyx_t_17 == ((npy_intp *)0) && PyErr_Occurred())) __PYX_ERR(1, 827, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyLong_From_Py_intptr_t((__pyx_t_17[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 827, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyNumber_Add(__pyx_v_dist_target_from, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 827, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PySlice_New(__pyx_v_dist_target_from, __pyx_t_5, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 827, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 827, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(1, 827, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 827, __pyx_L1_error);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->target_dist_deltas), __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 827, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_dist_deltas, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":828
 * 
 *             dist_deltas = self.target_dist_deltas[:, dist_target_from : dist_target_from + self.target_dist_table.shape[1] ]
 *             pre_deltas = dist_deltas.take(np.arange(pre_dist), 0).sum(0)             # <<<<<<<<<<<<<<
 *             pos_deltas = dist_deltas.take(np.arange(-pos_dist, 0), 0).sum(0)
 *             self.target_dist_table[1:-1, :] += dist_deltas[pre_dist : -pos_dist]
*/
    __pyx_t_3 = __pyx_v_dist_deltas;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 828, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_arange); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 828, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_18);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_18))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_18);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_18);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_18, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_pre_dist};
      __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_18, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
      if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 828, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
    }
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_12, __pyx_mstate_global->__pyx_int_0};
      __pyx_t_11 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_take, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 828, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
    }
    __pyx_t_5 = __pyx_t_11;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_int_0};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_sum, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 828, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_pre_deltas, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":829
 *             dist_deltas = self.target_dist_deltas[:, dist_target_from : dist_target_from + self.target_dist_table.shape[1] ]
 *             pre_deltas = dist_deltas.take(np.arange(pre_dist), 0).sum(0)
 *             pos_deltas = dist_deltas.take(np.arange(-pos_dist, 0), 0).sum(0)             # <<<<<<<<<<<<<<
 *             self.target_dist_table[1:-1, :] += dist_deltas[pre_dist : -pos_dist]
 *             self.target_dist_table[0] += pre_deltas
*/
    __pyx_t_12 = __pyx_v_dist_deltas;
    __Pyx_INCREF(__pyx_t_12);
    __pyx_t_18 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_arange); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Negative(__pyx_v_pos_dist); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_15))) {
      __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_15);
      assert(__pyx_t_18);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_15);
      __Pyx_INCREF(__pyx_t_18);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_15, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_18, __pyx_t_4, __pyx_mstate_global->__pyx_int_0};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_3, __pyx_mstate_global->__pyx_int_0};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_take, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 829, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_11 = __pyx_t_5;
    __Pyx_INCREF(__pyx_t_11);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_mstate_global->__pyx_int_0};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_sum, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 829, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_pos_deltas, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":830
 *             pre_deltas = dist_deltas.take(np.arange(pre_dist), 0).sum(0)
 *             pos_deltas = dist_deltas.take(np.arange(-pos_dist, 0), 0).sum(0)
 *             self.target_dist_table[1:-1, :] += dist_deltas[pre_dist : -pos_dist]             # <<<<<<<<<<<<<<
 *             self.target_dist_table[0] += pre_deltas
 *             self.target_dist_table[-1] += pos_deltas
*/
    __Pyx_INCREF((PyObject *)__pyx_v_self->target_dist_table);
    __pyx_t_19 = __pyx_v_self->target_dist_table;
    __Pyx_INCREF(__pyx_mstate_global->__pyx_tuple[1]);
    __pyx_t_20 = __pyx_mstate_global->__pyx_tuple[1];
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_t_19), __pyx_t_20); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyNumber_Negative(__pyx_v_pos_dist); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_11 = __Pyx_PyObject_GetSlice(__pyx_v_dist_deltas, 0, 0, &__pyx_v_pre_dist, &__pyx_t_5, NULL, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_t_19), __pyx_t_20, __pyx_t_5) < 0))) __PYX_ERR(1, 830, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    __Pyx_DECREF((PyObject *)__pyx_t_19); __pyx_t_19 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":831
 *             pos_deltas = dist_deltas.take(np.arange(-pos_dist, 0), 0).sum(0)
 *             self.target_dist_table[1:-1, :] += dist_deltas[pre_dist : -pos_dist]
 *             self.target_dist_table[0] += pre_deltas             # <<<<<<<<<<<<<<
 *             self.target_dist_table[-1] += pos_deltas
 *             dist_target_from += self.target_dist_table.shape[1]
*/
    __Pyx_INCREF((PyObject *)__pyx_v_self->target_dist_table);
    __pyx_t_19 = __pyx_v_self->target_dist_table;
    __pyx_t_10 = 0;
    __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_t_19), __pyx_t_10, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 831, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_v_pre_deltas); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 831, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_t_19), __pyx_t_10, __pyx_t_11, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1) < 0))) __PYX_ERR(1, 831, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF((PyObject *)__pyx_t_19); __pyx_t_19 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":832
 *             self.target_dist_table[1:-1, :] += dist_deltas[pre_dist : -pos_dist]
 *             self.target_dist_table[0] += pre_deltas
 *             self.target_dist_table[-1] += pos_deltas             # <<<<<<<<<<<<<<
 *             dist_target_from += self.target_dist_table.shape[1]
 * 
*/
    __Pyx_INCREF((PyObject *)__pyx_v_self->target_dist_table);
    __pyx_t_19 = __pyx_v_self->target_dist_table;
    __pyx_t_10 = -1L;
    __pyx_t_11 = __Pyx_GetItemInt(((PyObject *)__pyx_t_19), __pyx_t_10, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 832, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_t_11, __pyx_v_pos_deltas); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 832, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_t_19), __pyx_t_10, __pyx_t_5, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1) < 0))) __PYX_ERR(1, 832, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF((PyObject *)__pyx_t_19); __pyx_t_19 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":833
 *             self.target_dist_table[0] += pre_deltas
 *             self.target_dist_table[-1] += pos_deltas
 *             dist_target_from += self.target_dist_table.shape[1]             # <<<<<<<<<<<<<<
 * 
 *             dist_deltas = self.pred_dist_deltas[:, dist_pred_from : dist_pred_from + self.pred_dist_table.shape[1] ]
*/
    __pyx_t_5 = ((PyObject *)__pyx_v_self->target_dist_table);
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_17 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_5)); if (unlikely(__pyx_t_17 == ((npy_intp *)0) && PyErr_Occurred())) __PYX_ERR(1, 833, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyLong_From_Py_intptr_t((__pyx_t_17[1])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 833, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_v_dist_target_from, __pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 833, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_dist_target_from, __pyx_t_11);
    __pyx_t_11 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":835
 *             dist_target_from += self.target_dist_table.shape[1]
 * 
 *             dist_deltas = self.pred_dist_deltas[:, dist_pred_from : dist_pred_from + self.pred_dist_table.shape[1] ]             # <<<<<<<<<<<<<<
 *             pre_deltas = dist_deltas.take(np.arange(pre_dist), 0).sum(0)
 *             pos_deltas = dist_deltas.take(np.arange(-pos_dist, 0), 0).sum(0)
*/
    __pyx_t_11 = ((PyObject *)__pyx_v_self->pred_dist_table);
    __Pyx_INCREF(__pyx_t_11);
    __pyx_t_17 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_11)); if (unlikely(__pyx_t_17 == ((npy_intp *)0) && PyErr_Occurred())) __PYX_ERR(1, 835, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = __Pyx_PyLong_From_Py_intptr_t((__pyx_t_17[1])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 835, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_5 = PyNumber_Add(__pyx_v_dist_pred_from, __pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 835, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = PySlice_New(__pyx_v_dist_pred_from, __pyx_t_5, Py_None); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 835, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 835, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(1, 835, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_11);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_11) != (0)) __PYX_ERR(1, 835, __pyx_L1_error);
    __pyx_t_11 = 0;
    __pyx_t_11 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->pred_dist_deltas), __pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 835, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_dist_deltas, __pyx_t_11);
    __pyx_t_11 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":836
 * 
 *             dist_deltas = self.pred_dist_deltas[:, dist_pred_from : dist_pred_from + self.pred_dist_table.shape[1] ]
 *             pre_deltas = dist_deltas.take(np.arange(pre_dist), 0).sum(0)             # <<<<<<<<<<<<<<
 *             pos_deltas = dist_deltas.take(np.arange(-pos_dist, 0), 0).sum(0)
 *             self.pred_dist_table[1:-1, :] += dist_deltas[pre_dist : -pos_dist]
*/
    __pyx_t_3 = __pyx_v_dist_deltas;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_15 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_arange); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 836, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_18);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_18))) {
      __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_18);
      assert(__pyx_t_15);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_18);
      __Pyx_INCREF(__pyx_t_15);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_18, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_v_pre_dist};
      __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_18, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
      if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 836, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
    }
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_12, __pyx_mstate_global->__pyx_int_0};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_take, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 836, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_5 = __pyx_t_1;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_int_0};
      __pyx_t_11 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_sum, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 836, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
    }
    __Pyx_DECREF_SET(__pyx_v_pre_deltas, __pyx_t_11);
    __pyx_t_11 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":837
 *             dist_deltas = self.pred_dist_deltas[:, dist_pred_from : dist_pred_from + self.pred_dist_table.shape[1] ]
 *             pre_deltas = dist_deltas.take(np.arange(pre_dist), 0).sum(0)
 *             pos_deltas = dist_deltas.take(np.arange(-pos_dist, 0), 0).sum(0)             # <<<<<<<<<<<<<<
 *             self.pred_dist_table[1:-1, :] += dist_deltas[pre_dist : -pos_dist]
 *             self.pred_dist_table[0] += pre_deltas
*/
    __pyx_t_12 = __pyx_v_dist_deltas;
    __Pyx_INCREF(__pyx_t_12);
    __pyx_t_18 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 837, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_arange); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __pyx_t_15 = PyNumber_Negative(__pyx_v_pos_dist); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 837, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_18);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_18);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_18, __pyx_t_15, __pyx_mstate_global->__pyx_int_0};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_3, __pyx_mstate_global->__pyx_int_0};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_take, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 837, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_1 = __pyx_t_5;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_int_0};
      __pyx_t_11 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_sum, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 837, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
    }
    __Pyx_DECREF_SET(__pyx_v_pos_deltas, __pyx_t_11);
    __pyx_t_11 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":838
 *             pre_deltas = dist_deltas.take(np.arange(pre_dist), 0).sum(0)
 *             pos_deltas = dist_deltas.take(np.arange(-pos_dist, 0), 0).sum(0)
 *             self.pred_dist_table[1:-1, :] += dist_deltas[pre_dist : -pos_dist]             # <<<<<<<<<<<<<<
 *             self.pred_dist_table[0] += pre_deltas
 *             self.pred_dist_table[-1] += pos_deltas
*/
    __Pyx_INCREF((PyObject *)__pyx_v_self->pred_dist_table);
    __pyx_t_19 = __pyx_v_self->pred_dist_table;
    __Pyx_INCREF(__pyx_mstate_global->__pyx_tuple[1]);
    __pyx_t_20 = __pyx_mstate_global->__pyx_tuple[1];
    __pyx_t_11 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_t_19), __pyx_t_20); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 838, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_5 = PyNumber_Negative(__pyx_v_pos_dist); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 838, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_dist_deltas, 0, 0, &__pyx_v_pre_dist, &__pyx_t_5, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 838, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_t_11, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 838, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_t_19), __pyx_t_20, __pyx_t_5) < 0))) __PYX_ERR(1, 838, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    __Pyx_DECREF((PyObject *)__pyx_t_19); __pyx_t_19 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":839
 *             pos_deltas = dist_deltas.take(np.arange(-pos_dist, 0), 0).sum(0)
 *             self.pred_dist_table[1:-1, :] += dist_deltas[pre_dist : -pos_dist]
 *             self.pred_dist_table[0] += pre_deltas             # <<<<<<<<<<<<<<
 *             self.pred_dist_table[-1] += pos_deltas
 * 
*/
    __Pyx_INCREF((PyObject *)__pyx_v_self->pred_dist_table);
    __pyx_t_19 = __pyx_v_self->pred_dist_table;
    __pyx_t_10 = 0;
    __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_t_19), __pyx_t_10, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 839, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_v_pre_deltas); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 839, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_t_19), __pyx_t_10, __pyx_t_1, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1) < 0))) __PYX_ERR(1, 839, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF((PyObject *)__pyx_t_19); __pyx_t_19 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":840
 *             self.pred_dist_table[1:-1, :] += dist_deltas[pre_dist : -pos_dist]
 *             self.pred_dist_table[0] += pre_deltas
 *             self.pred_dist_table[-1] += pos_deltas             # <<<<<<<<<<<<<<
 * 
 *             pre_dist -= 1
*/
    __Pyx_INCREF((PyObject *)__pyx_v_self->pred_dist_table);
    __pyx_t_19 = __pyx_v_self->pred_dist_table;
    __pyx_t_10 = -1L;
    __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_t_19), __pyx_t_10, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 840, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_pos_deltas); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 840, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_t_19), __pyx_t_10, __pyx_t_5, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1) < 0))) __PYX_ERR(1, 840, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF((PyObject *)__pyx_t_19); __pyx_t_19 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":842
 *             self.pred_dist_table[-1] += pos_deltas
 * 
 *             pre_dist -= 1             # <<<<<<<<<<<<<<
 *             pos_dist += 1
 *             dist_pred_from += self.pred_dist_table.shape[1]
*/
    __pyx_t_5 = __Pyx_PyLong_SubtractObjC(__pyx_v_pre_dist, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 842, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_pre_dist, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":843
 * 
 *             pre_dist -= 1
 *             pos_dist += 1             # <<<<<<<<<<<<<<
 *             dist_pred_from += self.pred_dist_table.shape[1]
 * 
*/
    __pyx_t_5 = __Pyx_PyLong_AddObjC(__pyx_v_pos_dist, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 843, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_pos_dist, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":844
 *             pre_dist -= 1
 *             pos_dist += 1
 *             dist_pred_from += self.pred_dist_table.shape[1]             # <<<<<<<<<<<<<<
 * 
 *         self._create_target_lookup()
*/
    __pyx_t_5 = ((PyObject *)__pyx_v_self->pred_dist_table);
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_17 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_5)); if (unlikely(__pyx_t_17 == ((npy_intp *)0) && PyErr_Occurred())) __PYX_ERR(1, 844, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyLong_From_Py_intptr_t((__pyx_t_17[1])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 844, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_dist_pred_from, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 844, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_dist_pred_from, __pyx_t_1);
    __pyx_t_1 = 0;
  }

  /* "nltkor/tag/libs/networkconv.pyx":846
 *             dist_pred_from += self.pred_dist_table.shape[1]
 * 
 *         self._create_target_lookup()             # <<<<<<<<<<<<<<
 *         self._create_pred_lookup()
 * 
*/
  __pyx_t_5 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_create_target_lookup, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 846, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":847
 * 
 *         self._create_target_lookup()
 *         self._create_pred_lookup()             # <<<<<<<<<<<<<<
 * 
 *     @cython.boundscheck(False)
*/
  __pyx_t_5 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_create_pred_lookup, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 847, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":797
 * 
 * 
 *     def _adjust_features(self, sentence, predicate):             # <<<<<<<<<<<<<<
 *         """Adjusts the features in all feature tables."""
 *         # compute each token in the window separately and
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 797, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF((PyObject *)__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 797, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._adjust_features", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_start_from);
  __Pyx_XDECREF(__pyx_v_dist_target_from);
  __Pyx_XDECREF(__pyx_v_dist_pred_from);
  __Pyx_XDECREF(__pyx_v_pre_dist);
  __Pyx_XDECREF(__pyx_v_pos_dist);
  __Pyx_XDECREF(__pyx_v_padded_sentence);
  __Pyx_XDECREF(__pyx_v_j);
  __Pyx_XDECREF(__pyx_v_table);
  __Pyx_XDECREF(__pyx_v_table_deltas);
  __Pyx_XDECREF(__pyx_v_token);
  __Pyx_XDECREF(__pyx_v_deltas);
  __Pyx_XDECREF(__pyx_v_dist_deltas);
  __Pyx_XDECREF(__pyx_v_pre_deltas);
  __Pyx_XDECREF(__pyx_v_pos_deltas);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":849
 *         self._create_pred_lookup()
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     def _viterbi(self, np.ndarray[FLOAT_t, ndim=2] scores, bool allow_repeats=True):
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_49_viterbi(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_48_viterbi, "ConvolutionalNetwork._viterbi(self, ndarray scores, bool allow_repeats=True)\nPerforms a Viterbi search over the scores for each tag using\nthe transitions matrix. If a matrix wasn't supplied, \nit will return the tags with the highest scores individually.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_49_viterbi = {"_viterbi", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_49_viterbi, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_48_viterbi};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_49_viterbi(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyArrayObject *__pyx_v_scores = 0;
  PyLongObject *__pyx_v_allow_repeats = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_viterbi (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_scores,&__pyx_mstate_global->__pyx_n_u_allow_repeats,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 849, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 849, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 849, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_viterbi", 0) < 0) __PYX_ERR(1, 849, __pyx_L3_error)

      /* "nltkor/tag/libs/networkconv.pyx":850
 * 
 *     @cython.boundscheck(False)
 *     def _viterbi(self, np.ndarray[FLOAT_t, ndim=2] scores, bool allow_repeats=True):             # <<<<<<<<<<<<<<
 *         """
 *         Performs a Viterbi search over the scores for each tag using
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((PyLongObject *)Py_True));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_viterbi", 0, 1, 2, i); __PYX_ERR(1, 849, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 849, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 849, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((PyLongObject *)Py_True));
    }
    __pyx_v_scores = ((PyArrayObject *)values[0]);
    __pyx_v_allow_repeats = ((PyLongObject *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_viterbi", 0, 1, 2, __pyx_nargs); __PYX_ERR(1, 849, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._viterbi", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_scores), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "scores", 0))) __PYX_ERR(1, 850, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_allow_repeats), __pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool, 1, "allow_repeats", 0))) __PYX_ERR(1, 850, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_48_viterbi(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v_scores, __pyx_v_allow_repeats);

  /* "nltkor/tag/libs/networkconv.pyx":849
 *         self._create_pred_lookup()
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     def _viterbi(self, np.ndarray[FLOAT_t, ndim=2] scores, bool allow_repeats=True):
 *         """
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_48_viterbi(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyArrayObject *__pyx_v_scores, PyLongObject *__pyx_v_allow_repeats) {
  PyObject *__pyx_v_best_scores = NULL;
  PyObject *__pyx_v_logadd = NULL;
  PyObject *__pyx_v_logprobs = NULL;
  PyObject *__pyx_v_counts = NULL;
  PyObject *__pyx_v_conflicting_tag = NULL;
  PyObject *__pyx_v_args = NULL;
  PyObject *__pyx_v_conflicting_probs = NULL;
  PyObject *__pyx_v_highest_prob_arg = NULL;
  PyObject *__pyx_v_other_args = NULL;
  PyObject *__pyx_v_path_scores = NULL;
  PyObject *__pyx_v_path_backtrack = NULL;
  PyObject *__pyx_v_i = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_token = NULL;
  PyObject *__pyx_v_prev_score_and_trans = NULL;
  PyObject *__pyx_v_answer = NULL;
  PyObject *__pyx_v_previous_tag = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_scores;
  __Pyx_Buffer __pyx_pybuffer_scores;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  Py_ssize_t __pyx_t_14;
  PyObject *(*__pyx_t_15)(PyObject *);
  float __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[107]))
  __Pyx_RefNannySetupContext("_viterbi", 0);
  __Pyx_TraceStartFunc("_viterbi", __pyx_f[1], 849, 0, 0, 0, __PYX_ERR(1, 849, __pyx_L1_error));
  __pyx_pybuffer_scores.pybuffer.buf = NULL;
  __pyx_pybuffer_scores.refcount = 0;
  __pyx_pybuffernd_scores.data = NULL;
  __pyx_pybuffernd_scores.rcbuffer = &__pyx_pybuffer_scores;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_scores.rcbuffer->pybuffer, (PyObject*)__pyx_v_scores, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(1, 849, __pyx_L1_error)
  }
  __pyx_pybuffernd_scores.diminfo[0].strides = __pyx_pybuffernd_scores.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_scores.diminfo[0].shape = __pyx_pybuffernd_scores.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_scores.diminfo[1].strides = __pyx_pybuffernd_scores.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_scores.diminfo[1].shape = __pyx_pybuffernd_scores.rcbuffer->pybuffer.shape[1];

  /* "nltkor/tag/libs/networkconv.pyx":856
 *         it will return the tags with the highest scores individually.
 *         """
 *         if self.transitions is None:             # <<<<<<<<<<<<<<
 *             best_scores = scores.argmax(1)
 * 
*/
  __pyx_t_1 = (((PyObject *)__pyx_v_self->__pyx_base.transitions) == Py_None);
  if (__pyx_t_1) {

    /* "nltkor/tag/libs/networkconv.pyx":857
 *         """
 *         if self.transitions is None:
 *             best_scores = scores.argmax(1)             # <<<<<<<<<<<<<<
 * 
 *             if allow_repeats:
*/
    __pyx_t_3 = ((PyObject *)__pyx_v_scores);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_int_1};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_argmax, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 857, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_v_best_scores = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":859
 *             best_scores = scores.argmax(1)
 * 
 *             if allow_repeats:             # <<<<<<<<<<<<<<
 *                 return best_scores
 * 
*/
    __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_allow_repeats)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 859, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "nltkor/tag/libs/networkconv.pyx":860
 * 
 *             if allow_repeats:
 *                 return best_scores             # <<<<<<<<<<<<<<
 * 
 *             # we must find the combination of tags that maximizes the probabilities
*/
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_best_scores);
      __pyx_r = __pyx_v_best_scores;
      __Pyx_TraceReturnValue(__pyx_r, 14, 0, __PYX_ERR(1, 860, __pyx_L1_error));
      goto __pyx_L0;

      /* "nltkor/tag/libs/networkconv.pyx":859
 *             best_scores = scores.argmax(1)
 * 
 *             if allow_repeats:             # <<<<<<<<<<<<<<
 *                 return best_scores
 * 
*/
    }

    /* "nltkor/tag/libs/networkconv.pyx":863
 * 
 *             # we must find the combination of tags that maximizes the probabilities
 *             logadd = np.log(np.sum(np.exp(scores), 1))             # <<<<<<<<<<<<<<
 *             logprobs = (scores.T - logadd).T
 *             counts = np.bincount(best_scores)
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_log); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_sum); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_10 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_exp); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_4 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12);
      assert(__pyx_t_10);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
      __pyx_t_4 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, ((PyObject *)__pyx_v_scores)};
      __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 863, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
    }
    __pyx_t_4 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
      assert(__pyx_t_7);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
      __pyx_t_4 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_8, __pyx_mstate_global->__pyx_int_1};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 863, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_4 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_4 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 863, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_v_logadd = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":864
 *             # we must find the combination of tags that maximizes the probabilities
 *             logadd = np.log(np.sum(np.exp(scores), 1))
 *             logprobs = (scores.T - logadd).T             # <<<<<<<<<<<<<<
 *             counts = np.bincount(best_scores)
 * 
*/
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_scores), __pyx_mstate_global->__pyx_n_u_T); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 864, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_v_logadd); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 864, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_T); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 864, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_logprobs = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":865
 *             logadd = np.log(np.sum(np.exp(scores), 1))
 *             logprobs = (scores.T - logadd).T
 *             counts = np.bincount(best_scores)             # <<<<<<<<<<<<<<
 * 
 *             while counts.max() != 1:
*/
    __pyx_t_6 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 865, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_bincount); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 865, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_4 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_6);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_4 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_best_scores};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 865, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_v_counts = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":867
 *             counts = np.bincount(best_scores)
 * 
 *             while counts.max() != 1:             # <<<<<<<<<<<<<<
 *                 # find the tag with the most conflicting args
 *                 conflicting_tag = counts.argmax()
*/
    while (1) {
      __pyx_t_3 = __pyx_v_counts;
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_4 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_max, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 867, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_1 = (__Pyx_PyLong_BoolNeObjC(__pyx_t_2, __pyx_mstate_global->__pyx_int_1, 1, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 867, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (!__pyx_t_1) break;

      /* "nltkor/tag/libs/networkconv.pyx":869
 *             while counts.max() != 1:
 *                 # find the tag with the most conflicting args
 *                 conflicting_tag = counts.argmax()             # <<<<<<<<<<<<<<
 * 
 *                 # arguments with that tag as current maximum
*/
      __pyx_t_3 = __pyx_v_counts;
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_4 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_argmax, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 869, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_v_conflicting_tag, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":872
 * 
 *                 # arguments with that tag as current maximum
 *                 args = np.where(best_scores == conflicting_tag)[0]             # <<<<<<<<<<<<<<
 * 
 *                 # get the logprobs for those args having this tag
*/
      __pyx_t_3 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 872, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_where); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 872, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_RichCompare(__pyx_v_best_scores, __pyx_v_conflicting_tag, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 872, __pyx_L1_error)
      __pyx_t_4 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
        assert(__pyx_t_3);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
        __pyx_t_4 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_6};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 872, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 872, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_args, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":875
 * 
 *                 # get the logprobs for those args having this tag
 *                 conflicting_probs = logprobs[args, conflicting_tag]             # <<<<<<<<<<<<<<
 * 
 *                 # find the argument with the highest probability for that tag
*/
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 875, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_v_args);
      __Pyx_GIVEREF(__pyx_v_args);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_args) != (0)) __PYX_ERR(1, 875, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_conflicting_tag);
      __Pyx_GIVEREF(__pyx_v_conflicting_tag);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_conflicting_tag) != (0)) __PYX_ERR(1, 875, __pyx_L1_error);
      __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_logprobs, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 875, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF_SET(__pyx_v_conflicting_probs, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":878
 * 
 *                 # find the argument with the highest probability for that tag
 *                 highest_prob_arg = args[conflicting_probs.argmax()]             # <<<<<<<<<<<<<<
 * 
 *                 # set the score for other arguments in that tag to a low value
*/
      __pyx_t_5 = __pyx_v_conflicting_probs;
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_4 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_argmax, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 878, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_args, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 878, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_highest_prob_arg, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":881
 * 
 *                 # set the score for other arguments in that tag to a low value
 *                 other_args = args[args != highest_prob_arg]             # <<<<<<<<<<<<<<
 *                 scores[other_args, conflicting_tag] = -1000
 * 
*/
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_args, __pyx_v_highest_prob_arg, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 881, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_args, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 881, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF_SET(__pyx_v_other_args, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":882
 *                 # set the score for other arguments in that tag to a low value
 *                 other_args = args[args != highest_prob_arg]
 *                 scores[other_args, conflicting_tag] = -1000             # <<<<<<<<<<<<<<
 * 
 *                 # and find the new maxes, without recalculating probabilities
*/
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 882, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_other_args);
      __Pyx_GIVEREF(__pyx_v_other_args);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_other_args) != (0)) __PYX_ERR(1, 882, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_conflicting_tag);
      __Pyx_GIVEREF(__pyx_v_conflicting_tag);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_conflicting_tag) != (0)) __PYX_ERR(1, 882, __pyx_L1_error);
      if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_scores), __pyx_t_2, __pyx_mstate_global->__pyx_int_neg_1000) < 0))) __PYX_ERR(1, 882, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":885
 * 
 *                 # and find the new maxes, without recalculating probabilities
 *                 best_scores = scores.argmax(1)             # <<<<<<<<<<<<<<
 *                 counts = np.bincount(best_scores)
 * 
*/
      __pyx_t_5 = ((PyObject *)__pyx_v_scores);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_4 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_int_1};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_argmax, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 885, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_DECREF_SET(__pyx_v_best_scores, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":886
 *                 # and find the new maxes, without recalculating probabilities
 *                 best_scores = scores.argmax(1)
 *                 counts = np.bincount(best_scores)             # <<<<<<<<<<<<<<
 * 
 *             return best_scores
*/
      __pyx_t_5 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 886, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_bincount); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 886, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_4 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
        assert(__pyx_t_5);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
        __pyx_t_4 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_best_scores};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 886, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_DECREF_SET(__pyx_v_counts, __pyx_t_2);
      __pyx_t_2 = 0;
    }

    /* "nltkor/tag/libs/networkconv.pyx":888
 *                 counts = np.bincount(best_scores)
 * 
 *             return best_scores             # <<<<<<<<<<<<<<
 * 
 *         path_scores = np.empty_like(scores)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_best_scores);
    __pyx_r = __pyx_v_best_scores;
    __Pyx_TraceReturnValue(__pyx_r, 90, 0, __PYX_ERR(1, 888, __pyx_L1_error));
    goto __pyx_L0;

    /* "nltkor/tag/libs/networkconv.pyx":856
 *         it will return the tags with the highest scores individually.
 *         """
 *         if self.transitions is None:             # <<<<<<<<<<<<<<
 *             best_scores = scores.argmax(1)
 * 
*/
  }

  /* "nltkor/tag/libs/networkconv.pyx":890
 *             return best_scores
 * 
 *         path_scores = np.empty_like(scores)             # <<<<<<<<<<<<<<
 *         path_backtrack = np.empty_like(scores, int)
 *         #path_backtrack = np.empty_like(scores, np.int)
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 890, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty_like); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 890, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_scores)};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 890, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_path_scores = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":891
 * 
 *         path_scores = np.empty_like(scores)
 *         path_backtrack = np.empty_like(scores, int)             # <<<<<<<<<<<<<<
 *         #path_backtrack = np.empty_like(scores, np.int)
 * 
*/
  __pyx_t_6 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_empty_like); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_6);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_6, ((PyObject *)__pyx_v_scores), ((PyObject *)(&PyLong_Type))};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 891, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_path_backtrack = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":897
 *         # first, get the scores for each tag at token 0
 *         # the last row of the transitions table has the scores for the first tag
 *         path_scores[0] = scores[0] + self.transitions[-1]             # <<<<<<<<<<<<<<
 * 
 *         for i, token in enumerate(scores[1:], 1):
*/
  __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_scores), 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->__pyx_base.transitions), -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely((__Pyx_SetItemInt(__pyx_v_path_scores, 0, __pyx_t_6, long, 1, __Pyx_PyLong_From_long, 0, 0, 0) < 0))) __PYX_ERR(1, 897, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":899
 *         path_scores[0] = scores[0] + self.transitions[-1]
 * 
 *         for i, token in enumerate(scores[1:], 1):             # <<<<<<<<<<<<<<
 * 
 *             # each line contains the score until each tag t plus the transition to each other tag t'
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
  __pyx_t_13 = __pyx_mstate_global->__pyx_int_1;
  __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_scores), __pyx_mstate_global->__pyx_slice[4]); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
    __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5);
    __pyx_t_14 = 0;
    __pyx_t_15 = NULL;
  } else {
    __pyx_t_14 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 899, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 899, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  for (;;) {
    if (likely(!__pyx_t_15)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 899, __pyx_L1_error)
          #endif
          if (__pyx_t_14 >= __pyx_temp) break;
        }
        __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_14);
        ++__pyx_t_14;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 899, __pyx_L1_error)
          #endif
          if (__pyx_t_14 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_14));
        #else
        __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_14);
        #endif
        ++__pyx_t_14;
      }
      if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 899, __pyx_L1_error)
    } else {
      __pyx_t_6 = __pyx_t_15(__pyx_t_5);
      if (unlikely(!__pyx_t_6)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 899, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_token, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_INCREF(__pyx_t_13);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_13);
    __pyx_t_6 = __Pyx_PyLong_AddObjC(__pyx_t_13, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 899, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_13);
    __pyx_t_13 = ((PyObject*)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":902
 * 
 *             # each line contains the score until each tag t plus the transition to each other tag t'
 *             prev_score_and_trans = (path_scores[i - 1] + self.transitions[:-1].T).T             # <<<<<<<<<<<<<<
 * 
 *             # find the previous tag that yielded the max score
*/
    __pyx_t_6 = __Pyx_PyLong_SubtractObjC(__pyx_v_i, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_path_scores, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->__pyx_base.transitions), 0, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_T); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_T); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_prev_score_and_trans, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":905
 * 
 *             # find the previous tag that yielded the max score
 *             path_backtrack[i] = prev_score_and_trans.argmax(0)             # <<<<<<<<<<<<<<
 *             path_scores[i] = prev_score_and_trans[path_backtrack[i],
 *                                                   np.arange(self.output_size)] + scores[i]
*/
    __pyx_t_6 = __pyx_v_prev_score_and_trans;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_int_0};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_argmax, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 905, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    if (unlikely((PyObject_SetItem(__pyx_v_path_backtrack, __pyx_v_i, __pyx_t_3) < 0))) __PYX_ERR(1, 905, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":906
 *             # find the previous tag that yielded the max score
 *             path_backtrack[i] = prev_score_and_trans.argmax(0)
 *             path_scores[i] = prev_score_and_trans[path_backtrack[i],             # <<<<<<<<<<<<<<
 *                                                   np.arange(self.output_size)] + scores[i]
 * 
*/
    __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_path_backtrack, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 906, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "nltkor/tag/libs/networkconv.pyx":907
 *             path_backtrack[i] = prev_score_and_trans.argmax(0)
 *             path_scores[i] = prev_score_and_trans[path_backtrack[i],
 *                                                   np.arange(self.output_size)] + scores[i]             # <<<<<<<<<<<<<<
 * 
 *         # now find the maximum score for the last token and follow the backtrack
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 907, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_arange); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 907, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.output_size); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 907, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_4 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
      __pyx_t_4 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_9};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 907, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }

    /* "nltkor/tag/libs/networkconv.pyx":906
 *             # find the previous tag that yielded the max score
 *             path_backtrack[i] = prev_score_and_trans.argmax(0)
 *             path_scores[i] = prev_score_and_trans[path_backtrack[i],             # <<<<<<<<<<<<<<
 *                                                   np.arange(self.output_size)] + scores[i]
 * 
*/
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 906, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3) != (0)) __PYX_ERR(1, 906, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6) != (0)) __PYX_ERR(1, 906, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_prev_score_and_trans, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 906, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":907
 *             path_backtrack[i] = prev_score_and_trans.argmax(0)
 *             path_scores[i] = prev_score_and_trans[path_backtrack[i],
 *                                                   np.arange(self.output_size)] + scores[i]             # <<<<<<<<<<<<<<
 * 
 *         # now find the maximum score for the last token and follow the backtrack
*/
    __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_scores), __pyx_v_i); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 907, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = PyNumber_Add(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 907, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":906
 *             # find the previous tag that yielded the max score
 *             path_backtrack[i] = prev_score_and_trans.argmax(0)
 *             path_scores[i] = prev_score_and_trans[path_backtrack[i],             # <<<<<<<<<<<<<<
 *                                                   np.arange(self.output_size)] + scores[i]
 * 
*/
    if (unlikely((PyObject_SetItem(__pyx_v_path_scores, __pyx_v_i, __pyx_t_3) < 0))) __PYX_ERR(1, 906, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":899
 *         path_scores[0] = scores[0] + self.transitions[-1]
 * 
 *         for i, token in enumerate(scores[1:], 1):             # <<<<<<<<<<<<<<
 * 
 *             # each line contains the score until each tag t plus the transition to each other tag t'
*/
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":910
 * 
 *         # now find the maximum score for the last token and follow the backtrack
 *         answer = np.empty(len(scores), dtype=int)             # <<<<<<<<<<<<<<
 *         #answer = np.empty(len(scores), dtype=np.int)
 *         answer[-1] = path_scores[-1].argmax()
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_scores)); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(1, 910, __pyx_L1_error)
  __pyx_t_8 = PyLong_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_8};
    __pyx_t_9 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 910, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, ((PyObject *)(&PyLong_Type)), __pyx_t_9, __pyx_callargs+2, 0) < 0) __PYX_ERR(1, 910, __pyx_L1_error)
    __pyx_t_5 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 910, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __pyx_v_answer = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":912
 *         answer = np.empty(len(scores), dtype=int)
 *         #answer = np.empty(len(scores), dtype=np.int)
 *         answer[-1] = path_scores[-1].argmax()             # <<<<<<<<<<<<<<
 *         self.answer_score = path_scores[-1][answer[-1]]
 *         previous_tag = path_backtrack[-1][answer[-1]]
*/
  __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_path_scores, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_6 = __pyx_t_9;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_argmax, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 912, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  if (unlikely((__Pyx_SetItemInt(__pyx_v_answer, -1L, __pyx_t_5, long, 1, __Pyx_PyLong_From_long, 0, 1, 0) < 0))) __PYX_ERR(1, 912, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":913
 *         #answer = np.empty(len(scores), dtype=np.int)
 *         answer[-1] = path_scores[-1].argmax()
 *         self.answer_score = path_scores[-1][answer[-1]]             # <<<<<<<<<<<<<<
 *         previous_tag = path_backtrack[-1][answer[-1]]
 * 
*/
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_path_scores, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_answer, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_16 = __Pyx_PyFloat_AsFloat(__pyx_t_6); if (unlikely((__pyx_t_16 == (float)-1) && PyErr_Occurred())) __PYX_ERR(1, 913, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_self->__pyx_base.answer_score = __pyx_t_16;

  /* "nltkor/tag/libs/networkconv.pyx":914
 *         answer[-1] = path_scores[-1].argmax()
 *         self.answer_score = path_scores[-1][answer[-1]]
 *         previous_tag = path_backtrack[-1][answer[-1]]             # <<<<<<<<<<<<<<
 * 
 *         for i in range(len(scores) - 2, 0, -1):
*/
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_path_backtrack, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_answer, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_v_previous_tag = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":916
 *         previous_tag = path_backtrack[-1][answer[-1]]
 * 
 *         for i in range(len(scores) - 2, 0, -1):             # <<<<<<<<<<<<<<
 *             answer[i] = previous_tag
 *             previous_tag = path_backtrack[i][previous_tag]
*/
  __pyx_t_9 = NULL;
  __Pyx_INCREF(__pyx_builtin_range);
  __pyx_t_6 = __pyx_builtin_range; 
  __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_scores)); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(1, 916, __pyx_L1_error)
  __pyx_t_8 = PyLong_FromSsize_t((__pyx_t_14 - 2)); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_t_8, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_neg_1};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_4, (4-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 916, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6);
    __pyx_t_14 = 0;
    __pyx_t_15 = NULL;
  } else {
    __pyx_t_14 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 916, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 916, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_15)) {
      if (likely(PyList_CheckExact(__pyx_t_6))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 916, __pyx_L1_error)
          #endif
          if (__pyx_t_14 >= __pyx_temp) break;
        }
        __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_14);
        ++__pyx_t_14;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 916, __pyx_L1_error)
          #endif
          if (__pyx_t_14 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_14));
        #else
        __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_14);
        #endif
        ++__pyx_t_14;
      }
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 916, __pyx_L1_error)
    } else {
      __pyx_t_5 = __pyx_t_15(__pyx_t_6);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 916, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":917
 * 
 *         for i in range(len(scores) - 2, 0, -1):
 *             answer[i] = previous_tag             # <<<<<<<<<<<<<<
 *             previous_tag = path_backtrack[i][previous_tag]
 * 
*/
    if (unlikely((PyObject_SetItem(__pyx_v_answer, __pyx_v_i, __pyx_v_previous_tag) < 0))) __PYX_ERR(1, 917, __pyx_L1_error)

    /* "nltkor/tag/libs/networkconv.pyx":918
 *         for i in range(len(scores) - 2, 0, -1):
 *             answer[i] = previous_tag
 *             previous_tag = path_backtrack[i][previous_tag]             # <<<<<<<<<<<<<<
 * 
 *         answer[0] = previous_tag
*/
    __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_path_backtrack, __pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 918, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_v_previous_tag); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 918, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_previous_tag, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":916
 *         previous_tag = path_backtrack[-1][answer[-1]]
 * 
 *         for i in range(len(scores) - 2, 0, -1):             # <<<<<<<<<<<<<<
 *             answer[i] = previous_tag
 *             previous_tag = path_backtrack[i][previous_tag]
*/
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":920
 *             previous_tag = path_backtrack[i][previous_tag]
 * 
 *         answer[0] = previous_tag             # <<<<<<<<<<<<<<
 *         return answer
 * 
*/
  if (unlikely((__Pyx_SetItemInt(__pyx_v_answer, 0, __pyx_v_previous_tag, long, 1, __Pyx_PyLong_From_long, 0, 0, 0) < 0))) __PYX_ERR(1, 920, __pyx_L1_error)

  /* "nltkor/tag/libs/networkconv.pyx":921
 * 
 *         answer[0] = previous_tag
 *         return answer             # <<<<<<<<<<<<<<
 * 
 *     def _create_target_lookup(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_answer);
  __pyx_r = __pyx_v_answer;
  __Pyx_TraceReturnValue(__pyx_r, 219, 0, __PYX_ERR(1, 921, __pyx_L1_error));
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkconv.pyx":849
 *         self._create_pred_lookup()
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     def _viterbi(self, np.ndarray[FLOAT_t, ndim=2] scores, bool allow_repeats=True):
 *         """
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_scores.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 849, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._viterbi", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_scores.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_best_scores);
  __Pyx_XDECREF(__pyx_v_logadd);
  __Pyx_XDECREF(__pyx_v_logprobs);
  __Pyx_XDECREF(__pyx_v_counts);
  __Pyx_XDECREF(__pyx_v_conflicting_tag);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_conflicting_probs);
  __Pyx_XDECREF(__pyx_v_highest_prob_arg);
  __Pyx_XDECREF(__pyx_v_other_args);
  __Pyx_XDECREF(__pyx_v_path_scores);
  __Pyx_XDECREF(__pyx_v_path_backtrack);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_token);
  __Pyx_XDECREF(__pyx_v_prev_score_and_trans);
  __Pyx_XDECREF(__pyx_v_answer);
  __Pyx_XDECREF(__pyx_v_previous_tag);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":923
 *         return answer
 * 
 *     def _create_target_lookup(self):             # <<<<<<<<<<<<<<
 *         """
 *         Creates a lookup table with the window value for each different distance
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_51_create_target_lookup(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_50_create_target_lookup, "ConvolutionalNetwork._create_target_lookup(self)\nCreates a lookup table with the window value for each different distance\nto the target token (target_dist_lookup) and one with the precomputed\nvalues in the convolution layer (target_convolution_lookup). ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_51_create_target_lookup = {"_create_target_lookup", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_51_create_target_lookup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_50_create_target_lookup};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_51_create_target_lookup(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_create_target_lookup (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_create_target_lookup", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_create_target_lookup", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_50_create_target_lookup(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_50_create_target_lookup(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_v_num_distances = NULL;
  PyObject *__pyx_v_window_from = NULL;
  PyObject *__pyx_v_window_to = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_shift = NULL;
  PyObject *__pyx_v_inds = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  npy_intp *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[108]))
  __Pyx_RefNannySetupContext("_create_target_lookup", 0);
  __Pyx_TraceStartFunc("_create_target_lookup", __pyx_f[1], 923, 0, 0, 0, __PYX_ERR(1, 923, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":931
 *         # consider padding. if the table has 10 entries, with a word window of 3,
 *         # we would have to consider up to the distance of 11, because of the padding.
 *         num_distances = self.target_dist_table.shape[0] + self.word_window_size - 1             # <<<<<<<<<<<<<<
 *         self.target_dist_lookup = np.empty((num_distances,
 *                                             self.word_window_size * self.target_dist_table.shape[1]))
*/
  __pyx_t_1 = ((PyObject *)__pyx_v_self->target_dist_table);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((npy_intp *)0) && PyErr_Occurred())) __PYX_ERR(1, 931, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyLong_From_long((((__pyx_t_2[0]) + __pyx_v_self->__pyx_base.word_window_size) - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 931, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_num_distances = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":932
 *         # we would have to consider up to the distance of 11, because of the padding.
 *         num_distances = self.target_dist_table.shape[0] + self.word_window_size - 1
 *         self.target_dist_lookup = np.empty((num_distances,             # <<<<<<<<<<<<<<
 *                                             self.word_window_size * self.target_dist_table.shape[1]))
 *         self.target_dist_offset = num_distances / 2
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":933
 *         num_distances = self.target_dist_table.shape[0] + self.word_window_size - 1
 *         self.target_dist_lookup = np.empty((num_distances,
 *                                             self.word_window_size * self.target_dist_table.shape[1]))             # <<<<<<<<<<<<<<
 *         self.target_dist_offset = num_distances / 2
 *         window_from = 0
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_self->target_dist_table);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_4)); if (unlikely(__pyx_t_2 == ((npy_intp *)0) && PyErr_Occurred())) __PYX_ERR(1, 933, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyLong_From_Py_intptr_t((__pyx_v_self->__pyx_base.word_window_size * (__pyx_t_2[1]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "nltkor/tag/libs/networkconv.pyx":932
 *         # we would have to consider up to the distance of 11, because of the padding.
 *         num_distances = self.target_dist_table.shape[0] + self.word_window_size - 1
 *         self.target_dist_lookup = np.empty((num_distances,             # <<<<<<<<<<<<<<
 *                                             self.word_window_size * self.target_dist_table.shape[1]))
 *         self.target_dist_offset = num_distances / 2
*/
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_v_num_distances);
  __Pyx_GIVEREF(__pyx_v_num_distances);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_num_distances) != (0)) __PYX_ERR(1, 932, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4) != (0)) __PYX_ERR(1, 932, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 932, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 932, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->target_dist_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v_self->target_dist_lookup);
  __pyx_v_self->target_dist_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":934
 *         self.target_dist_lookup = np.empty((num_distances,
 *                                             self.word_window_size * self.target_dist_table.shape[1]))
 *         self.target_dist_offset = num_distances / 2             # <<<<<<<<<<<<<<
 *         window_from = 0
 *         window_to = self.target_dist_table.shape[1]
*/
  __pyx_t_1 = __Pyx_PyLong_TrueDivideObjC(__pyx_v_num_distances, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 934, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->target_dist_offset = __pyx_t_8;

  /* "nltkor/tag/libs/networkconv.pyx":935
 *                                             self.word_window_size * self.target_dist_table.shape[1]))
 *         self.target_dist_offset = num_distances / 2
 *         window_from = 0             # <<<<<<<<<<<<<<
 *         window_to = self.target_dist_table.shape[1]
 *         for i in range(self.word_window_size):
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_v_window_from = __pyx_mstate_global->__pyx_int_0;

  /* "nltkor/tag/libs/networkconv.pyx":936
 *         self.target_dist_offset = num_distances / 2
 *         window_from = 0
 *         window_to = self.target_dist_table.shape[1]             # <<<<<<<<<<<<<<
 *         for i in range(self.word_window_size):
 *             # each token in the window will is shifted in relation to the middle one
*/
  __pyx_t_1 = ((PyObject *)__pyx_v_self->target_dist_table);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((npy_intp *)0) && PyErr_Occurred())) __PYX_ERR(1, 936, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyLong_From_Py_intptr_t((__pyx_t_2[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 936, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_window_to = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":937
 *         window_from = 0
 *         window_to = self.target_dist_table.shape[1]
 *         for i in range(self.word_window_size):             # <<<<<<<<<<<<<<
 *             # each token in the window will is shifted in relation to the middle one
 *             shift = i - self.half_window
*/
  __pyx_t_5 = NULL;
  __Pyx_INCREF(__pyx_builtin_range);
  __pyx_t_6 = __pyx_builtin_range; 
  __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.word_window_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 937, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 937, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_6 = __pyx_t_1; __Pyx_INCREF(__pyx_t_6);
    __pyx_t_9 = 0;
    __pyx_t_10 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 937, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 937, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_10)) {
      if (likely(PyList_CheckExact(__pyx_t_6))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 937, __pyx_L1_error)
          #endif
          if (__pyx_t_9 >= __pyx_temp) break;
        }
        __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_9);
        ++__pyx_t_9;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 937, __pyx_L1_error)
          #endif
          if (__pyx_t_9 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_9));
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_9);
        #endif
        ++__pyx_t_9;
      }
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 937, __pyx_L1_error)
    } else {
      __pyx_t_1 = __pyx_t_10(__pyx_t_6);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 937, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":939
 *         for i in range(self.word_window_size):
 *             # each token in the window will is shifted in relation to the middle one
 *             shift = i - self.half_window             # <<<<<<<<<<<<<<
 * 
 *             # discount half window size because of the extra distances we added for padding
*/
    __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->half_window); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 939, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyNumber_Subtract(__pyx_v_i, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 939, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_shift, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":942
 * 
 *             # discount half window size because of the extra distances we added for padding
 *             inds = np.arange(shift, num_distances + shift) - self.half_window             # <<<<<<<<<<<<<<
 *             inds = np.clip(inds, 0, self.target_dist_table.shape[0] - 1)
 *             self.target_dist_lookup[:,window_from : window_to] = self.target_dist_table[inds,]
*/
    __pyx_t_1 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 942, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_arange); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 942, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Add(__pyx_v_num_distances, __pyx_v_shift); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 942, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_shift, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 942, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_self->half_window); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 942, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 942, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_inds, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":943
 *             # discount half window size because of the extra distances we added for padding
 *             inds = np.arange(shift, num_distances + shift) - self.half_window
 *             inds = np.clip(inds, 0, self.target_dist_table.shape[0] - 1)             # <<<<<<<<<<<<<<
 *             self.target_dist_lookup[:,window_from : window_to] = self.target_dist_table[inds,]
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 943, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_clip); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 943, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = ((PyObject *)__pyx_v_self->target_dist_table);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_3)); if (unlikely(__pyx_t_2 == ((npy_intp *)0) && PyErr_Occurred())) __PYX_ERR(1, 943, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyLong_From_long(((__pyx_t_2[0]) - 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 943, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_inds, __pyx_mstate_global->__pyx_int_0, __pyx_t_3};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 943, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_DECREF_SET(__pyx_v_inds, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":944
 *             inds = np.arange(shift, num_distances + shift) - self.half_window
 *             inds = np.clip(inds, 0, self.target_dist_table.shape[0] - 1)
 *             self.target_dist_lookup[:,window_from : window_to] = self.target_dist_table[inds,]             # <<<<<<<<<<<<<<
 * 
 *             window_from = window_to
*/
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 944, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_inds);
    __Pyx_GIVEREF(__pyx_v_inds);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_inds) != (0)) __PYX_ERR(1, 944, __pyx_L1_error);
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->target_dist_table), __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 944, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PySlice_New(__pyx_v_window_from, __pyx_v_window_to, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 944, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 944, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(1, 944, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5) != (0)) __PYX_ERR(1, 944, __pyx_L1_error);
    __pyx_t_5 = 0;
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->target_dist_lookup), __pyx_t_3, __pyx_t_1) < 0))) __PYX_ERR(1, 944, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":946
 *             self.target_dist_lookup[:,window_from : window_to] = self.target_dist_table[inds,]
 * 
 *             window_from = window_to             # <<<<<<<<<<<<<<
 *             window_to += self.target_dist_table.shape[1]
 * 
*/
    __Pyx_INCREF(__pyx_v_window_to);
    __Pyx_DECREF_SET(__pyx_v_window_from, __pyx_v_window_to);

    /* "nltkor/tag/libs/networkconv.pyx":947
 * 
 *             window_from = window_to
 *             window_to += self.target_dist_table.shape[1]             # <<<<<<<<<<<<<<
 * 
 *         self.target_convolution_lookup = self.target_dist_lookup.dot(self.target_dist_weights)
*/
    __pyx_t_1 = ((PyObject *)__pyx_v_self->target_dist_table);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((npy_intp *)0) && PyErr_Occurred())) __PYX_ERR(1, 947, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyLong_From_Py_intptr_t((__pyx_t_2[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 947, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_window_to, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 947, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_window_to, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":937
 *         window_from = 0
 *         window_to = self.target_dist_table.shape[1]
 *         for i in range(self.word_window_size):             # <<<<<<<<<<<<<<
 *             # each token in the window will is shifted in relation to the middle one
 *             shift = i - self.half_window
*/
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":949
 *             window_to += self.target_dist_table.shape[1]
 * 
 *         self.target_convolution_lookup = self.target_dist_lookup.dot(self.target_dist_weights)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_3 = ((PyObject *)__pyx_v_self->target_dist_lookup);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_self->target_dist_weights)};
    __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_dot, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 949, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 949, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_6);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->target_convolution_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v_self->target_convolution_lookup);
  __pyx_v_self->target_convolution_lookup = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":923
 *         return answer
 * 
 *     def _create_target_lookup(self):             # <<<<<<<<<<<<<<
 *         """
 *         Creates a lookup table with the window value for each different distance
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 923, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 923, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._create_target_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_num_distances);
  __Pyx_XDECREF(__pyx_v_window_from);
  __Pyx_XDECREF(__pyx_v_window_to);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_shift);
  __Pyx_XDECREF(__pyx_v_inds);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":952
 * 
 * 
 *     def _create_pred_lookup(self):             # <<<<<<<<<<<<<<
 *         """
 *         Creates a lookup table with the window value for each different distance
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_53_create_pred_lookup(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_52_create_pred_lookup, "ConvolutionalNetwork._create_pred_lookup(self)\nCreates a lookup table with the window value for each different distance\nto the predicate token (pred_dist_lookup) and one with the precomputed\nvalues in the convolution layer (pred_convolution_lookup). ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_53_create_pred_lookup = {"_create_pred_lookup", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_53_create_pred_lookup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_52_create_pred_lookup};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_53_create_pred_lookup(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_create_pred_lookup (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_create_pred_lookup", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_create_pred_lookup", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_52_create_pred_lookup(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_52_create_pred_lookup(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_v_num_distances = NULL;
  PyObject *__pyx_v_window_from = NULL;
  PyObject *__pyx_v_window_to = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_shift = NULL;
  PyObject *__pyx_v_inds = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  npy_intp *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[109]))
  __Pyx_RefNannySetupContext("_create_pred_lookup", 0);
  __Pyx_TraceStartFunc("_create_pred_lookup", __pyx_f[1], 952, 0, 0, 0, __PYX_ERR(1, 952, __pyx_L1_error));

  /* "nltkor/tag/libs/networkconv.pyx":960
 *         # consider padding. if the table has 10 entries, with a word window of 3,
 *         # we would have to consider up to the distance of 11, because of the padding.
 *         num_distances = self.pred_dist_table.shape[0] + self.word_window_size - 1             # <<<<<<<<<<<<<<
 *         self.pred_dist_lookup = np.empty((num_distances,
 *                                           self.word_window_size * self.pred_dist_table.shape[1]))
*/
  __pyx_t_1 = ((PyObject *)__pyx_v_self->pred_dist_table);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((npy_intp *)0) && PyErr_Occurred())) __PYX_ERR(1, 960, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyLong_From_long((((__pyx_t_2[0]) + __pyx_v_self->__pyx_base.word_window_size) - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_num_distances = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":961
 *         # we would have to consider up to the distance of 11, because of the padding.
 *         num_distances = self.pred_dist_table.shape[0] + self.word_window_size - 1
 *         self.pred_dist_lookup = np.empty((num_distances,             # <<<<<<<<<<<<<<
 *                                           self.word_window_size * self.pred_dist_table.shape[1]))
 *         self.pred_dist_offset = num_distances / 2
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":962
 *         num_distances = self.pred_dist_table.shape[0] + self.word_window_size - 1
 *         self.pred_dist_lookup = np.empty((num_distances,
 *                                           self.word_window_size * self.pred_dist_table.shape[1]))             # <<<<<<<<<<<<<<
 *         self.pred_dist_offset = num_distances / 2
 *         window_from = 0
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_self->pred_dist_table);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_4)); if (unlikely(__pyx_t_2 == ((npy_intp *)0) && PyErr_Occurred())) __PYX_ERR(1, 962, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyLong_From_Py_intptr_t((__pyx_v_self->__pyx_base.word_window_size * (__pyx_t_2[1]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "nltkor/tag/libs/networkconv.pyx":961
 *         # we would have to consider up to the distance of 11, because of the padding.
 *         num_distances = self.pred_dist_table.shape[0] + self.word_window_size - 1
 *         self.pred_dist_lookup = np.empty((num_distances,             # <<<<<<<<<<<<<<
 *                                           self.word_window_size * self.pred_dist_table.shape[1]))
 *         self.pred_dist_offset = num_distances / 2
*/
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_v_num_distances);
  __Pyx_GIVEREF(__pyx_v_num_distances);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_num_distances) != (0)) __PYX_ERR(1, 961, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4) != (0)) __PYX_ERR(1, 961, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 961, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 961, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->pred_dist_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v_self->pred_dist_lookup);
  __pyx_v_self->pred_dist_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":963
 *         self.pred_dist_lookup = np.empty((num_distances,
 *                                           self.word_window_size * self.pred_dist_table.shape[1]))
 *         self.pred_dist_offset = num_distances / 2             # <<<<<<<<<<<<<<
 *         window_from = 0
 *         window_to = self.pred_dist_table.shape[1]
*/
  __pyx_t_1 = __Pyx_PyLong_TrueDivideObjC(__pyx_v_num_distances, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 963, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->pred_dist_offset = __pyx_t_8;

  /* "nltkor/tag/libs/networkconv.pyx":964
 *                                           self.word_window_size * self.pred_dist_table.shape[1]))
 *         self.pred_dist_offset = num_distances / 2
 *         window_from = 0             # <<<<<<<<<<<<<<
 *         window_to = self.pred_dist_table.shape[1]
 *         for i in range(self.word_window_size):
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_v_window_from = __pyx_mstate_global->__pyx_int_0;

  /* "nltkor/tag/libs/networkconv.pyx":965
 *         self.pred_dist_offset = num_distances / 2
 *         window_from = 0
 *         window_to = self.pred_dist_table.shape[1]             # <<<<<<<<<<<<<<
 *         for i in range(self.word_window_size):
 *             # each token in the window will is shifted in relation to the middle one
*/
  __pyx_t_1 = ((PyObject *)__pyx_v_self->pred_dist_table);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((npy_intp *)0) && PyErr_Occurred())) __PYX_ERR(1, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyLong_From_Py_intptr_t((__pyx_t_2[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_window_to = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":966
 *         window_from = 0
 *         window_to = self.pred_dist_table.shape[1]
 *         for i in range(self.word_window_size):             # <<<<<<<<<<<<<<
 *             # each token in the window will is shifted in relation to the middle one
 *             shift = i - self.half_window
*/
  __pyx_t_5 = NULL;
  __Pyx_INCREF(__pyx_builtin_range);
  __pyx_t_6 = __pyx_builtin_range; 
  __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.word_window_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 966, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_6 = __pyx_t_1; __Pyx_INCREF(__pyx_t_6);
    __pyx_t_9 = 0;
    __pyx_t_10 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 966, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 966, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_10)) {
      if (likely(PyList_CheckExact(__pyx_t_6))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 966, __pyx_L1_error)
          #endif
          if (__pyx_t_9 >= __pyx_temp) break;
        }
        __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_9);
        ++__pyx_t_9;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 966, __pyx_L1_error)
          #endif
          if (__pyx_t_9 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_9));
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_9);
        #endif
        ++__pyx_t_9;
      }
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 966, __pyx_L1_error)
    } else {
      __pyx_t_1 = __pyx_t_10(__pyx_t_6);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 966, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":968
 *         for i in range(self.word_window_size):
 *             # each token in the window will is shifted in relation to the middle one
 *             shift = i - self.half_window             # <<<<<<<<<<<<<<
 * 
 *             # discount half window size because of the extra distances we added for padding
*/
    __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->half_window); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 968, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyNumber_Subtract(__pyx_v_i, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 968, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_shift, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":971
 * 
 *             # discount half window size because of the extra distances we added for padding
 *             inds = np.arange(shift, num_distances + shift) - self.half_window             # <<<<<<<<<<<<<<
 *             inds = np.clip(inds, 0, self.pred_dist_table.shape[0] - 1)
 *             self.pred_dist_lookup[:,window_from : window_to] = self.pred_dist_table[inds,]
*/
    __pyx_t_1 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 971, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_arange); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 971, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Add(__pyx_v_num_distances, __pyx_v_shift); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 971, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_shift, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 971, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_self->half_window); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 971, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 971, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_inds, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":972
 *             # discount half window size because of the extra distances we added for padding
 *             inds = np.arange(shift, num_distances + shift) - self.half_window
 *             inds = np.clip(inds, 0, self.pred_dist_table.shape[0] - 1)             # <<<<<<<<<<<<<<
 *             self.pred_dist_lookup[:,window_from : window_to] = self.pred_dist_table[inds,]
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 972, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_clip); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 972, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = ((PyObject *)__pyx_v_self->pred_dist_table);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_3)); if (unlikely(__pyx_t_2 == ((npy_intp *)0) && PyErr_Occurred())) __PYX_ERR(1, 972, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyLong_From_long(((__pyx_t_2[0]) - 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 972, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_inds, __pyx_mstate_global->__pyx_int_0, __pyx_t_3};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 972, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_DECREF_SET(__pyx_v_inds, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":973
 *             inds = np.arange(shift, num_distances + shift) - self.half_window
 *             inds = np.clip(inds, 0, self.pred_dist_table.shape[0] - 1)
 *             self.pred_dist_lookup[:,window_from : window_to] = self.pred_dist_table[inds,]             # <<<<<<<<<<<<<<
 * 
 *             window_from = window_to
*/
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 973, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_inds);
    __Pyx_GIVEREF(__pyx_v_inds);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_inds) != (0)) __PYX_ERR(1, 973, __pyx_L1_error);
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->pred_dist_table), __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 973, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PySlice_New(__pyx_v_window_from, __pyx_v_window_to, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 973, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 973, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(1, 973, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5) != (0)) __PYX_ERR(1, 973, __pyx_L1_error);
    __pyx_t_5 = 0;
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->pred_dist_lookup), __pyx_t_3, __pyx_t_1) < 0))) __PYX_ERR(1, 973, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":975
 *             self.pred_dist_lookup[:,window_from : window_to] = self.pred_dist_table[inds,]
 * 
 *             window_from = window_to             # <<<<<<<<<<<<<<
 *             window_to += self.pred_dist_table.shape[1]
 * 
*/
    __Pyx_INCREF(__pyx_v_window_to);
    __Pyx_DECREF_SET(__pyx_v_window_from, __pyx_v_window_to);

    /* "nltkor/tag/libs/networkconv.pyx":976
 * 
 *             window_from = window_to
 *             window_to += self.pred_dist_table.shape[1]             # <<<<<<<<<<<<<<
 * 
 *         self.pred_convolution_lookup = self.pred_dist_lookup.dot(self.pred_dist_weights)
*/
    __pyx_t_1 = ((PyObject *)__pyx_v_self->pred_dist_table);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((npy_intp *)0) && PyErr_Occurred())) __PYX_ERR(1, 976, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyLong_From_Py_intptr_t((__pyx_t_2[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 976, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_window_to, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 976, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_window_to, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":966
 *         window_from = 0
 *         window_to = self.pred_dist_table.shape[1]
 *         for i in range(self.word_window_size):             # <<<<<<<<<<<<<<
 *             # each token in the window will is shifted in relation to the middle one
 *             shift = i - self.half_window
*/
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":978
 *             window_to += self.pred_dist_table.shape[1]
 * 
 *         self.pred_convolution_lookup = self.pred_dist_lookup.dot(self.pred_dist_weights)             # <<<<<<<<<<<<<<
 * 
 *     def _create_convolution_lookup(self, sentence, training):
*/
  __pyx_t_3 = ((PyObject *)__pyx_v_self->pred_dist_lookup);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_self->pred_dist_weights)};
    __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_dot, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 978, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 978, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_6);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->pred_convolution_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v_self->pred_convolution_lookup);
  __pyx_v_self->pred_convolution_lookup = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":952
 * 
 * 
 *     def _create_pred_lookup(self):             # <<<<<<<<<<<<<<
 *         """
 *         Creates a lookup table with the window value for each different distance
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 952, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 952, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._create_pred_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_num_distances);
  __Pyx_XDECREF(__pyx_v_window_from);
  __Pyx_XDECREF(__pyx_v_window_to);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_shift);
  __Pyx_XDECREF(__pyx_v_inds);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":980
 *         self.pred_convolution_lookup = self.pred_dist_lookup.dot(self.pred_dist_weights)
 * 
 *     def _create_convolution_lookup(self, sentence, training):             # <<<<<<<<<<<<<<
 *         """
 *         Creates a lookup table storing the values found by each
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_55_create_convolution_lookup(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_54_create_convolution_lookup, "ConvolutionalNetwork._create_convolution_lookup(self, sentence, training)\nCreates a lookup table storing the values found by each\nconvolutional neuron before summing distance features.\nThe table has the format len(sent) x len(convol layer)\nBiases are not included.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_55_create_convolution_lookup = {"_create_convolution_lookup", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_55_create_convolution_lookup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_54_create_convolution_lookup};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_55_create_convolution_lookup(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_sentence = 0;
  PyObject *__pyx_v_training = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_create_convolution_lookup (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sentence,&__pyx_mstate_global->__pyx_n_u_training,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 980, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 980, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 980, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_create_convolution_lookup", 0) < 0) __PYX_ERR(1, 980, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_create_convolution_lookup", 1, 2, 2, i); __PYX_ERR(1, 980, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 980, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 980, __pyx_L3_error)
    }
    __pyx_v_sentence = values[0];
    __pyx_v_training = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_create_convolution_lookup", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 980, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._create_convolution_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_54_create_convolution_lookup(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v_sentence, __pyx_v_training);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_54_create_convolution_lookup(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_sentence, PyObject *__pyx_v_training) {
  PyArrayObject *__pyx_v_padded_sentence = 0;
  PyArrayObject *__pyx_v_window = 0;
  PyArrayObject *__pyx_v_input_data = 0;
  PyArrayObject *__pyx_v_new_data = 0;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_element = NULL;
  PyObject *__pyx_8genexpr7__pyx_v_token_indices = NULL;
  PyObject *__pyx_8genexpr7__pyx_v_index = NULL;
  PyObject *__pyx_8genexpr7__pyx_v_table = NULL;
  PyObject *__pyx_8genexpr8__pyx_v_index = NULL;
  PyObject *__pyx_8genexpr8__pyx_v_table = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_new_data;
  __Pyx_Buffer __pyx_pybuffer_new_data;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  Py_ssize_t __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *(*__pyx_t_17)(PyObject *);
  PyObject *__pyx_t_18 = NULL;
  int __pyx_t_19;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[110]))
  __Pyx_RefNannySetupContext("_create_convolution_lookup", 0);
  __Pyx_TraceStartFunc("_create_convolution_lookup", __pyx_f[1], 980, 0, 0, 0, __PYX_ERR(1, 980, __pyx_L1_error));
  __pyx_pybuffer_new_data.pybuffer.buf = NULL;
  __pyx_pybuffer_new_data.refcount = 0;
  __pyx_pybuffernd_new_data.data = NULL;
  __pyx_pybuffernd_new_data.rcbuffer = &__pyx_pybuffer_new_data;

  /* "nltkor/tag/libs/networkconv.pyx":990
 * 
 *         # add padding to the sentence
 *         if self.word_window_size > 1:             # <<<<<<<<<<<<<<
 *             padded_sentence = np.vstack((self.pre_padding,
 *                                          sentence,
*/
  __pyx_t_1 = (__pyx_v_self->__pyx_base.word_window_size > 1);
  if (__pyx_t_1) {

    /* "nltkor/tag/libs/networkconv.pyx":991
 *         # add padding to the sentence
 *         if self.word_window_size > 1:
 *             padded_sentence = np.vstack((self.pre_padding,             # <<<<<<<<<<<<<<
 *                                          sentence,
 *                                          self.pos_padding))
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 991, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vstack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 991, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":993
 *             padded_sentence = np.vstack((self.pre_padding,
 *                                          sentence,
 *                                          self.pos_padding))             # <<<<<<<<<<<<<<
 *         else:
 *             padded_sentence = sentence
*/
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 991, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.pre_padding);
    __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.pre_padding);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self->__pyx_base.pre_padding)) != (0)) __PYX_ERR(1, 991, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_sentence);
    __Pyx_GIVEREF(__pyx_v_sentence);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_sentence) != (0)) __PYX_ERR(1, 991, __pyx_L1_error);
    __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.pos_padding);
    __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.pos_padding);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_self->__pyx_base.pos_padding)) != (0)) __PYX_ERR(1, 991, __pyx_L1_error);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 991, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }

    /* "nltkor/tag/libs/networkconv.pyx":991
 *         # add padding to the sentence
 *         if self.word_window_size > 1:
 *             padded_sentence = np.vstack((self.pre_padding,             # <<<<<<<<<<<<<<
 *                                          sentence,
 *                                          self.pos_padding))
*/
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 991, __pyx_L1_error)
    __pyx_v_padded_sentence = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":990
 * 
 *         # add padding to the sentence
 *         if self.word_window_size > 1:             # <<<<<<<<<<<<<<
 *             padded_sentence = np.vstack((self.pre_padding,
 *                                          sentence,
*/
    goto __pyx_L3;
  }

  /* "nltkor/tag/libs/networkconv.pyx":995
 *                                          self.pos_padding))
 *         else:
 *             padded_sentence = sentence             # <<<<<<<<<<<<<<
 * 
 *         self.convolution_lookup = np.empty((len(sentence), self.hidden_size))
*/
  /*else*/ {
    __pyx_t_2 = __pyx_v_sentence;
    __Pyx_INCREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 995, __pyx_L1_error)
    __pyx_v_padded_sentence = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "nltkor/tag/libs/networkconv.pyx":997
 *             padded_sentence = sentence
 * 
 *         self.convolution_lookup = np.empty((len(sentence), self.hidden_size))             # <<<<<<<<<<<<<<
 *         #print(len(sentence), self.hidden_size, len(self.convolution_lookup[0]))
 * 
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = PyObject_Length(__pyx_v_sentence); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(1, 997, __pyx_L1_error)
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.hidden_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4) != (0)) __PYX_ERR(1, 997, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8) != (0)) __PYX_ERR(1, 997, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_8 = 0;
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_9};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 997, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 997, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->convolution_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v_self->convolution_lookup);
  __pyx_v_self->convolution_lookup = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":1001
 * 
 *         # first window
 *         cdef np.ndarray window = padded_sentence[:self.word_window_size]             # <<<<<<<<<<<<<<
 *         cdef np.ndarray input_data
 *         input_data = np.concatenate(
*/
  __pyx_t_2 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_padded_sentence), 0, __pyx_v_self->__pyx_base.word_window_size, NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 1001, __pyx_L1_error)
  __pyx_v_window = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":1003
 *         cdef np.ndarray window = padded_sentence[:self.word_window_size]
 *         cdef np.ndarray input_data
 *         input_data = np.concatenate(             # <<<<<<<<<<<<<<
 *                                     [table[index]
 *                                      for token_indices in window
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_concatenate); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  { /* enter inner scope */

    /* "nltkor/tag/libs/networkconv.pyx":1004
 *         cdef np.ndarray input_data
 *         input_data = np.concatenate(
 *                                     [table[index]             # <<<<<<<<<<<<<<
 *                                      for token_indices in window
 *                                      for index, table in zip(token_indices,
*/
    __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1004, __pyx_L6_error)
    __Pyx_GOTREF(__pyx_t_9);

    /* "nltkor/tag/libs/networkconv.pyx":1005
 *         input_data = np.concatenate(
 *                                     [table[index]
 *                                      for token_indices in window             # <<<<<<<<<<<<<<
 *                                      for index, table in zip(token_indices,
 *                                                              self.feature_tables)
*/
    if (likely(PyList_CheckExact(((PyObject *)__pyx_v_window))) || PyTuple_CheckExact(((PyObject *)__pyx_v_window))) {
      __pyx_t_8 = ((PyObject *)__pyx_v_window); __Pyx_INCREF(__pyx_t_8);
      __pyx_t_7 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_8 = PyObject_GetIter(((PyObject *)__pyx_v_window)); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1005, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1005, __pyx_L6_error)
    }
    for (;;) {
      if (likely(!__pyx_t_10)) {
        if (likely(PyList_CheckExact(__pyx_t_8))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 1005, __pyx_L6_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_8, __pyx_t_7);
          ++__pyx_t_7;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 1005, __pyx_L6_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_7));
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_7);
          #endif
          ++__pyx_t_7;
        }
        if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1005, __pyx_L6_error)
      } else {
        __pyx_t_4 = __pyx_t_10(__pyx_t_8);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 1005, __pyx_L6_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_token_indices, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":1006
 *                                     [table[index]
 *                                      for token_indices in window
 *                                      for index, table in zip(token_indices,             # <<<<<<<<<<<<<<
 *                                                              self.feature_tables)
 *                                      ]
*/
      __pyx_t_11 = NULL;
      __Pyx_INCREF(__pyx_builtin_zip);
      __pyx_t_12 = __pyx_builtin_zip; 

      /* "nltkor/tag/libs/networkconv.pyx":1007
 *                                      for token_indices in window
 *                                      for index, table in zip(token_indices,
 *                                                              self.feature_tables)             # <<<<<<<<<<<<<<
 *                                      ]
 *                                     )
*/
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_8genexpr7__pyx_v_token_indices, __pyx_v_self->__pyx_base.feature_tables};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1006, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_4);
      }

      /* "nltkor/tag/libs/networkconv.pyx":1006
 *                                     [table[index]
 *                                      for token_indices in window
 *                                      for index, table in zip(token_indices,             # <<<<<<<<<<<<<<
 *                                                              self.feature_tables)
 *                                      ]
*/
      if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
        __pyx_t_12 = __pyx_t_4; __Pyx_INCREF(__pyx_t_12);
        __pyx_t_13 = 0;
        __pyx_t_14 = NULL;
      } else {
        __pyx_t_13 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 1006, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 1006, __pyx_L6_error)
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      for (;;) {
        if (likely(!__pyx_t_14)) {
          if (likely(PyList_CheckExact(__pyx_t_12))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_12);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 1006, __pyx_L6_error)
              #endif
              if (__pyx_t_13 >= __pyx_temp) break;
            }
            __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_12, __pyx_t_13);
            ++__pyx_t_13;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_12);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 1006, __pyx_L6_error)
              #endif
              if (__pyx_t_13 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_13));
            #else
            __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_12, __pyx_t_13);
            #endif
            ++__pyx_t_13;
          }
          if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1006, __pyx_L6_error)
        } else {
          __pyx_t_4 = __pyx_t_14(__pyx_t_12);
          if (unlikely(!__pyx_t_4)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 1006, __pyx_L6_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_4);
        if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
          PyObject* sequence = __pyx_t_4;
          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(1, 1006, __pyx_L6_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_11 = PyTuple_GET_ITEM(sequence, 0);
            __Pyx_INCREF(__pyx_t_11);
            __pyx_t_15 = PyTuple_GET_ITEM(sequence, 1);
            __Pyx_INCREF(__pyx_t_15);
          } else {
            __pyx_t_11 = __Pyx_PyList_GetItemRef(sequence, 0);
            if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 1006, __pyx_L6_error)
            __Pyx_XGOTREF(__pyx_t_11);
            __pyx_t_15 = __Pyx_PyList_GetItemRef(sequence, 1);
            if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 1006, __pyx_L6_error)
            __Pyx_XGOTREF(__pyx_t_15);
          }
          #else
          __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 1006, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_15 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 1006, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_15);
          #endif
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_16 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 1006, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_16);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_17 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_16);
          index = 0; __pyx_t_11 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_11)) goto __pyx_L11_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_11);
          index = 1; __pyx_t_15 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_15)) goto __pyx_L11_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_15);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_16), 2) < 0) __PYX_ERR(1, 1006, __pyx_L6_error)
          __pyx_t_17 = NULL;
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          goto __pyx_L12_unpacking_done;
          __pyx_L11_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          __pyx_t_17 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(1, 1006, __pyx_L6_error)
          __pyx_L12_unpacking_done:;
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_index, __pyx_t_11);
        __pyx_t_11 = 0;
        __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_table, __pyx_t_15);
        __pyx_t_15 = 0;

        /* "nltkor/tag/libs/networkconv.pyx":1004
 *         cdef np.ndarray input_data
 *         input_data = np.concatenate(
 *                                     [table[index]             # <<<<<<<<<<<<<<
 *                                      for token_indices in window
 *                                      for index, table in zip(token_indices,
*/
        __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_8genexpr7__pyx_v_table, __pyx_8genexpr7__pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1004, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_9, (PyObject*)__pyx_t_4))) __PYX_ERR(1, 1004, __pyx_L6_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "nltkor/tag/libs/networkconv.pyx":1006
 *                                     [table[index]
 *                                      for token_indices in window
 *                                      for index, table in zip(token_indices,             # <<<<<<<<<<<<<<
 *                                                              self.feature_tables)
 *                                      ]
*/
      }
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

      /* "nltkor/tag/libs/networkconv.pyx":1005
 *         input_data = np.concatenate(
 *                                     [table[index]
 *                                      for token_indices in window             # <<<<<<<<<<<<<<
 *                                      for index, table in zip(token_indices,
 *                                                              self.feature_tables)
*/
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_index); __pyx_8genexpr7__pyx_v_index = 0;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_table); __pyx_8genexpr7__pyx_v_table = 0;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_token_indices); __pyx_8genexpr7__pyx_v_token_indices = 0;
    goto __pyx_L15_exit_scope;
    __pyx_L6_error:;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_index); __pyx_8genexpr7__pyx_v_index = 0;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_table); __pyx_8genexpr7__pyx_v_table = 0;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_token_indices); __pyx_8genexpr7__pyx_v_token_indices = 0;
    goto __pyx_L1_error;
    __pyx_L15_exit_scope:;
  } /* exit inner scope */
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_9};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1003, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }

  /* "nltkor/tag/libs/networkconv.pyx":1003
 *         cdef np.ndarray window = padded_sentence[:self.word_window_size]
 *         cdef np.ndarray input_data
 *         input_data = np.concatenate(             # <<<<<<<<<<<<<<
 *                                     [table[index]
 *                                      for token_indices in window
*/
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 1003, __pyx_L1_error)
  __pyx_v_input_data = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":1010
 *                                      ]
 *                                     )
 *         self.convolution_lookup[0] = self.hidden_weights.dot(input_data)             # <<<<<<<<<<<<<<
 *         if training:
 *             # store the values of each input -- needed when adjusting features
*/
  __pyx_t_5 = ((PyObject *)__pyx_v_self->__pyx_base.hidden_weights);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_v_input_data)};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_dot, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1010, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_v_self->convolution_lookup), 0, __pyx_t_2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1) < 0))) __PYX_ERR(1, 1010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":1011
 *                                     )
 *         self.convolution_lookup[0] = self.hidden_weights.dot(input_data)
 *         if training:             # <<<<<<<<<<<<<<
 *             # store the values of each input -- needed when adjusting features
 *             self.input_sent_values[0] = input_data
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_training); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 1011, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "nltkor/tag/libs/networkconv.pyx":1013
 *         if training:
 *             # store the values of each input -- needed when adjusting features
 *             self.input_sent_values[0] = input_data             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[FLOAT_t, ndim=1] new_data
*/
    if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_v_self->__pyx_base.input_sent_values), 0, ((PyObject *)__pyx_v_input_data), long, 1, __Pyx_PyLong_From_long, 0, 0, 1) < 0))) __PYX_ERR(1, 1013, __pyx_L1_error)

    /* "nltkor/tag/libs/networkconv.pyx":1011
 *                                     )
 *         self.convolution_lookup[0] = self.hidden_weights.dot(input_data)
 *         if training:             # <<<<<<<<<<<<<<
 *             # store the values of each input -- needed when adjusting features
 *             self.input_sent_values[0] = input_data
*/
  }

  /* "nltkor/tag/libs/networkconv.pyx":1016
 * 
 *         cdef np.ndarray[FLOAT_t, ndim=1] new_data
 *         for i, element in enumerate(padded_sentence[self.word_window_size:], 1):             # <<<<<<<<<<<<<<
 *             new_data = np.concatenate([table[index] for
 *                                        index, table in zip(element, self.feature_tables)])
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
  __pyx_t_18 = __pyx_mstate_global->__pyx_int_1;
  __pyx_t_2 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_padded_sentence), __pyx_v_self->__pyx_base.word_window_size, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5);
    __pyx_t_7 = 0;
    __pyx_t_10 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1016, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1016, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_10)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 1016, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_7);
        ++__pyx_t_7;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 1016, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7));
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_7);
        #endif
        ++__pyx_t_7;
      }
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1016, __pyx_L1_error)
    } else {
      __pyx_t_2 = __pyx_t_10(__pyx_t_5);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 1016, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_element, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_t_18);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_18);
    __pyx_t_2 = __Pyx_PyLong_AddObjC(__pyx_t_18, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1016, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_18);
    __pyx_t_18 = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":1017
 *         cdef np.ndarray[FLOAT_t, ndim=1] new_data
 *         for i, element in enumerate(padded_sentence[self.word_window_size:], 1):
 *             new_data = np.concatenate([table[index] for             # <<<<<<<<<<<<<<
 *                                        index, table in zip(element, self.feature_tables)])
 * 
*/
    __pyx_t_9 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1017, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_concatenate); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1017, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    { /* enter inner scope */
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1017, __pyx_L21_error)
      __Pyx_GOTREF(__pyx_t_3);

      /* "nltkor/tag/libs/networkconv.pyx":1018
 *         for i, element in enumerate(padded_sentence[self.word_window_size:], 1):
 *             new_data = np.concatenate([table[index] for
 *                                        index, table in zip(element, self.feature_tables)])             # <<<<<<<<<<<<<<
 * 
 *             # slide the window to the next element
*/
      __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_builtin_zip);
      __pyx_t_15 = __pyx_builtin_zip; 
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_element, __pyx_v_self->__pyx_base.feature_tables};
        __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 1018, __pyx_L21_error)
        __Pyx_GOTREF(__pyx_t_12);
      }
      if (likely(PyList_CheckExact(__pyx_t_12)) || PyTuple_CheckExact(__pyx_t_12)) {
        __pyx_t_15 = __pyx_t_12; __Pyx_INCREF(__pyx_t_15);
        __pyx_t_13 = 0;
        __pyx_t_14 = NULL;
      } else {
        __pyx_t_13 = -1; __pyx_t_15 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 1018, __pyx_L21_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_15); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 1018, __pyx_L21_error)
      }
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      for (;;) {
        if (likely(!__pyx_t_14)) {
          if (likely(PyList_CheckExact(__pyx_t_15))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_15);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 1018, __pyx_L21_error)
              #endif
              if (__pyx_t_13 >= __pyx_temp) break;
            }
            __pyx_t_12 = __Pyx_PyList_GetItemRef(__pyx_t_15, __pyx_t_13);
            ++__pyx_t_13;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_15);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 1018, __pyx_L21_error)
              #endif
              if (__pyx_t_13 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_12 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_13));
            #else
            __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_15, __pyx_t_13);
            #endif
            ++__pyx_t_13;
          }
          if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 1018, __pyx_L21_error)
        } else {
          __pyx_t_12 = __pyx_t_14(__pyx_t_15);
          if (unlikely(!__pyx_t_12)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 1018, __pyx_L21_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_12);
        if ((likely(PyTuple_CheckExact(__pyx_t_12))) || (PyList_CheckExact(__pyx_t_12))) {
          PyObject* sequence = __pyx_t_12;
          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(1, 1018, __pyx_L21_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
            __Pyx_INCREF(__pyx_t_4);
            __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1);
            __Pyx_INCREF(__pyx_t_11);
          } else {
            __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0);
            if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1018, __pyx_L21_error)
            __Pyx_XGOTREF(__pyx_t_4);
            __pyx_t_11 = __Pyx_PyList_GetItemRef(sequence, 1);
            if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 1018, __pyx_L21_error)
            __Pyx_XGOTREF(__pyx_t_11);
          }
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1018, __pyx_L21_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 1018, __pyx_L21_error)
          __Pyx_GOTREF(__pyx_t_11);
          #endif
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_16 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 1018, __pyx_L21_error)
          __Pyx_GOTREF(__pyx_t_16);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_17 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_16);
          index = 0; __pyx_t_4 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_4)) goto __pyx_L24_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_4);
          index = 1; __pyx_t_11 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_11)) goto __pyx_L24_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_11);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_16), 2) < 0) __PYX_ERR(1, 1018, __pyx_L21_error)
          __pyx_t_17 = NULL;
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          goto __pyx_L25_unpacking_done;
          __pyx_L24_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          __pyx_t_17 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(1, 1018, __pyx_L21_error)
          __pyx_L25_unpacking_done:;
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_index, __pyx_t_4);
        __pyx_t_4 = 0;
        __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_table, __pyx_t_11);
        __pyx_t_11 = 0;

        /* "nltkor/tag/libs/networkconv.pyx":1017
 *         cdef np.ndarray[FLOAT_t, ndim=1] new_data
 *         for i, element in enumerate(padded_sentence[self.word_window_size:], 1):
 *             new_data = np.concatenate([table[index] for             # <<<<<<<<<<<<<<
 *                                        index, table in zip(element, self.feature_tables)])
 * 
*/
        __pyx_t_12 = __Pyx_PyObject_GetItem(__pyx_8genexpr8__pyx_v_table, __pyx_8genexpr8__pyx_v_index); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 1017, __pyx_L21_error)
        __Pyx_GOTREF(__pyx_t_12);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_12))) __PYX_ERR(1, 1017, __pyx_L21_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_index); __pyx_8genexpr8__pyx_v_index = 0;
      __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_table); __pyx_8genexpr8__pyx_v_table = 0;
      goto __pyx_L27_exit_scope;
      __pyx_L21_error:;
      __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_index); __pyx_8genexpr8__pyx_v_index = 0;
      __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_table); __pyx_8genexpr8__pyx_v_table = 0;
      goto __pyx_L1_error;
      __pyx_L27_exit_scope:;
    } /* exit inner scope */
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
      assert(__pyx_t_9);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_3};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1017, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 1017, __pyx_L1_error)
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new_data.rcbuffer->pybuffer);
      __pyx_t_19 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new_data.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_19 < 0)) {
        PyErr_Fetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_new_data, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_20, __pyx_t_21, __pyx_t_22);
        }
        __pyx_t_20 = __pyx_t_21 = __pyx_t_22 = 0;
      }
      __pyx_pybuffernd_new_data.diminfo[0].strides = __pyx_pybuffernd_new_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new_data.diminfo[0].shape = __pyx_pybuffernd_new_data.rcbuffer->pybuffer.shape[0];
      if (unlikely((__pyx_t_19 < 0))) __PYX_ERR(1, 1017, __pyx_L1_error)
    }
    __Pyx_XDECREF_SET(__pyx_v_new_data, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":1021
 * 
 *             # slide the window to the next element
 *             input_data = np.concatenate((input_data[self.features_per_token:],             # <<<<<<<<<<<<<<
 *                                          new_data))
 * 
*/
    __pyx_t_8 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1021, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_concatenate); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1021, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_input_data), __pyx_v_self->__pyx_base.features_per_token, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1021, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "nltkor/tag/libs/networkconv.pyx":1022
 *             # slide the window to the next element
 *             input_data = np.concatenate((input_data[self.features_per_token:],
 *                                          new_data))             # <<<<<<<<<<<<<<
 * 
 *             #print(i, input_data)
*/
    __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 1021, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_3) != (0)) __PYX_ERR(1, 1021, __pyx_L1_error);
    __Pyx_INCREF((PyObject *)__pyx_v_new_data);
    __Pyx_GIVEREF((PyObject *)__pyx_v_new_data);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, ((PyObject *)__pyx_v_new_data)) != (0)) __PYX_ERR(1, 1021, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
      assert(__pyx_t_8);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_15};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1021, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }

    /* "nltkor/tag/libs/networkconv.pyx":1021
 * 
 *             # slide the window to the next element
 *             input_data = np.concatenate((input_data[self.features_per_token:],             # <<<<<<<<<<<<<<
 *                                          new_data))
 * 
*/
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 1021, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_input_data, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":1025
 * 
 *             #print(i, input_data)
 *             self.convolution_lookup[i] = self.hidden_weights.dot(input_data)             # <<<<<<<<<<<<<<
 *             if training:
 *                 self.input_sent_values[i] = input_data
*/
    __pyx_t_9 = ((PyObject *)__pyx_v_self->__pyx_base.hidden_weights);
    __Pyx_INCREF(__pyx_t_9);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, ((PyObject *)__pyx_v_input_data)};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_dot, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1025, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->convolution_lookup), __pyx_v_i, __pyx_t_2) < 0))) __PYX_ERR(1, 1025, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkconv.pyx":1026
 *             #print(i, input_data)
 *             self.convolution_lookup[i] = self.hidden_weights.dot(input_data)
 *             if training:             # <<<<<<<<<<<<<<
 *                 self.input_sent_values[i] = input_data
 * 
*/
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_training); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 1026, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "nltkor/tag/libs/networkconv.pyx":1027
 *             self.convolution_lookup[i] = self.hidden_weights.dot(input_data)
 *             if training:
 *                 self.input_sent_values[i] = input_data             # <<<<<<<<<<<<<<
 * 
*/
      if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->__pyx_base.input_sent_values), __pyx_v_i, ((PyObject *)__pyx_v_input_data)) < 0))) __PYX_ERR(1, 1027, __pyx_L1_error)

      /* "nltkor/tag/libs/networkconv.pyx":1026
 *             #print(i, input_data)
 *             self.convolution_lookup[i] = self.hidden_weights.dot(input_data)
 *             if training:             # <<<<<<<<<<<<<<
 *                 self.input_sent_values[i] = input_data
 * 
*/
    }

    /* "nltkor/tag/libs/networkconv.pyx":1016
 * 
 *         cdef np.ndarray[FLOAT_t, ndim=1] new_data
 *         for i, element in enumerate(padded_sentence[self.word_window_size:], 1):             # <<<<<<<<<<<<<<
 *             new_data = np.concatenate([table[index] for
 *                                        index, table in zip(element, self.feature_tables)])
*/
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":980
 *         self.pred_convolution_lookup = self.pred_dist_lookup.dot(self.pred_dist_weights)
 * 
 *     def _create_convolution_lookup(self, sentence, training):             # <<<<<<<<<<<<<<
 *         """
 *         Creates a lookup table storing the values found by each
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 980, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_18);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new_data.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 980, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork._create_convolution_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new_data.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_padded_sentence);
  __Pyx_XDECREF((PyObject *)__pyx_v_window);
  __Pyx_XDECREF((PyObject *)__pyx_v_input_data);
  __Pyx_XDECREF((PyObject *)__pyx_v_new_data);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_element);
  __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_token_indices);
  __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_index);
  __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_table);
  __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_index);
  __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_table);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":14
 * 
 *     # transition and distance feature tables
 *     cdef public np.ndarray target_dist_table, pred_dist_table             # <<<<<<<<<<<<<<
 *     cdef readonly np.ndarray target_dist_weights, pred_dist_weights
 *     cdef readonly int target_dist_offset, pred_dist_offset
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[111]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[1], 14, 0, 0, 0, __PYX_ERR(1, 14, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->target_dist_table);
  __pyx_r = ((PyObject *)__pyx_v_self->target_dist_table);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 14, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 14, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.target_dist_table.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table_2__set__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[112]))
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_TraceStartFunc("__set__", __pyx_f[1], 14, 0, 0, 0, __PYX_ERR(1, 14, __pyx_L1_error));
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 14, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->target_dist_table);
  __Pyx_DECREF((PyObject *)__pyx_v_self->target_dist_table);
  __pyx_v_self->target_dist_table = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_TraceReturnCValue(__pyx_r, __Pyx_Owned_Py_None, 0, 0, __PYX_ERR(1, 14, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 14, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.target_dist_table.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table_4__del__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  int __pyx_r;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[113]))
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_TraceStartFunc("__del__", __pyx_f[1], 14, 0, 0, 0, __PYX_ERR(1, 14, __pyx_L1_error));
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->target_dist_table);
  __Pyx_DECREF((PyObject *)__pyx_v_self->target_dist_table);
  __pyx_v_self->target_dist_table = ((PyArrayObject *)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_TraceReturnCValue(__pyx_r, __Pyx_Owned_Py_None, 0, 0, __PYX_ERR(1, 14, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 14, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.target_dist_table.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[114]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[1], 14, 0, 0, 0, __PYX_ERR(1, 14, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pred_dist_table);
  __pyx_r = ((PyObject *)__pyx_v_self->pred_dist_table);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 14, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 14, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.pred_dist_table.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table_2__set__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table_2__set__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[115]))
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_TraceStartFunc("__set__", __pyx_f[1], 14, 0, 0, 0, __PYX_ERR(1, 14, __pyx_L1_error));
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 14, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->pred_dist_table);
  __Pyx_DECREF((PyObject *)__pyx_v_self->pred_dist_table);
  __pyx_v_self->pred_dist_table = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_TraceReturnCValue(__pyx_r, __Pyx_Owned_Py_None, 0, 0, __PYX_ERR(1, 14, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 14, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.pred_dist_table.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table_4__del__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table_4__del__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  int __pyx_r;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[116]))
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_TraceStartFunc("__del__", __pyx_f[1], 14, 0, 0, 0, __PYX_ERR(1, 14, __pyx_L1_error));
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->pred_dist_table);
  __Pyx_DECREF((PyObject *)__pyx_v_self->pred_dist_table);
  __pyx_v_self->pred_dist_table = ((PyArrayObject *)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_TraceReturnCValue(__pyx_r, __Pyx_Owned_Py_None, 0, 0, __PYX_ERR(1, 14, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 14, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.pred_dist_table.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":15
 *     # transition and distance feature tables
 *     cdef public np.ndarray target_dist_table, pred_dist_table
 *     cdef readonly np.ndarray target_dist_weights, pred_dist_weights             # <<<<<<<<<<<<<<
 *     cdef readonly int target_dist_offset, pred_dist_offset
 *     cdef readonly np.ndarray target_dist_lookup, pred_dist_lookup
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_19target_dist_weights_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_19target_dist_weights_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_19target_dist_weights___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_19target_dist_weights___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[117]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[1], 15, 0, 0, 0, __PYX_ERR(1, 15, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->target_dist_weights);
  __pyx_r = ((PyObject *)__pyx_v_self->target_dist_weights);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 15, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 15, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.target_dist_weights.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17pred_dist_weights_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17pred_dist_weights_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17pred_dist_weights___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17pred_dist_weights___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[118]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[1], 15, 0, 0, 0, __PYX_ERR(1, 15, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pred_dist_weights);
  __pyx_r = ((PyObject *)__pyx_v_self->pred_dist_weights);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 15, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 15, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.pred_dist_weights.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":16
 *     cdef public np.ndarray target_dist_table, pred_dist_table
 *     cdef readonly np.ndarray target_dist_weights, pred_dist_weights
 *     cdef readonly int target_dist_offset, pred_dist_offset             # <<<<<<<<<<<<<<
 *     cdef readonly np.ndarray target_dist_lookup, pred_dist_lookup
 *     cdef readonly np.ndarray target_convolution_lookup, pred_convolution_lookup
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_offset_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_offset_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_offset___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_offset___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[119]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[1], 16, 0, 0, 0, __PYX_ERR(1, 16, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->target_dist_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 16, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 16, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.target_dist_offset.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_offset_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_offset_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_offset___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_offset___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[120]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[1], 16, 0, 0, 0, __PYX_ERR(1, 16, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->pred_dist_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 16, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 16, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.pred_dist_offset.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":17
 *     cdef readonly np.ndarray target_dist_weights, pred_dist_weights
 *     cdef readonly int target_dist_offset, pred_dist_offset
 *     cdef readonly np.ndarray target_dist_lookup, pred_dist_lookup             # <<<<<<<<<<<<<<
 *     cdef readonly np.ndarray target_convolution_lookup, pred_convolution_lookup
 *     cdef readonly np.ndarray target_dist_deltas, pred_dist_deltas
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_lookup_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_lookup_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_lookup___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_lookup___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[121]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[1], 17, 0, 0, 0, __PYX_ERR(1, 17, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->target_dist_lookup);
  __pyx_r = ((PyObject *)__pyx_v_self->target_dist_lookup);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 17, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 17, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.target_dist_lookup.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_lookup_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_lookup_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_lookup___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_lookup___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[122]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[1], 17, 0, 0, 0, __PYX_ERR(1, 17, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pred_dist_lookup);
  __pyx_r = ((PyObject *)__pyx_v_self->pred_dist_lookup);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 17, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 17, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.pred_dist_lookup.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":18
 *     cdef readonly int target_dist_offset, pred_dist_offset
 *     cdef readonly np.ndarray target_dist_lookup, pred_dist_lookup
 *     cdef readonly np.ndarray target_convolution_lookup, pred_convolution_lookup             # <<<<<<<<<<<<<<
 *     cdef readonly np.ndarray target_dist_deltas, pred_dist_deltas
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25target_convolution_lookup_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25target_convolution_lookup_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25target_convolution_lookup___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25target_convolution_lookup___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[123]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[1], 18, 0, 0, 0, __PYX_ERR(1, 18, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->target_convolution_lookup);
  __pyx_r = ((PyObject *)__pyx_v_self->target_convolution_lookup);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 18, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 18, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.target_convolution_lookup.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_23pred_convolution_lookup_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_23pred_convolution_lookup_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_23pred_convolution_lookup___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_23pred_convolution_lookup___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[124]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[1], 18, 0, 0, 0, __PYX_ERR(1, 18, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pred_convolution_lookup);
  __pyx_r = ((PyObject *)__pyx_v_self->pred_convolution_lookup);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 18, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 18, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.pred_convolution_lookup.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":19
 *     cdef readonly np.ndarray target_dist_lookup, pred_dist_lookup
 *     cdef readonly np.ndarray target_convolution_lookup, pred_convolution_lookup
 *     cdef readonly np.ndarray target_dist_deltas, pred_dist_deltas             # <<<<<<<<<<<<<<
 * 
 *     # the second hidden layer
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_deltas_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_deltas_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_deltas___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_deltas___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[125]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[1], 19, 0, 0, 0, __PYX_ERR(1, 19, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->target_dist_deltas);
  __pyx_r = ((PyObject *)__pyx_v_self->target_dist_deltas);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 19, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 19, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.target_dist_deltas.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_deltas_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_deltas_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_deltas___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_deltas___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[126]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[1], 19, 0, 0, 0, __PYX_ERR(1, 19, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pred_dist_deltas);
  __pyx_r = ((PyObject *)__pyx_v_self->pred_dist_deltas);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 19, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 19, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.pred_dist_deltas.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":22
 * 
 *     # the second hidden layer
 *     cdef readonly int hidden2_size             # <<<<<<<<<<<<<<
 *     cdef readonly np.ndarray hidden2_weights, hidden2_bias
 *     cdef readonly np.ndarray hidden2_values
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12hidden2_size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12hidden2_size_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12hidden2_size___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12hidden2_size___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[127]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[1], 22, 0, 0, 0, __PYX_ERR(1, 22, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->hidden2_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 22, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 22, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.hidden2_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":23
 *     # the second hidden layer
 *     cdef readonly int hidden2_size
 *     cdef readonly np.ndarray hidden2_weights, hidden2_bias             # <<<<<<<<<<<<<<
 *     cdef readonly np.ndarray hidden2_values
 *     cdef readonly np.ndarray hidden2_before_activation, hidden_before_activation
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15hidden2_weights_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15hidden2_weights_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15hidden2_weights___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15hidden2_weights___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[128]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[1], 23, 0, 0, 0, __PYX_ERR(1, 23, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden2_weights);
  __pyx_r = ((PyObject *)__pyx_v_self->hidden2_weights);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 23, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 23, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.hidden2_weights.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12hidden2_bias_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12hidden2_bias_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12hidden2_bias___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12hidden2_bias___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[129]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[1], 23, 0, 0, 0, __PYX_ERR(1, 23, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden2_bias);
  __pyx_r = ((PyObject *)__pyx_v_self->hidden2_bias);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 23, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 23, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.hidden2_bias.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":24
 *     cdef readonly int hidden2_size
 *     cdef readonly np.ndarray hidden2_weights, hidden2_bias
 *     cdef readonly np.ndarray hidden2_values             # <<<<<<<<<<<<<<
 *     cdef readonly np.ndarray hidden2_before_activation, hidden_before_activation
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_14hidden2_values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_14hidden2_values_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_14hidden2_values___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_14hidden2_values___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[130]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[1], 24, 0, 0, 0, __PYX_ERR(1, 24, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden2_values);
  __pyx_r = ((PyObject *)__pyx_v_self->hidden2_values);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 24, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 24, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.hidden2_values.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":25
 *     cdef readonly np.ndarray hidden2_weights, hidden2_bias
 *     cdef readonly np.ndarray hidden2_values
 *     cdef readonly np.ndarray hidden2_before_activation, hidden_before_activation             # <<<<<<<<<<<<<<
 * 
 *     # lookup of convolution values (the same for each sentence, used to save time)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25hidden2_before_activation_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25hidden2_before_activation_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25hidden2_before_activation___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25hidden2_before_activation___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[131]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[1], 25, 0, 0, 0, __PYX_ERR(1, 25, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden2_before_activation);
  __pyx_r = ((PyObject *)__pyx_v_self->hidden2_before_activation);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 25, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 25, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.hidden2_before_activation.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_24hidden_before_activation_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_24hidden_before_activation_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_24hidden_before_activation___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_24hidden_before_activation___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[132]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[1], 25, 0, 0, 0, __PYX_ERR(1, 25, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden_before_activation);
  __pyx_r = ((PyObject *)__pyx_v_self->hidden_before_activation);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 25, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 25, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.hidden_before_activation.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkconv.pyx":31
 * 
 *     # maximum convolution indices
 *     cdef readonly np.ndarray max_indices             # <<<<<<<<<<<<<<
 * 
 *     # number of targets (all tokens in a sentence or the provided arguments)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_11max_indices_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_11max_indices_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_11max_indices___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_11max_indices___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[133]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[1], 31, 0, 0, 0, __PYX_ERR(1, 31, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->max_indices);
  __pyx_r = ((PyObject *)__pyx_v_self->max_indices);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 31, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 31, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.max_indices.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_57__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_56__reduce_cython__, "ConvolutionalNetwork.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_57__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_57__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_56__reduce_cython__};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_57__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_56__reduce_cython__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_56__reduce_cython__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  int __pyx_t_24;
  int __pyx_t_25;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[134]))
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
  __Pyx_TraceStartFunc("__reduce_cython__", __pyx_f[4], 1, 0, 0, 0, __PYX_ERR(4, 1, __pyx_L1_error));

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.accuracy, self.answer_score, self.convolution_lookup, self.decay_factor, self.error, self.feature_tables, self.features_per_token, self.float_errors, self.half_window, self.hidden2_before_activation, self.hidden2_bias, self.hidden2_gradients, self.hidden2_size, self.hidden2_values, self.hidden2_weights, self.hidden_before_activation, self.hidden_bias, self.hidden_gradients, self.hidden_sent_values, self.hidden_size, self.hidden_values, self.hidden_weights, self.input_deltas, self.input_sent_values, self.input_size, self.input_values, self.layer2_sent_values, self.layer2_values, self.learning_rate, self.learning_rate_features, self.learning_rate_trans, self.max_indices, self.net_gradients, self.network_filename, self.network_text_filename, self.num_sentences, self.num_targets, self.num_tokens, self.only_classify, self.output_bias, self.output_size, self.output_weights, self.padding_left, self.padding_right, self.pos_padding, self.pre_padding, self.pred_convolution_lookup, self.pred_dist_deltas, self.pred_dist_lookup, self.pred_dist_offset, self.pred_dist_table, self.pred_dist_weights, self.sentence_accuracy, self.sentence_lookup, self.skips, self.target_convolution_lookup, self.target_dist_deltas, self.target_dist_lookup, self.target_dist_offset, self.target_dist_table, self.target_dist_weights, self.trans_gradients, self.transitions, self.use_learning_rate_decay, self.validation_arguments, self.validation_predicates, self.validation_sentences, self.validation_tags, self.word_window_size)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
*/
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.accuracy); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.answer_score); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.decay_factor); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.error); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.features_per_token); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.float_errors); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_self->half_window); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_self->hidden2_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.hidden_size); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.input_size); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.learning_rate); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.learning_rate_features); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.learning_rate_trans); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = __Pyx_PyLong_From_int(__pyx_v_self->num_sentences); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_15 = __Pyx_PyLong_From_int(__pyx_v_self->num_targets); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_16 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.num_tokens); if (unlikely(!__pyx_t_16)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_17 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.output_size); if (unlikely(!__pyx_t_17)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_18 = __Pyx_PyLong_From_int(__pyx_v_self->pred_dist_offset); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.sentence_accuracy); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_20 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.skips); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_21 = __Pyx_PyLong_From_int(__pyx_v_self->target_dist_offset); if (unlikely(!__pyx_t_21)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_21);
  __pyx_t_22 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.word_window_size); if (unlikely(!__pyx_t_22)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_22);
  __pyx_t_23 = PyTuple_New(69); if (unlikely(!__pyx_t_23)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_23);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_1) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_t_2) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->convolution_lookup);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->convolution_lookup);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 2, ((PyObject *)__pyx_v_self->convolution_lookup)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 3, __pyx_t_3) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 4, __pyx_t_4) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.feature_tables);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.feature_tables);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 5, __pyx_v_self->__pyx_base.feature_tables) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 6, __pyx_t_5) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 7, __pyx_t_6) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 8, __pyx_t_7) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden2_before_activation);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->hidden2_before_activation);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 9, ((PyObject *)__pyx_v_self->hidden2_before_activation)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden2_bias);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->hidden2_bias);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 10, ((PyObject *)__pyx_v_self->hidden2_bias)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden2_gradients);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->hidden2_gradients);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 11, ((PyObject *)__pyx_v_self->hidden2_gradients)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 12, __pyx_t_8) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden2_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->hidden2_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 13, ((PyObject *)__pyx_v_self->hidden2_values)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden2_weights);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->hidden2_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 14, ((PyObject *)__pyx_v_self->hidden2_weights)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden_before_activation);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->hidden_before_activation);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 15, ((PyObject *)__pyx_v_self->hidden_before_activation)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.hidden_bias);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.hidden_bias);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 16, ((PyObject *)__pyx_v_self->__pyx_base.hidden_bias)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->hidden_gradients);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->hidden_gradients);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 17, ((PyObject *)__pyx_v_self->hidden_gradients)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.hidden_sent_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.hidden_sent_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 18, ((PyObject *)__pyx_v_self->__pyx_base.hidden_sent_values)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_9);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 19, __pyx_t_9) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.hidden_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.hidden_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 20, ((PyObject *)__pyx_v_self->__pyx_base.hidden_values)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.hidden_weights);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.hidden_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 21, ((PyObject *)__pyx_v_self->__pyx_base.hidden_weights)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->input_deltas);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->input_deltas);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 22, ((PyObject *)__pyx_v_self->input_deltas)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.input_sent_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.input_sent_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 23, ((PyObject *)__pyx_v_self->__pyx_base.input_sent_values)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_10);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 24, __pyx_t_10) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.input_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.input_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 25, ((PyObject *)__pyx_v_self->__pyx_base.input_values)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.layer2_sent_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.layer2_sent_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 26, ((PyObject *)__pyx_v_self->__pyx_base.layer2_sent_values)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.layer2_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.layer2_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 27, ((PyObject *)__pyx_v_self->__pyx_base.layer2_values)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_11);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 28, __pyx_t_11) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_12);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 29, __pyx_t_12) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_13);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 30, __pyx_t_13) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->max_indices);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->max_indices);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 31, ((PyObject *)__pyx_v_self->max_indices)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.net_gradients);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.net_gradients);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 32, ((PyObject *)__pyx_v_self->__pyx_base.net_gradients)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.network_filename);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.network_filename);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 33, __pyx_v_self->__pyx_base.network_filename) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.network_text_filename);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.network_text_filename);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 34, __pyx_v_self->__pyx_base.network_text_filename) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_14);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 35, __pyx_t_14) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_15);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 36, __pyx_t_15) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_16);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 37, __pyx_t_16) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->only_classify);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->only_classify);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 38, ((PyObject *)__pyx_v_self->only_classify)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.output_bias);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.output_bias);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 39, ((PyObject *)__pyx_v_self->__pyx_base.output_bias)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_17);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 40, __pyx_t_17) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.output_weights);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.output_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 41, ((PyObject *)__pyx_v_self->__pyx_base.output_weights)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.padding_left);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.padding_left);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 42, ((PyObject *)__pyx_v_self->__pyx_base.padding_left)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.padding_right);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.padding_right);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 43, ((PyObject *)__pyx_v_self->__pyx_base.padding_right)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.pos_padding);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.pos_padding);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 44, ((PyObject *)__pyx_v_self->__pyx_base.pos_padding)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.pre_padding);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.pre_padding);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 45, ((PyObject *)__pyx_v_self->__pyx_base.pre_padding)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pred_convolution_lookup);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->pred_convolution_lookup);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 46, ((PyObject *)__pyx_v_self->pred_convolution_lookup)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pred_dist_deltas);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->pred_dist_deltas);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 47, ((PyObject *)__pyx_v_self->pred_dist_deltas)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pred_dist_lookup);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->pred_dist_lookup);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 48, ((PyObject *)__pyx_v_self->pred_dist_lookup)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_18);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 49, __pyx_t_18) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pred_dist_table);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->pred_dist_table);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 50, ((PyObject *)__pyx_v_self->pred_dist_table)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->pred_dist_weights);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->pred_dist_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 51, ((PyObject *)__pyx_v_self->pred_dist_weights)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_19);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 52, __pyx_t_19) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.sentence_lookup);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.sentence_lookup);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 53, ((PyObject *)__pyx_v_self->__pyx_base.sentence_lookup)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_20);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 54, __pyx_t_20) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->target_convolution_lookup);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->target_convolution_lookup);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 55, ((PyObject *)__pyx_v_self->target_convolution_lookup)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->target_dist_deltas);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->target_dist_deltas);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 56, ((PyObject *)__pyx_v_self->target_dist_deltas)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->target_dist_lookup);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->target_dist_lookup);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 57, ((PyObject *)__pyx_v_self->target_dist_lookup)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_21);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 58, __pyx_t_21) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->target_dist_table);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->target_dist_table);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 59, ((PyObject *)__pyx_v_self->target_dist_table)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->target_dist_weights);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->target_dist_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 60, ((PyObject *)__pyx_v_self->target_dist_weights)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.trans_gradients);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.trans_gradients);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 61, ((PyObject *)__pyx_v_self->__pyx_base.trans_gradients)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.transitions);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.transitions);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 62, ((PyObject *)__pyx_v_self->__pyx_base.transitions)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.use_learning_rate_decay);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.use_learning_rate_decay);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 63, ((PyObject *)__pyx_v_self->__pyx_base.use_learning_rate_decay)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->validation_arguments);
  __Pyx_GIVEREF(__pyx_v_self->validation_arguments);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 64, __pyx_v_self->validation_arguments) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->validation_predicates);
  __Pyx_GIVEREF(__pyx_v_self->validation_predicates);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 65, __pyx_v_self->validation_predicates) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.validation_sentences);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.validation_sentences);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 66, __pyx_v_self->__pyx_base.validation_sentences) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.validation_tags);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.validation_tags);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 67, __pyx_v_self->__pyx_base.validation_tags) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_22);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 68, __pyx_t_22) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_9 = 0;
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;
  __pyx_t_13 = 0;
  __pyx_t_14 = 0;
  __pyx_t_15 = 0;
  __pyx_t_16 = 0;
  __pyx_t_17 = 0;
  __pyx_t_18 = 0;
  __pyx_t_19 = 0;
  __pyx_t_20 = 0;
  __pyx_t_21 = 0;
  __pyx_t_22 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_23);
  __pyx_t_23 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.accuracy, self.answer_score, self.convolution_lookup, self.decay_factor, self.error, self.feature_tables, self.features_per_token, self.float_errors, self.half_window, self.hidden2_before_activation, self.hidden2_bias, self.hidden2_gradients, self.hidden2_size, self.hidden2_values, self.hidden2_weights, self.hidden_before_activation, self.hidden_bias, self.hidden_gradients, self.hidden_sent_values, self.hidden_size, self.hidden_values, self.hidden_weights, self.input_deltas, self.input_sent_values, self.input_size, self.input_values, self.layer2_sent_values, self.layer2_values, self.learning_rate, self.learning_rate_features, self.learning_rate_trans, self.max_indices, self.net_gradients, self.network_filename, self.network_text_filename, self.num_sentences, self.num_targets, self.num_tokens, self.only_classify, self.output_bias, self.output_size, self.output_weights, self.padding_left, self.padding_right, self.pos_padding, self.pre_padding, self.pred_convolution_lookup, self.pred_dist_deltas, self.pred_dist_lookup, self.pred_dist_offset, self.pred_dist_table, self.pred_dist_weights, self.sentence_accuracy, self.sentence_lookup, self.skips, self.target_convolution_lookup, self.target_dist_deltas, self.target_dist_lookup, self.target_dist_offset, self.target_dist_table, self.target_dist_weights, self.trans_gradients, self.transitions, self.use_learning_rate_decay, self.validation_arguments, self.validation_predicates, self.validation_sentences, self.validation_tags, self.word_window_size)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
*/
  __pyx_t_23 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_23)) __PYX_ERR(4, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_23);
  __pyx_v__dict = __pyx_t_23;
  __pyx_t_23 = 0;

  /* "(tree fragment)":7
 *     state = (self.accuracy, self.answer_score, self.convolution_lookup, self.decay_factor, self.error, self.feature_tables, self.features_per_token, self.float_errors, self.half_window, self.hidden2_before_activation, self.hidden2_bias, self.hidden2_gradients, self.hidden2_size, self.hidden2_values, self.hidden2_weights, self.hidden_before_activation, self.hidden_bias, self.hidden_gradients, self.hidden_sent_values, self.hidden_size, self.hidden_values, self.hidden_weights, self.input_deltas, self.input_sent_values, self.input_size, self.input_values, self.layer2_sent_values, self.layer2_values, self.learning_rate, self.learning_rate_features, self.learning_rate_trans, self.max_indices, self.net_gradients, self.network_filename, self.network_text_filename, self.num_sentences, self.num_targets, self.num_tokens, self.only_classify, self.output_bias, self.output_size, self.output_weights, self.padding_left, self.padding_right, self.pos_padding, self.pre_padding, self.pred_convolution_lookup, self.pred_dist_deltas, self.pred_dist_lookup, self.pred_dist_offset, self.pred_dist_table, self.pred_dist_weights, self.sentence_accuracy, self.sentence_lookup, self.skips, self.target_convolution_lookup, self.target_dist_deltas, self.target_dist_lookup, self.target_dist_offset, self.target_dist_table, self.target_dist_weights, self.trans_gradients, self.transitions, self.use_learning_rate_decay, self.validation_arguments, self.validation_predicates, self.validation_sentences, self.validation_tags, self.word_window_size)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_24 = (__pyx_v__dict != Py_None);
  if (__pyx_t_24) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_23 = PyTuple_New(1); if (unlikely(!__pyx_t_23)) __PYX_ERR(4, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_23);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_v__dict) != (0)) __PYX_ERR(4, 8, __pyx_L1_error);
    __pyx_t_22 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_23); if (unlikely(!__pyx_t_22)) __PYX_ERR(4, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_22);
    __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_22));
    __pyx_t_22 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.convolution_lookup is not None or self.feature_tables is not None or self.hidden2_before_activation is not None or self.hidden2_bias is not None or self.hidden2_gradients is not None or self.hidden2_values is not None or self.hidden2_weights is not None or self.hidden_before_activation is not None or self.hidden_bias is not None or self.hidden_gradients is not None or self.hidden_sent_values is not None or self.hidden_values is not None or self.hidden_weights is not None or self.input_deltas is not None or self.input_sent_values is not None or self.input_values is not None or self.layer2_sent_values is not None or self.layer2_values is not None or self.max_indices is not None or self.net_gradients is not None or self.network_filename is not None or self.network_text_filename is not None or self.only_classify is not None or self.output_bias is not None or self.output_weights is not None or self.padding_left is not None or self.padding_right is not None or self.pos_padding is not None or self.pre_padding is not None or self.pred_convolution_lookup is not None or self.pred_dist_deltas is not None or self.pred_dist_lookup is not None or self.pred_dist_table is not None or self.pred_dist_weights is not None or self.sentence_lookup is not None or self.target_convolution_lookup is not None or self.target_dist_deltas is not None or self.target_dist_lookup is not None or self.target_dist_table is not None or self.target_dist_weights is not None or self.trans_gradients is not None or self.transitions is not None or self.use_learning_rate_decay is not None or self.validation_arguments is not None or self.validation_predicates is not None or self.validation_sentences is not None or self.validation_tags is not None
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.accuracy, self.answer_score, self.convolution_lookup, self.decay_factor, self.error, self.feature_tables, self.features_per_token, self.float_errors, self.half_window, self.hidden2_before_activation, self.hidden2_bias, self.hidden2_gradients, self.hidden2_size, self.hidden2_values, self.hidden2_weights, self.hidden_before_activation, self.hidden_bias, self.hidden_gradients, self.hidden_sent_values, self.hidden_size, self.hidden_values, self.hidden_weights, self.input_deltas, self.input_sent_values, self.input_size, self.input_values, self.layer2_sent_values, self.layer2_values, self.learning_rate, self.learning_rate_features, self.learning_rate_trans, self.max_indices, self.net_gradients, self.network_filename, self.network_text_filename, self.num_sentences, self.num_targets, self.num_tokens, self.only_classify, self.output_bias, self.output_size, self.output_weights, self.padding_left, self.padding_right, self.pos_padding, self.pre_padding, self.pred_convolution_lookup, self.pred_dist_deltas, self.pred_dist_lookup, self.pred_dist_offset, self.pred_dist_table, self.pred_dist_weights, self.sentence_accuracy, self.sentence_lookup, self.skips, self.target_convolution_lookup, self.target_dist_deltas, self.target_dist_lookup, self.target_dist_offset, self.target_dist_table, self.target_dist_weights, self.trans_gradients, self.transitions, self.use_learning_rate_decay, self.validation_arguments, self.validation_predicates, self.validation_sentences, self.validation_tags, self.word_window_size)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.convolution_lookup is not None or self.feature_tables is not None or self.hidden2_before_activation is not None or self.hidden2_bias is not None or self.hidden2_gradients is not None or self.hidden2_values is not None or self.hidden2_weights is not None or self.hidden_before_activation is not None or self.hidden_bias is not None or self.hidden_gradients is not None or self.hidden_sent_values is not None or self.hidden_values is not None or self.hidden_weights is not None or self.input_deltas is not None or self.input_sent_values is not None or self.input_values is not None or self.layer2_sent_values is not None or self.layer2_values is not None or self.max_indices is not None or self.net_gradients is not None or self.network_filename is not None or self.network_text_filename is not None or self.only_classify is not None or self.output_bias is not None or self.output_weights is not None or self.padding_left is not None or self.padding_right is not None or self.pos_padding is not None or self.pre_padding is not None or self.pred_convolution_lookup is not None or self.pred_dist_deltas is not None or self.pred_dist_lookup is not None or self.pred_dist_table is not None or self.pred_dist_weights is not None or self.sentence_lookup is not None or self.target_convolution_lookup is not None or self.target_dist_deltas is not None or self.target_dist_lookup is not None or self.target_dist_table is not None or self.target_dist_weights is not None or self.trans_gradients is not None or self.transitions is not None or self.use_learning_rate_decay is not None or self.validation_arguments is not None or self.validation_predicates is not None or self.validation_sentences is not None or self.validation_tags is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_ConvolutionalNetwork, (type(self), 0x2f64fba, None), state
*/
  /*else*/ {
    __pyx_t_25 = (((PyObject *)__pyx_v_self->convolution_lookup) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->__pyx_base.feature_tables != ((PyObject*)Py_None));
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->hidden2_before_activation) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->hidden2_bias) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->hidden2_gradients) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->hidden2_values) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->hidden2_weights) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->hidden_before_activation) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.hidden_bias) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->hidden_gradients) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.hidden_sent_values) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.hidden_values) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.hidden_weights) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->input_deltas) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.input_sent_values) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.input_values) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.layer2_sent_values) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.layer2_values) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->max_indices) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.net_gradients) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->__pyx_base.network_filename != ((PyObject*)Py_None));
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->__pyx_base.network_text_filename != ((PyObject*)Py_None));
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->only_classify) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.output_bias) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.output_weights) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.padding_left) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.padding_right) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.pos_padding) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.pre_padding) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->pred_convolution_lookup) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->pred_dist_deltas) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->pred_dist_lookup) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->pred_dist_table) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->pred_dist_weights) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.sentence_lookup) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->target_convolution_lookup) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->target_dist_deltas) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->target_dist_lookup) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->target_dist_table) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->target_dist_weights) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.trans_gradients) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.transitions) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.use_learning_rate_decay) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->validation_arguments != ((PyObject*)Py_None));
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->validation_predicates != ((PyObject*)Py_None));
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->__pyx_base.validation_sentences != ((PyObject*)Py_None));
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->__pyx_base.validation_tags != ((PyObject*)Py_None));
    __pyx_t_24 = __pyx_t_25;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_24;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.convolution_lookup is not None or self.feature_tables is not None or self.hidden2_before_activation is not None or self.hidden2_bias is not None or self.hidden2_gradients is not None or self.hidden2_values is not None or self.hidden2_weights is not None or self.hidden_before_activation is not None or self.hidden_bias is not None or self.hidden_gradients is not None or self.hidden_sent_values is not None or self.hidden_values is not None or self.hidden_weights is not None or self.input_deltas is not None or self.input_sent_values is not None or self.input_values is not None or self.layer2_sent_values is not None or self.layer2_values is not None or self.max_indices is not None or self.net_gradients is not None or self.network_filename is not None or self.network_text_filename is not None or self.only_classify is not None or self.output_bias is not None or self.output_weights is not None or self.padding_left is not None or self.padding_right is not None or self.pos_padding is not None or self.pre_padding is not None or self.pred_convolution_lookup is not None or self.pred_dist_deltas is not None or self.pred_dist_lookup is not None or self.pred_dist_table is not None or self.pred_dist_weights is not None or self.sentence_lookup is not None or self.target_convolution_lookup is not None or self.target_dist_deltas is not None or self.target_dist_lookup is not None or self.target_dist_table is not None or self.target_dist_weights is not None or self.trans_gradients is not None or self.transitions is not None or self.use_learning_rate_decay is not None or self.validation_arguments is not None or self.validation_predicates is not None or self.validation_sentences is not None or self.validation_tags is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_ConvolutionalNetwork, (type(self), 0x2f64fba, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = self.convolution_lookup is not None or self.feature_tables is not None or self.hidden2_before_activation is not None or self.hidden2_bias is not None or self.hidden2_gradients is not None or self.hidden2_values is not None or self.hidden2_weights is not None or self.hidden_before_activation is not None or self.hidden_bias is not None or self.hidden_gradients is not None or self.hidden_sent_values is not None or self.hidden_values is not None or self.hidden_weights is not None or self.input_deltas is not None or self.input_sent_values is not None or self.input_values is not None or self.layer2_sent_values is not None or self.layer2_values is not None or self.max_indices is not None or self.net_gradients is not None or self.network_filename is not None or self.network_text_filename is not None or self.only_classify is not None or self.output_bias is not None or self.output_weights is not None or self.padding_left is not None or self.padding_right is not None or self.pos_padding is not None or self.pre_padding is not None or self.pred_convolution_lookup is not None or self.pred_dist_deltas is not None or self.pred_dist_lookup is not None or self.pred_dist_table is not None or self.pred_dist_weights is not None or self.sentence_lookup is not None or self.target_convolution_lookup is not None or self.target_dist_deltas is not None or self.target_dist_lookup is not None or self.target_dist_table is not None or self.target_dist_weights is not None or self.trans_gradients is not None or self.transitions is not None or self.use_learning_rate_decay is not None or self.validation_arguments is not None or self.validation_predicates is not None or self.validation_sentences is not None or self.validation_tags is not None
 *     if use_setstate:
 *         return __pyx_unpickle_ConvolutionalNetwork, (type(self), 0x2f64fba, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_ConvolutionalNetwork, (type(self), 0x2f64fba, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_22, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ConvolutionalNetw); if (unlikely(!__pyx_t_22)) __PYX_ERR(4, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_22);
    __pyx_t_23 = PyTuple_New(3); if (unlikely(!__pyx_t_23)) __PYX_ERR(4, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_23);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(4, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_49696698);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_49696698);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_mstate_global->__pyx_int_49696698) != (0)) __PYX_ERR(4, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 2, Py_None) != (0)) __PYX_ERR(4, 13, __pyx_L1_error);
    __pyx_t_21 = PyTuple_New(3); if (unlikely(!__pyx_t_21)) __PYX_ERR(4, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_21);
    __Pyx_GIVEREF(__pyx_t_22);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_22) != (0)) __PYX_ERR(4, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_23);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_23) != (0)) __PYX_ERR(4, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 2, __pyx_v_state) != (0)) __PYX_ERR(4, 13, __pyx_L1_error);
    __pyx_t_22 = 0;
    __pyx_t_23 = 0;
    __pyx_r = __pyx_t_21;
    __pyx_t_21 = 0;
    __Pyx_TraceReturnValue(__pyx_r, 391, 0, __PYX_ERR(4, 13, __pyx_L1_error));
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.convolution_lookup is not None or self.feature_tables is not None or self.hidden2_before_activation is not None or self.hidden2_bias is not None or self.hidden2_gradients is not None or self.hidden2_values is not None or self.hidden2_weights is not None or self.hidden_before_activation is not None or self.hidden_bias is not None or self.hidden_gradients is not None or self.hidden_sent_values is not None or self.hidden_values is not None or self.hidden_weights is not None or self.input_deltas is not None or self.input_sent_values is not None or self.input_values is not None or self.layer2_sent_values is not None or self.layer2_values is not None or self.max_indices is not None or self.net_gradients is not None or self.network_filename is not None or self.network_text_filename is not None or self.only_classify is not None or self.output_bias is not None or self.output_weights is not None or self.padding_left is not None or self.padding_right is not None or self.pos_padding is not None or self.pre_padding is not None or self.pred_convolution_lookup is not None or self.pred_dist_deltas is not None or self.pred_dist_lookup is not None or self.pred_dist_table is not None or self.pred_dist_weights is not None or self.sentence_lookup is not None or self.target_convolution_lookup is not None or self.target_dist_deltas is not None or self.target_dist_lookup is not None or self.target_dist_table is not None or self.target_dist_weights is not None or self.trans_gradients is not None or self.transitions is not None or self.use_learning_rate_decay is not None or self.validation_arguments is not None or self.validation_predicates is not None or self.validation_sentences is not None or self.validation_tags is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_ConvolutionalNetwork, (type(self), 0x2f64fba, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_ConvolutionalNetwork, (type(self), 0x2f64fba, None), state
 *     else:
 *         return __pyx_unpickle_ConvolutionalNetwork, (type(self), 0x2f64fba, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_ConvolutionalNetwork__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ConvolutionalNetw); if (unlikely(!__pyx_t_21)) __PYX_ERR(4, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_21);
    __pyx_t_23 = PyTuple_New(3); if (unlikely(!__pyx_t_23)) __PYX_ERR(4, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_23);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(4, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_49696698);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_49696698);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_mstate_global->__pyx_int_49696698) != (0)) __PYX_ERR(4, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 2, __pyx_v_state) != (0)) __PYX_ERR(4, 15, __pyx_L1_error);
    __pyx_t_22 = PyTuple_New(2); if (unlikely(!__pyx_t_22)) __PYX_ERR(4, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_22);
    __Pyx_GIVEREF(__pyx_t_21);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_21) != (0)) __PYX_ERR(4, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_23);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_23) != (0)) __PYX_ERR(4, 15, __pyx_L1_error);
    __pyx_t_21 = 0;
    __pyx_t_23 = 0;
    __pyx_r = __pyx_t_22;
    __pyx_t_22 = 0;
    __Pyx_TraceReturnValue(__pyx_r, 399, 0, __PYX_ERR(4, 15, __pyx_L1_error));
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_XDECREF(__pyx_t_21);
  __Pyx_XDECREF(__pyx_t_22);
  __Pyx_XDECREF(__pyx_t_23);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(4, 1, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ConvolutionalNetwork, (type(self), 0x2f64fba, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ConvolutionalNetwork__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_59__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_58__setstate_cython__, "ConvolutionalNetwork.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_59__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_59__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_58__setstate_cython__};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_59__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 16, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 16, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < 0) __PYX_ERR(4, 16, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(4, 16, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 16, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(4, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_58__setstate_cython__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_58__setstate_cython__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[135]))
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
  __Pyx_TraceStartFunc("__setstate_cython__", __pyx_f[4], 16, 0, 0, 0, __PYX_ERR(4, 16, __pyx_L1_error));

  /* "(tree fragment)":17
 *         return __pyx_unpickle_ConvolutionalNetwork, (type(self), 0x2f64fba, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_ConvolutionalNetwork__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(4, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_6nltkor_3tag_4libs_7network___pyx_unpickle_ConvolutionalNetwork__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ConvolutionalNetwork, (type(self), 0x2f64fba, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ConvolutionalNetwork__set_state(self, __pyx_state)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(4, 16, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(4, 16, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalNetwork.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":19
 *     cdef validation_heads
 * 
 *     def save(self):             # <<<<<<<<<<<<<<
 *         """
 *         Saves the neural network to a file.
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_1save(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_save, "ConvolutionalDependencyNetwork.save(self)\nSaves the neural network to a file.\nIt will save the weights, biases, sizes, padding and \ndistance tables, and other feature tables.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_1save = {"save", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_1save, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_save};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_1save(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("save", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("save", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_save(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_save(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self) {
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[136]))
  __Pyx_RefNannySetupContext("save", 0);
  __Pyx_TraceStartFunc("save", __pyx_f[5], 19, 0, 0, 0, __PYX_ERR(5, 19, __pyx_L1_error));

  /* "nltkor/tag/libs/networkdependencyconv.pyx":25
 *         distance tables, and other feature tables.
 *         """
 *         data = self._generate_save_dict()             # <<<<<<<<<<<<<<
 * 
 *         np.savez(self.network_filename, **data)
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_generate_save_dict, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 25, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_data = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":27
 *         data = self._generate_save_dict()
 * 
 *         np.savez(self.network_filename, **data)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_savez); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(__pyx_v_data == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
    __PYX_ERR(5, 27, __pyx_L1_error)
  }
  if (likely(PyDict_CheckExact(__pyx_v_data))) {
    __pyx_t_4 = PyDict_Copy(__pyx_v_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 27, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 27, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_3 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_3 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self->__pyx_base.__pyx_base.network_filename};
    __pyx_t_1 = __Pyx_PyObject_FastCallDict(__pyx_t_5, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 27, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":19
 *     cdef validation_heads
 * 
 *     def save(self):             # <<<<<<<<<<<<<<
 *         """
 *         Saves the neural network to a file.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(5, 19, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(5, 19, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork.save", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":29
 *         np.savez(self.network_filename, **data)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def load_from_file(cls, filename):
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_3load_from_file(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_2load_from_file, "ConvolutionalDependencyNetwork.load_from_file(cls, filename)\nLoads the neural network from a file.\nIt will load weights, biases, sizes, padding and \ndistance tables, and other feature tables.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_3load_from_file = {"load_from_file", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_3load_from_file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_2load_from_file};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_3load_from_file(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_filename = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("load_from_file (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_filename,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(5, 29, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 29, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "load_from_file", 0) < 0) __PYX_ERR(5, 29, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("load_from_file", 1, 1, 1, i); __PYX_ERR(5, 29, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 29, __pyx_L3_error)
    }
    __pyx_v_filename = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("load_from_file", 1, 1, 1, __pyx_nargs); __PYX_ERR(5, 29, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork.load_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_2load_from_file(((PyTypeObject*)__pyx_v_cls), __pyx_v_filename);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_2load_from_file(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_filename) {
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_nn = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[137]))
  __Pyx_RefNannySetupContext("load_from_file", 0);
  __Pyx_TraceStartFunc("load_from_file", __pyx_f[5], 29, 0, 0, 0, __PYX_ERR(5, 29, __pyx_L1_error));

  /* "nltkor/tag/libs/networkdependencyconv.pyx":36
 *         distance tables, and other feature tables.
 *         """
 *         data = np.load(filename, allow_pickle=True)             # <<<<<<<<<<<<<<
 *         nn = cls._load_from_file(data, filename)
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_load); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_v_filename};
    __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 36, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_allow_pickle, Py_True, __pyx_t_3, __pyx_callargs+2, 0) < 0) __PYX_ERR(5, 36, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 36, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_data = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":37
 *         """
 *         data = np.load(filename, allow_pickle=True)
 *         nn = cls._load_from_file(data, filename)             # <<<<<<<<<<<<<<
 * 
 *         return nn
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_cls);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_data, __pyx_v_filename};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_load_from_file, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 37, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_nn = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":39
 *         nn = cls._load_from_file(data, filename)
 * 
 *         return nn             # <<<<<<<<<<<<<<
 * 
 *     def train(self, list sentences, list heads, int epochs,
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_nn);
  __pyx_r = __pyx_v_nn;
  __Pyx_TraceReturnValue(__pyx_r, 14, 0, __PYX_ERR(5, 39, __pyx_L1_error));
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":29
 *         np.savez(self.network_filename, **data)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def load_from_file(cls, filename):
 *         """
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(5, 29, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork.load_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_nn);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":41
 *         return nn
 * 
 *     def train(self, list sentences, list heads, int epochs,             # <<<<<<<<<<<<<<
 *               int epochs_between_reports=0, float desired_accuracy=0,
 *               list labels=None):
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_5train(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_4train, "ConvolutionalDependencyNetwork.train(self, list sentences, list heads, int epochs, int epochs_between_reports=0, float desired_accuracy=0, list labels=None)\nTrains the convolutional network. Refer to the basic Network\ntrain method for detailed explanation. ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_5train = {"train", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_5train, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_4train};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_5train(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_sentences = 0;
  PyObject *__pyx_v_heads = 0;
  int __pyx_v_epochs;
  int __pyx_v_epochs_between_reports;
  float __pyx_v_desired_accuracy;
  PyObject *__pyx_v_labels = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("train (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sentences,&__pyx_mstate_global->__pyx_n_u_heads,&__pyx_mstate_global->__pyx_n_u_epochs,&__pyx_mstate_global->__pyx_n_u_epochs_between_reports,&__pyx_mstate_global->__pyx_n_u_desired_accuracy,&__pyx_mstate_global->__pyx_n_u_labels,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(5, 41, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(5, 41, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(5, 41, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(5, 41, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(5, 41, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(5, 41, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 41, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "train", 0) < 0) __PYX_ERR(5, 41, __pyx_L3_error)

      /* "nltkor/tag/libs/networkdependencyconv.pyx":43
 *     def train(self, list sentences, list heads, int epochs,
 *               int epochs_between_reports=0, float desired_accuracy=0,
 *               list labels=None):             # <<<<<<<<<<<<<<
 *         """
 *         Trains the convolutional network. Refer to the basic Network
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject*)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("train", 0, 3, 6, i); __PYX_ERR(5, 41, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(5, 41, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(5, 41, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(5, 41, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(5, 41, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(5, 41, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 41, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject*)Py_None));
    }
    __pyx_v_sentences = ((PyObject*)values[0]);
    __pyx_v_heads = ((PyObject*)values[1]);
    __pyx_v_epochs = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_epochs == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 41, __pyx_L3_error)
    if (values[3]) {
      __pyx_v_epochs_between_reports = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_epochs_between_reports == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 42, __pyx_L3_error)
    } else {
      __pyx_v_epochs_between_reports = ((int)0);
    }
    if (values[4]) {
      __pyx_v_desired_accuracy = __Pyx_PyFloat_AsFloat(values[4]); if (unlikely((__pyx_v_desired_accuracy == (float)-1) && PyErr_Occurred())) __PYX_ERR(5, 42, __pyx_L3_error)
    } else {
      __pyx_v_desired_accuracy = ((float)0.0);
    }
    __pyx_v_labels = ((PyObject*)values[5]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("train", 0, 3, 6, __pyx_nargs); __PYX_ERR(5, 41, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork.train", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sentences), (&PyList_Type), 1, "sentences", 1))) __PYX_ERR(5, 41, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_heads), (&PyList_Type), 1, "heads", 1))) __PYX_ERR(5, 41, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), (&PyList_Type), 1, "labels", 1))) __PYX_ERR(5, 43, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_4train(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self), __pyx_v_sentences, __pyx_v_heads, __pyx_v_epochs, __pyx_v_epochs_between_reports, __pyx_v_desired_accuracy, __pyx_v_labels);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":41
 *         return nn
 * 
 *     def train(self, list sentences, list heads, int epochs,             # <<<<<<<<<<<<<<
 *               int epochs_between_reports=0, float desired_accuracy=0,
 *               list labels=None):
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_4train(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyObject *__pyx_v_sentences, PyObject *__pyx_v_heads, int __pyx_v_epochs, int __pyx_v_epochs_between_reports, float __pyx_v_desired_accuracy, PyObject *__pyx_v_labels) {
  PyObject *__pyx_v_predicates = NULL;
  PyObject *__pyx_8genexpr9__pyx_v_sentence = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  size_t __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[138]))
  __Pyx_RefNannySetupContext("train", 0);
  __Pyx_TraceStartFunc("train", __pyx_f[5], 41, 0, 0, 0, __PYX_ERR(5, 41, __pyx_L1_error));

  /* "nltkor/tag/libs/networkdependencyconv.pyx":50
 *         # the ConvolutionalNetwork class was written primarily for SRL
 *         # every token acts as a predicate, and we don't need to tell it explicitely
 *         predicates = [np.arange(len(sentence)) for sentence in sentences]             # <<<<<<<<<<<<<<
 * 
 *         # the last argument in ConvolutionalNetwork.train is actually the argument
*/
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 50, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(__pyx_v_sentences == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(5, 50, __pyx_L5_error)
    }
    __pyx_t_2 = __pyx_v_sentences; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 50, __pyx_L5_error)
        #endif
        if (__pyx_t_3 >= __pyx_temp) break;
      }
      __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3);
      ++__pyx_t_3;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 50, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_sentence, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 50, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_arange); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 50, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_8 = PyObject_Length(__pyx_8genexpr9__pyx_v_sentence); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(5, 50, __pyx_L5_error)
      __pyx_t_6 = PyLong_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 50, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        assert(__pyx_t_5);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
        __pyx_t_9 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 50, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(5, 50, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_sentence); __pyx_8genexpr9__pyx_v_sentence = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_sentence); __pyx_8genexpr9__pyx_v_sentence = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_v_predicates = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":56
 *         # argument, which is correctly handled by the DependencyNetwork._tag(...) method.
 * 
 *         if self.validation_sentences is None:             # <<<<<<<<<<<<<<
 *             self.set_validation_data(sentences, heads, labels)
 * 
*/
  __pyx_t_10 = (__pyx_v_self->__pyx_base.__pyx_base.validation_sentences == ((PyObject*)Py_None));
  if (__pyx_t_10) {

    /* "nltkor/tag/libs/networkdependencyconv.pyx":57
 * 
 *         if self.validation_sentences is None:
 *             self.set_validation_data(sentences, heads, labels)             # <<<<<<<<<<<<<<
 * 
 *         super(ConvolutionalDependencyNetwork, self).train(sentences, predicates,
*/
    __pyx_t_2 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_sentences, __pyx_v_heads, __pyx_v_labels};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_set_validation_data, __pyx_callargs+__pyx_t_9, (4-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 57, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":56
 *         # argument, which is correctly handled by the DependencyNetwork._tag(...) method.
 * 
 *         if self.validation_sentences is None:             # <<<<<<<<<<<<<<
 *             self.set_validation_data(sentences, heads, labels)
 * 
*/
  }

  /* "nltkor/tag/libs/networkdependencyconv.pyx":59
 *             self.set_validation_data(sentences, heads, labels)
 * 
 *         super(ConvolutionalDependencyNetwork, self).train(sentences, predicates,             # <<<<<<<<<<<<<<
 *                                                           heads, epochs,
 *                                                           epochs_between_reports,
*/
  __pyx_t_7 = NULL;
  __Pyx_INCREF(__pyx_builtin_super);
  __pyx_t_6 = __pyx_builtin_super; 
  __pyx_t_9 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_7, ((PyObject *)__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork), ((PyObject *)__pyx_v_self)};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 59, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_2 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_2);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":60
 * 
 *         super(ConvolutionalDependencyNetwork, self).train(sentences, predicates,
 *                                                           heads, epochs,             # <<<<<<<<<<<<<<
 *                                                           epochs_between_reports,
 *                                                           desired_accuracy,
*/
  __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_epochs); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":61
 *         super(ConvolutionalDependencyNetwork, self).train(sentences, predicates,
 *                                                           heads, epochs,
 *                                                           epochs_between_reports,             # <<<<<<<<<<<<<<
 *                                                           desired_accuracy,
 *                                                           labels)
*/
  __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_epochs_between_reports); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":62
 *                                                           heads, epochs,
 *                                                           epochs_between_reports,
 *                                                           desired_accuracy,             # <<<<<<<<<<<<<<
 *                                                           labels)
 * 
*/
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_desired_accuracy); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":63
 *                                                           epochs_between_reports,
 *                                                           desired_accuracy,
 *                                                           labels)             # <<<<<<<<<<<<<<
 * 
 *     def set_validation_data(self, list sentences, list heads, list labels=None):
*/
  __pyx_t_9 = 0;
  {
    PyObject *__pyx_callargs[8] = {__pyx_t_2, __pyx_v_sentences, __pyx_v_predicates, __pyx_v_heads, __pyx_t_6, __pyx_t_7, __pyx_t_5, __pyx_v_labels};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_train, __pyx_callargs+__pyx_t_9, (8-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 59, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":41
 *         return nn
 * 
 *     def train(self, list sentences, list heads, int epochs,             # <<<<<<<<<<<<<<
 *               int epochs_between_reports=0, float desired_accuracy=0,
 *               list labels=None):
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(5, 41, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(5, 41, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork.train", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_predicates);
  __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_sentence);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":65
 *                                                           labels)
 * 
 *     def set_validation_data(self, list sentences, list heads, list labels=None):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the data to be used in validation during training. If this function
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_7set_validation_data(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_6set_validation_data, "ConvolutionalDependencyNetwork.set_validation_data(self, list sentences, list heads, list labels=None)\nSets the data to be used in validation during training. If this function\nis not called before training, the training data itself is used to \nmeasure the model's performance.\n\n:param labels: only used when learning labels");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_7set_validation_data = {"set_validation_data", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_7set_validation_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_6set_validation_data};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_7set_validation_data(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_sentences = 0;
  PyObject *__pyx_v_heads = 0;
  PyObject *__pyx_v_labels = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_validation_data (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sentences,&__pyx_mstate_global->__pyx_n_u_heads,&__pyx_mstate_global->__pyx_n_u_labels,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(5, 65, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(5, 65, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(5, 65, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 65, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_validation_data", 0) < 0) __PYX_ERR(5, 65, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_validation_data", 0, 2, 3, i); __PYX_ERR(5, 65, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(5, 65, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(5, 65, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 65, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)Py_None));
    }
    __pyx_v_sentences = ((PyObject*)values[0]);
    __pyx_v_heads = ((PyObject*)values[1]);
    __pyx_v_labels = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_validation_data", 0, 2, 3, __pyx_nargs); __PYX_ERR(5, 65, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork.set_validation_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sentences), (&PyList_Type), 1, "sentences", 1))) __PYX_ERR(5, 65, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_heads), (&PyList_Type), 1, "heads", 1))) __PYX_ERR(5, 65, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), (&PyList_Type), 1, "labels", 1))) __PYX_ERR(5, 65, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_6set_validation_data(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self), __pyx_v_sentences, __pyx_v_heads, __pyx_v_labels);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_6set_validation_data(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyObject *__pyx_v_sentences, PyObject *__pyx_v_heads, PyObject *__pyx_v_labels) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[139]))
  __Pyx_RefNannySetupContext("set_validation_data", 0);
  __Pyx_TraceStartFunc("set_validation_data", __pyx_f[5], 65, 0, 0, 0, __PYX_ERR(5, 65, __pyx_L1_error));

  /* "nltkor/tag/libs/networkdependencyconv.pyx":73
 *         :param labels: only used when learning labels
 *         """
 *         self.validation_sentences = sentences             # <<<<<<<<<<<<<<
 *         self.validation_tags = labels
 *         self.validation_heads = heads
*/
  __Pyx_INCREF(__pyx_v_sentences);
  __Pyx_GIVEREF(__pyx_v_sentences);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.__pyx_base.validation_sentences);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.__pyx_base.validation_sentences);
  __pyx_v_self->__pyx_base.__pyx_base.validation_sentences = __pyx_v_sentences;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":74
 *         """
 *         self.validation_sentences = sentences
 *         self.validation_tags = labels             # <<<<<<<<<<<<<<
 *         self.validation_heads = heads
 * 
*/
  __Pyx_INCREF(__pyx_v_labels);
  __Pyx_GIVEREF(__pyx_v_labels);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.__pyx_base.validation_tags);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.__pyx_base.validation_tags);
  __pyx_v_self->__pyx_base.__pyx_base.validation_tags = __pyx_v_labels;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":75
 *         self.validation_sentences = sentences
 *         self.validation_tags = labels
 *         self.validation_heads = heads             # <<<<<<<<<<<<<<
 * 
 *     def _tag_sentence(self, sentence, predicates=None, heads=None, labels=None):
*/
  __Pyx_INCREF(__pyx_v_heads);
  __Pyx_GIVEREF(__pyx_v_heads);
  __Pyx_GOTREF(__pyx_v_self->validation_heads);
  __Pyx_DECREF(__pyx_v_self->validation_heads);
  __pyx_v_self->validation_heads = __pyx_v_heads;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":65
 *                                                           labels)
 * 
 *     def set_validation_data(self, list sentences, list heads, list labels=None):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the data to be used in validation during training. If this function
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(5, 65, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(5, 65, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork.set_validation_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":77
 *         self.validation_heads = heads
 * 
 *     def _tag_sentence(self, sentence, predicates=None, heads=None, labels=None):             # <<<<<<<<<<<<<<
 *         """
 *         This function is just an interface to the _tag_sentence signature
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_9_tag_sentence(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_8_tag_sentence, "ConvolutionalDependencyNetwork._tag_sentence(self, sentence, predicates=None, heads=None, labels=None)\nThis function is just an interface to the _tag_sentence signature\ndefined in ConvolutionalNetwork.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_9_tag_sentence = {"_tag_sentence", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_9_tag_sentence, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_8_tag_sentence};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_9_tag_sentence(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_sentence = 0;
  CYTHON_UNUSED PyObject *__pyx_v_predicates = 0;
  PyObject *__pyx_v_heads = 0;
  PyObject *__pyx_v_labels = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_tag_sentence (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sentence,&__pyx_mstate_global->__pyx_n_u_predicates,&__pyx_mstate_global->__pyx_n_u_heads,&__pyx_mstate_global->__pyx_n_u_labels,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(5, 77, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(5, 77, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(5, 77, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(5, 77, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 77, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_tag_sentence", 0) < 0) __PYX_ERR(5, 77, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_tag_sentence", 0, 1, 4, i); __PYX_ERR(5, 77, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(5, 77, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(5, 77, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(5, 77, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 77, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_sentence = values[0];
    __pyx_v_predicates = values[1];
    __pyx_v_heads = values[2];
    __pyx_v_labels = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_tag_sentence", 0, 1, 4, __pyx_nargs); __PYX_ERR(5, 77, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._tag_sentence", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_8_tag_sentence(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self), __pyx_v_sentence, __pyx_v_predicates, __pyx_v_heads, __pyx_v_labels);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_8_tag_sentence(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyObject *__pyx_v_sentence, CYTHON_UNUSED PyObject *__pyx_v_predicates, PyObject *__pyx_v_heads, PyObject *__pyx_v_labels) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[140]))
  __Pyx_RefNannySetupContext("_tag_sentence", 0);
  __Pyx_TraceStartFunc("_tag_sentence", __pyx_f[5], 77, 0, 0, 0, __PYX_ERR(5, 77, __pyx_L1_error));

  /* "nltkor/tag/libs/networkdependencyconv.pyx":82
 *         defined in ConvolutionalNetwork.
 *         """
 *         if labels is None:             # <<<<<<<<<<<<<<
 *             self._tag_sentence_unlabeled_dependency(sentence, heads)
 *         else:
*/
  __pyx_t_1 = (__pyx_v_labels == Py_None);
  if (__pyx_t_1) {

    /* "nltkor/tag/libs/networkdependencyconv.pyx":83
 *         """
 *         if labels is None:
 *             self._tag_sentence_unlabeled_dependency(sentence, heads)             # <<<<<<<<<<<<<<
 *         else:
 *             self._tag_sentence_labeled_dependency(sentence, heads, labels)
*/
    __pyx_t_3 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_sentence, __pyx_v_heads};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_tag_sentence_unlabeled_dependen, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 83, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":82
 *         defined in ConvolutionalNetwork.
 *         """
 *         if labels is None:             # <<<<<<<<<<<<<<
 *             self._tag_sentence_unlabeled_dependency(sentence, heads)
 *         else:
*/
    goto __pyx_L3;
  }

  /* "nltkor/tag/libs/networkdependencyconv.pyx":85
 *             self._tag_sentence_unlabeled_dependency(sentence, heads)
 *         else:
 *             self._tag_sentence_labeled_dependency(sentence, heads, labels)             # <<<<<<<<<<<<<<
 * 
 *     def _tag_sentence_unlabeled_dependency(self, np.ndarray sentence, np.ndarray heads=None):
*/
  /*else*/ {
    __pyx_t_3 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_sentence, __pyx_v_heads, __pyx_v_labels};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_tag_sentence_labeled_dependency, __pyx_callargs+__pyx_t_4, (4-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 85, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":77
 *         self.validation_heads = heads
 * 
 *     def _tag_sentence(self, sentence, predicates=None, heads=None, labels=None):             # <<<<<<<<<<<<<<
 *         """
 *         This function is just an interface to the _tag_sentence signature
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(5, 77, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(5, 77, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._tag_sentence", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":87
 *             self._tag_sentence_labeled_dependency(sentence, heads, labels)
 * 
 *     def _tag_sentence_unlabeled_dependency(self, np.ndarray sentence, np.ndarray heads=None):             # <<<<<<<<<<<<<<
 *         """
 *         Run the network for the unlabeled dependency task.
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_11_tag_sentence_unlabeled_dependency(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_10_tag_sentence_unlabeled_dependency, "ConvolutionalDependencyNetwork._tag_sentence_unlabeled_dependency(self, ndarray sentence, ndarray heads=None)\nRun the network for the unlabeled dependency task.\nA graph with all weights for possible dependencies is built \nand the final answer is obtained applying the Chu-Liu-Edmond's\nalgorithm.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_11_tag_sentence_unlabeled_dependency = {"_tag_sentence_unlabeled_dependency", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_11_tag_sentence_unlabeled_dependency, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_10_tag_sentence_unlabeled_dependency};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_11_tag_sentence_unlabeled_dependency(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyArrayObject *__pyx_v_sentence = 0;
  PyArrayObject *__pyx_v_heads = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_tag_sentence_unlabeled_dependency (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sentence,&__pyx_mstate_global->__pyx_n_u_heads,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(5, 87, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(5, 87, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 87, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_tag_sentence_unlabeled_dependency", 0) < 0) __PYX_ERR(5, 87, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((PyArrayObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_tag_sentence_unlabeled_dependency", 0, 1, 2, i); __PYX_ERR(5, 87, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(5, 87, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 87, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((PyArrayObject *)Py_None));
    }
    __pyx_v_sentence = ((PyArrayObject *)values[0]);
    __pyx_v_heads = ((PyArrayObject *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_tag_sentence_unlabeled_dependency", 0, 1, 2, __pyx_nargs); __PYX_ERR(5, 87, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._tag_sentence_unlabeled_dependency", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sentence), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "sentence", 0))) __PYX_ERR(5, 87, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_heads), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "heads", 0))) __PYX_ERR(5, 87, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_10_tag_sentence_unlabeled_dependency(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self), __pyx_v_sentence, __pyx_v_heads);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_10_tag_sentence_unlabeled_dependency(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyArrayObject *__pyx_v_sentence, PyArrayObject *__pyx_v_heads) {
  PyObject *__pyx_v_training = NULL;
  PyObject *__pyx_v_num_tokens = NULL;
  PyArrayObject *__pyx_v_token_scores = 0;
  PyObject *__pyx_v_token = NULL;
  PyObject *__pyx_v_head = NULL;
  PyObject *__pyx_v_answer = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_token_scores;
  __Pyx_Buffer __pyx_pybuffer_token_scores;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[141]))
  __Pyx_RefNannySetupContext("_tag_sentence_unlabeled_dependency", 0);
  __Pyx_TraceStartFunc("_tag_sentence_unlabeled_dependency", __pyx_f[5], 87, 0, 0, 0, __PYX_ERR(5, 87, __pyx_L1_error));
  __pyx_pybuffer_token_scores.pybuffer.buf = NULL;
  __pyx_pybuffer_token_scores.refcount = 0;
  __pyx_pybuffernd_token_scores.data = NULL;
  __pyx_pybuffernd_token_scores.rcbuffer = &__pyx_pybuffer_token_scores;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":94
 *         algorithm.
 *         """
 *         training = heads is not None             # <<<<<<<<<<<<<<
 *         self._pre_tagging_setup(sentence, training)
 * 
*/
  __pyx_t_1 = (((PyObject *)__pyx_v_heads) != Py_None);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_training = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":95
 *         """
 *         training = heads is not None
 *         self._pre_tagging_setup(sentence, training)             # <<<<<<<<<<<<<<
 * 
 *         num_tokens = len(sentence)
*/
  __pyx_t_3 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_3, ((PyObject *)__pyx_v_sentence), __pyx_v_training};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_pre_tagging_setup, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 95, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":97
 *         self._pre_tagging_setup(sentence, training)
 * 
 *         num_tokens = len(sentence)             # <<<<<<<<<<<<<<
 *         # dependency_weights [i, j] has the score for token i having j as a head.
 *         # the main diagonal has the values for dependencies from the root and is
*/
  __pyx_t_5 = PyObject_Length(((PyObject *)__pyx_v_sentence)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(5, 97, __pyx_L1_error)
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_num_tokens = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":101
 *         # the main diagonal has the values for dependencies from the root and is
 *         # later copied to the last column for easier processing
 *         self.dependency_weights = np.empty((num_tokens, num_tokens + 1))             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[FLOAT_t, ndim=1] token_scores
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyLong_AddObjC(__pyx_v_num_tokens, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_INCREF(__pyx_v_num_tokens);
  __Pyx_GIVEREF(__pyx_v_num_tokens);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_num_tokens) != (0)) __PYX_ERR(5, 101, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6) != (0)) __PYX_ERR(5, 101, __pyx_L1_error);
  __pyx_t_6 = 0;
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_8};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 101, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->dependency_weights);
  __Pyx_DECREF((PyObject *)__pyx_v_self->dependency_weights);
  __pyx_v_self->dependency_weights = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":108
 *         # sentence tokens are scored with respect to it (in order to determine the
 *         # dependency weights)
 *         for token in range(num_tokens):             # <<<<<<<<<<<<<<
 * 
 *             # _sentence_convolution returns a 2-dim array. in dep parsing,
*/
  __pyx_t_7 = NULL;
  __Pyx_INCREF(__pyx_builtin_range);
  __pyx_t_8 = __pyx_builtin_range; 
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_num_tokens};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 108, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_8 = __pyx_t_2; __Pyx_INCREF(__pyx_t_8);
    __pyx_t_5 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 108, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 108, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_8))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 108, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_8, __pyx_t_5);
        ++__pyx_t_5;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 108, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_5));
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_5);
        #endif
        ++__pyx_t_5;
      }
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 108, __pyx_L1_error)
    } else {
      __pyx_t_2 = __pyx_t_9(__pyx_t_8);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(5, 108, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_token, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":112
 *             # _sentence_convolution returns a 2-dim array. in dep parsing,
 *             # we only have one dimension, so reshape it
 *             token_scores = self._sentence_convolution(sentence, token,             # <<<<<<<<<<<<<<
 *                                                       training=training).reshape(num_tokens)
 *             self.dependency_weights[token, :-1] = token_scores
*/
    __pyx_t_6 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_6);

    /* "nltkor/tag/libs/networkdependencyconv.pyx":113
 *             # we only have one dimension, so reshape it
 *             token_scores = self._sentence_convolution(sentence, token,
 *                                                       training=training).reshape(num_tokens)             # <<<<<<<<<<<<<<
 *             self.dependency_weights[token, :-1] = token_scores
 * 
*/
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_6, ((PyObject *)__pyx_v_sentence), __pyx_v_token};
      __pyx_t_10 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 112, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_training, __pyx_v_training, __pyx_t_10, __pyx_callargs+3, 0) < 0) __PYX_ERR(5, 112, __pyx_L1_error)
      __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_sentence_convolution, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_10);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 112, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_7 = __pyx_t_3;
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_num_tokens};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 113, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 113, __pyx_L1_error)
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_token_scores.rcbuffer->pybuffer);
      __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_token_scores.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_11 < 0)) {
        PyErr_Fetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_token_scores.rcbuffer->pybuffer, (PyObject*)__pyx_v_token_scores, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
        }
        __pyx_t_12 = __pyx_t_13 = __pyx_t_14 = 0;
      }
      __pyx_pybuffernd_token_scores.diminfo[0].strides = __pyx_pybuffernd_token_scores.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_token_scores.diminfo[0].shape = __pyx_pybuffernd_token_scores.rcbuffer->pybuffer.shape[0];
      if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(5, 112, __pyx_L1_error)
    }
    __Pyx_XDECREF_SET(__pyx_v_token_scores, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":114
 *             token_scores = self._sentence_convolution(sentence, token,
 *                                                       training=training).reshape(num_tokens)
 *             self.dependency_weights[token, :-1] = token_scores             # <<<<<<<<<<<<<<
 * 
 *             if training:
*/
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_token);
    __Pyx_GIVEREF(__pyx_v_token);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_token) != (0)) __PYX_ERR(5, 114, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[1]);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[1]);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_mstate_global->__pyx_slice[1]) != (0)) __PYX_ERR(5, 114, __pyx_L1_error);
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->dependency_weights), __pyx_t_2, ((PyObject *)__pyx_v_token_scores)) < 0))) __PYX_ERR(5, 114, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":116
 *             self.dependency_weights[token, :-1] = token_scores
 * 
 *             if training:             # <<<<<<<<<<<<<<
 *                 head = heads[token]
 * 
*/
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_training); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(5, 116, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "nltkor/tag/libs/networkdependencyconv.pyx":117
 * 
 *             if training:
 *                 head = heads[token]             # <<<<<<<<<<<<<<
 * 
 *                 if self._calculate_gradients(head, token_scores):
*/
      __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_heads), __pyx_v_token); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 117, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_head, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "nltkor/tag/libs/networkdependencyconv.pyx":119
 *                 head = heads[token]
 * 
 *                 if self._calculate_gradients(head, token_scores):             # <<<<<<<<<<<<<<
 *                     self._backpropagate()
 *                     self._calculate_input_deltas(sentence, token)
*/
      __pyx_t_3 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_4 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_head, ((PyObject *)__pyx_v_token_scores)};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_calculate_gradients, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 119, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(5, 119, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_1) {

        /* "nltkor/tag/libs/networkdependencyconv.pyx":120
 * 
 *                 if self._calculate_gradients(head, token_scores):
 *                     self._backpropagate()             # <<<<<<<<<<<<<<
 *                     self._calculate_input_deltas(sentence, token)
 *                     self._adjust_weights(token)
*/
        __pyx_t_3 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_3);
        __pyx_t_4 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_backpropagate, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 120, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "nltkor/tag/libs/networkdependencyconv.pyx":121
 *                 if self._calculate_gradients(head, token_scores):
 *                     self._backpropagate()
 *                     self._calculate_input_deltas(sentence, token)             # <<<<<<<<<<<<<<
 *                     self._adjust_weights(token)
 *                     self._adjust_features(sentence, token)
*/
        __pyx_t_3 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_3);
        __pyx_t_4 = 0;
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_3, ((PyObject *)__pyx_v_sentence), __pyx_v_token};
          __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_calculate_input_deltas, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 121, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "nltkor/tag/libs/networkdependencyconv.pyx":122
 *                     self._backpropagate()
 *                     self._calculate_input_deltas(sentence, token)
 *                     self._adjust_weights(token)             # <<<<<<<<<<<<<<
 *                     self._adjust_features(sentence, token)
 * 
*/
        __pyx_t_3 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_3);
        __pyx_t_4 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_token};
          __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_adjust_weights, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 122, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "nltkor/tag/libs/networkdependencyconv.pyx":123
 *                     self._calculate_input_deltas(sentence, token)
 *                     self._adjust_weights(token)
 *                     self._adjust_features(sentence, token)             # <<<<<<<<<<<<<<
 * 
 *         # copy dependency weights from the root to each token to the last column and
*/
        __pyx_t_3 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_3);
        __pyx_t_4 = 0;
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_3, ((PyObject *)__pyx_v_sentence), __pyx_v_token};
          __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_adjust_features, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 123, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "nltkor/tag/libs/networkdependencyconv.pyx":119
 *                 head = heads[token]
 * 
 *                 if self._calculate_gradients(head, token_scores):             # <<<<<<<<<<<<<<
 *                     self._backpropagate()
 *                     self._calculate_input_deltas(sentence, token)
*/
      }

      /* "nltkor/tag/libs/networkdependencyconv.pyx":116
 *             self.dependency_weights[token, :-1] = token_scores
 * 
 *             if training:             # <<<<<<<<<<<<<<
 *                 head = heads[token]
 * 
*/
    }

    /* "nltkor/tag/libs/networkdependencyconv.pyx":108
 *         # sentence tokens are scored with respect to it (in order to determine the
 *         # dependency weights)
 *         for token in range(num_tokens):             # <<<<<<<<<<<<<<
 * 
 *             # _sentence_convolution returns a 2-dim array. in dep parsing,
*/
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":128
 *         # effectively ignore the main diagonal (dependency to the token itself)
 *         self.dependency_weights[np.arange(num_tokens),
 *                                 -1] = self.dependency_weights.diagonal()             # <<<<<<<<<<<<<<
 *         np.fill_diagonal(self.dependency_weights, -np.Infinity)
 *         answer = self._find_maximum_spanning_tree()
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self->dependency_weights);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_diagonal, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 128, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }

  /* "nltkor/tag/libs/networkdependencyconv.pyx":127
 *         # copy dependency weights from the root to each token to the last column and
 *         # effectively ignore the main diagonal (dependency to the token itself)
 *         self.dependency_weights[np.arange(num_tokens),             # <<<<<<<<<<<<<<
 *                                 -1] = self.dependency_weights.diagonal()
 *         np.fill_diagonal(self.dependency_weights, -np.Infinity)
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_arange); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_10);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_num_tokens};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 127, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2) != (0)) __PYX_ERR(5, 127, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_neg_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_mstate_global->__pyx_int_neg_1) != (0)) __PYX_ERR(5, 127, __pyx_L1_error);
  __pyx_t_2 = 0;
  if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->dependency_weights), __pyx_t_10, __pyx_t_8) < 0))) __PYX_ERR(5, 127, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":129
 *         self.dependency_weights[np.arange(num_tokens),
 *                                 -1] = self.dependency_weights.diagonal()
 *         np.fill_diagonal(self.dependency_weights, -np.Infinity)             # <<<<<<<<<<<<<<
 *         answer = self._find_maximum_spanning_tree()
 * 
*/
  __pyx_t_10 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_fill_diagonal); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Infinity); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Negative(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_10);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_10);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_10, ((PyObject *)__pyx_v_self->dependency_weights), __pyx_t_2};
    __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 129, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":130
 *                                 -1] = self.dependency_weights.diagonal()
 *         np.fill_diagonal(self.dependency_weights, -np.Infinity)
 *         answer = self._find_maximum_spanning_tree()             # <<<<<<<<<<<<<<
 * 
 *         return answer
*/
  __pyx_t_3 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_find_maximum_spanning_tree, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 130, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  __pyx_v_answer = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":132
 *         answer = self._find_maximum_spanning_tree()
 * 
 *         return answer             # <<<<<<<<<<<<<<
 * 
 *     def _tag_sentence_labeled_dependency(self, np.ndarray sentence, np.ndarray heads,
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_answer);
  __pyx_r = __pyx_v_answer;
  __Pyx_TraceReturnValue(__pyx_r, 99, 0, __PYX_ERR(5, 132, __pyx_L1_error));
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":87
 *             self._tag_sentence_labeled_dependency(sentence, heads, labels)
 * 
 *     def _tag_sentence_unlabeled_dependency(self, np.ndarray sentence, np.ndarray heads=None):             # <<<<<<<<<<<<<<
 *         """
 *         Run the network for the unlabeled dependency task.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_token_scores.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(5, 87, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._tag_sentence_unlabeled_dependency", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_token_scores.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_training);
  __Pyx_XDECREF(__pyx_v_num_tokens);
  __Pyx_XDECREF((PyObject *)__pyx_v_token_scores);
  __Pyx_XDECREF(__pyx_v_token);
  __Pyx_XDECREF(__pyx_v_head);
  __Pyx_XDECREF(__pyx_v_answer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":134
 *         return answer
 * 
 *     def _tag_sentence_labeled_dependency(self, np.ndarray sentence, np.ndarray heads,             # <<<<<<<<<<<<<<
 *                                          np.ndarray labels=None):
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_13_tag_sentence_labeled_dependency(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_12_tag_sentence_labeled_dependency, "ConvolutionalDependencyNetwork._tag_sentence_labeled_dependency(self, ndarray sentence, ndarray heads, ndarray labels=None)\nRun the network for labeling pre determined dependency edges between tokens.\nThis is similar to the classification step in SRL.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_13_tag_sentence_labeled_dependency = {"_tag_sentence_labeled_dependency", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_13_tag_sentence_labeled_dependency, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_12_tag_sentence_labeled_dependency};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_13_tag_sentence_labeled_dependency(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyArrayObject *__pyx_v_sentence = 0;
  PyArrayObject *__pyx_v_heads = 0;
  PyArrayObject *__pyx_v_labels = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_tag_sentence_labeled_dependency (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sentence,&__pyx_mstate_global->__pyx_n_u_heads,&__pyx_mstate_global->__pyx_n_u_labels,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(5, 134, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(5, 134, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(5, 134, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 134, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_tag_sentence_labeled_dependency", 0) < 0) __PYX_ERR(5, 134, __pyx_L3_error)

      /* "nltkor/tag/libs/networkdependencyconv.pyx":135
 * 
 *     def _tag_sentence_labeled_dependency(self, np.ndarray sentence, np.ndarray heads,
 *                                          np.ndarray labels=None):             # <<<<<<<<<<<<<<
 *         """
 *         Run the network for labeling pre determined dependency edges between tokens.
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((PyArrayObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_tag_sentence_labeled_dependency", 0, 2, 3, i); __PYX_ERR(5, 134, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(5, 134, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(5, 134, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 134, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((PyArrayObject *)Py_None));
    }
    __pyx_v_sentence = ((PyArrayObject *)values[0]);
    __pyx_v_heads = ((PyArrayObject *)values[1]);
    __pyx_v_labels = ((PyArrayObject *)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_tag_sentence_labeled_dependency", 0, 2, 3, __pyx_nargs); __PYX_ERR(5, 134, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._tag_sentence_labeled_dependency", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sentence), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "sentence", 0))) __PYX_ERR(5, 134, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_heads), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "heads", 0))) __PYX_ERR(5, 134, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "labels", 0))) __PYX_ERR(5, 135, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_12_tag_sentence_labeled_dependency(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self), __pyx_v_sentence, __pyx_v_heads, __pyx_v_labels);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":134
 *         return answer
 * 
 *     def _tag_sentence_labeled_dependency(self, np.ndarray sentence, np.ndarray heads,             # <<<<<<<<<<<<<<
 *                                          np.ndarray labels=None):
 *         """
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_12_tag_sentence_labeled_dependency(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyArrayObject *__pyx_v_sentence, PyArrayObject *__pyx_v_heads, PyArrayObject *__pyx_v_labels) {
  PyArrayObject *__pyx_v_answer = 0;
  PyArrayObject *__pyx_v_scores = 0;
  PyObject *__pyx_v_training = NULL;
  Py_ssize_t __pyx_v_token;
  PyObject *__pyx_v_head = NULL;
  PyObject *__pyx_v_label = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_answer;
  __Pyx_Buffer __pyx_pybuffer_answer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_scores;
  __Pyx_Buffer __pyx_pybuffer_scores;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  __pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[142]))
  __Pyx_RefNannySetupContext("_tag_sentence_labeled_dependency", 0);
  __Pyx_TraceStartFunc("_tag_sentence_labeled_dependency", __pyx_f[5], 134, 0, 0, 0, __PYX_ERR(5, 134, __pyx_L1_error));
  __pyx_pybuffer_answer.pybuffer.buf = NULL;
  __pyx_pybuffer_answer.refcount = 0;
  __pyx_pybuffernd_answer.data = NULL;
  __pyx_pybuffernd_answer.rcbuffer = &__pyx_pybuffer_answer;
  __pyx_pybuffer_scores.pybuffer.buf = NULL;
  __pyx_pybuffer_scores.refcount = 0;
  __pyx_pybuffernd_scores.data = NULL;
  __pyx_pybuffernd_scores.rcbuffer = &__pyx_pybuffer_scores;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":142
 *         cdef np.ndarray[FLOAT_t, ndim=1] answer
 *         cdef np.ndarray[FLOAT_t, ndim=2] scores
 *         training = labels is not None             # <<<<<<<<<<<<<<
 *         self._pre_tagging_setup(sentence, training)
 * 
*/
  __pyx_t_1 = (((PyObject *)__pyx_v_labels) != Py_None);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_training = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":143
 *         cdef np.ndarray[FLOAT_t, ndim=2] scores
 *         training = labels is not None
 *         self._pre_tagging_setup(sentence, training)             # <<<<<<<<<<<<<<
 * 
 *         answer = np.zeros(len(sentence))
*/
  __pyx_t_3 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_3, ((PyObject *)__pyx_v_sentence), __pyx_v_training};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_pre_tagging_setup, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 143, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":145
 *         self._pre_tagging_setup(sentence, training)
 * 
 *         answer = np.zeros(len(sentence))             # <<<<<<<<<<<<<<
 * 
 *         # as in unlabeled dependency, each token is treated as a predicate from the
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_sentence)); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(5, 145, __pyx_L1_error)
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 145, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_answer.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_answer.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_answer.rcbuffer->pybuffer, (PyObject*)__pyx_v_answer, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
      __pyx_t_9 = __pyx_t_10 = __pyx_t_11 = 0;
    }
    __pyx_pybuffernd_answer.diminfo[0].strides = __pyx_pybuffernd_answer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_answer.diminfo[0].shape = __pyx_pybuffernd_answer.rcbuffer->pybuffer.shape[0];
    if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(5, 145, __pyx_L1_error)
  }
  __pyx_v_answer = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":149
 *         # as in unlabeled dependency, each token is treated as a predicate from the
 *         # SRL point of view. The only target is its head
 *         for token in range(len(sentence)):             # <<<<<<<<<<<<<<
 *             head = heads[token]
 * 
*/
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_sentence)); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(5, 149, __pyx_L1_error)
  __pyx_t_12 = __pyx_t_7;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
    __pyx_v_token = __pyx_t_13;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":150
 *         # SRL point of view. The only target is its head
 *         for token in range(len(sentence)):
 *             head = heads[token]             # <<<<<<<<<<<<<<
 * 
 *             # weird format just to take advantage of the SRL classification code
*/
    __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_heads), __pyx_v_token, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_head, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":154
 *             # weird format just to take advantage of the SRL classification code
 *             # it means that the target starts at position *head* and ends at *head*
 *             head = [[head, head]]             # <<<<<<<<<<<<<<
 * 
 *             # it will return a 2-dim array, but we only have one target
*/
    __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 154, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_head);
    __Pyx_GIVEREF(__pyx_v_head);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_head) != (0)) __PYX_ERR(5, 154, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_head);
    __Pyx_GIVEREF(__pyx_v_head);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_v_head) != (0)) __PYX_ERR(5, 154, __pyx_L1_error);
    __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 154, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_2) != (0)) __PYX_ERR(5, 154, __pyx_L1_error);
    __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_head, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":158
 *             # it will return a 2-dim array, but we only have one target
 *             # argmax() works as expected
 *             scores = self._sentence_convolution(sentence, token, head, training)             # <<<<<<<<<<<<<<
 *             answer[token] = scores.argmax()
 * 
*/
    __pyx_t_2 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_token); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 158, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_2, ((PyObject *)__pyx_v_sentence), __pyx_t_5, __pyx_v_head, __pyx_v_training};
      __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_sentence_convolution, __pyx_callargs+__pyx_t_4, (5-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 158, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 158, __pyx_L1_error)
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_scores.rcbuffer->pybuffer);
      __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_scores.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_6), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_8 < 0)) {
        PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_scores.rcbuffer->pybuffer, (PyObject*)__pyx_v_scores, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
        }
        __pyx_t_11 = __pyx_t_10 = __pyx_t_9 = 0;
      }
      __pyx_pybuffernd_scores.diminfo[0].strides = __pyx_pybuffernd_scores.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_scores.diminfo[0].shape = __pyx_pybuffernd_scores.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_scores.diminfo[1].strides = __pyx_pybuffernd_scores.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_scores.diminfo[1].shape = __pyx_pybuffernd_scores.rcbuffer->pybuffer.shape[1];
      if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(5, 158, __pyx_L1_error)
    }
    __Pyx_XDECREF_SET(__pyx_v_scores, ((PyArrayObject *)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":159
 *             # argmax() works as expected
 *             scores = self._sentence_convolution(sentence, token, head, training)
 *             answer[token] = scores.argmax()             # <<<<<<<<<<<<<<
 * 
 *             if training:
*/
    __pyx_t_5 = ((PyObject *)__pyx_v_scores);
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_argmax, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 159, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_t_14 = __Pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_14 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(5, 159, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_15 = __pyx_v_token;
    __pyx_t_8 = -1;
    if (__pyx_t_15 < 0) {
      __pyx_t_15 += __pyx_pybuffernd_answer.diminfo[0].shape;
      if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_answer.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      __PYX_ERR(5, 159, __pyx_L1_error)
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t *, __pyx_pybuffernd_answer.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_answer.diminfo[0].strides) = __pyx_t_14;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":161
 *             answer[token] = scores.argmax()
 * 
 *             if training:             # <<<<<<<<<<<<<<
 *                 label = labels[token]
 *                 if self._calculate_gradients_classify([label], scores):
*/
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_training); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(5, 161, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "nltkor/tag/libs/networkdependencyconv.pyx":162
 * 
 *             if training:
 *                 label = labels[token]             # <<<<<<<<<<<<<<
 *                 if self._calculate_gradients_classify([label], scores):
 *                     self._backpropagate()
*/
      __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_labels), __pyx_v_token, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 162, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_v_label, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "nltkor/tag/libs/networkdependencyconv.pyx":163
 *             if training:
 *                 label = labels[token]
 *                 if self._calculate_gradients_classify([label], scores):             # <<<<<<<<<<<<<<
 *                     self._backpropagate()
 *                     self._calculate_input_deltas(sentence, token, head)
*/
      __pyx_t_5 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_label);
      __Pyx_GIVEREF(__pyx_v_label);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_label) != (0)) __PYX_ERR(5, 163, __pyx_L1_error);
      __pyx_t_4 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_2, ((PyObject *)__pyx_v_scores)};
        __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_calculate_gradients_classify, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 163, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
      }
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(5, 163, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_1) {

        /* "nltkor/tag/libs/networkdependencyconv.pyx":164
 *                 label = labels[token]
 *                 if self._calculate_gradients_classify([label], scores):
 *                     self._backpropagate()             # <<<<<<<<<<<<<<
 *                     self._calculate_input_deltas(sentence, token, head)
 *                     self._adjust_weights(token, head)
*/
        __pyx_t_2 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_4 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
          __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_backpropagate, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 164, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "nltkor/tag/libs/networkdependencyconv.pyx":165
 *                 if self._calculate_gradients_classify([label], scores):
 *                     self._backpropagate()
 *                     self._calculate_input_deltas(sentence, token, head)             # <<<<<<<<<<<<<<
 *                     self._adjust_weights(token, head)
 *                     self._adjust_features(sentence, token)
*/
        __pyx_t_2 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_token); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 165, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = 0;
        {
          PyObject *__pyx_callargs[4] = {__pyx_t_2, ((PyObject *)__pyx_v_sentence), __pyx_t_5, __pyx_v_head};
          __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_calculate_input_deltas, __pyx_callargs+__pyx_t_4, (4-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 165, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "nltkor/tag/libs/networkdependencyconv.pyx":166
 *                     self._backpropagate()
 *                     self._calculate_input_deltas(sentence, token, head)
 *                     self._adjust_weights(token, head)             # <<<<<<<<<<<<<<
 *                     self._adjust_features(sentence, token)
 * 
*/
        __pyx_t_5 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_token); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 166, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_4 = 0;
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_2, __pyx_v_head};
          __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_adjust_weights, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 166, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "nltkor/tag/libs/networkdependencyconv.pyx":167
 *                     self._calculate_input_deltas(sentence, token, head)
 *                     self._adjust_weights(token, head)
 *                     self._adjust_features(sentence, token)             # <<<<<<<<<<<<<<
 * 
 * 
*/
        __pyx_t_2 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_token); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 167, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = 0;
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_2, ((PyObject *)__pyx_v_sentence), __pyx_t_5};
          __pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_adjust_features, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 167, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "nltkor/tag/libs/networkdependencyconv.pyx":163
 *             if training:
 *                 label = labels[token]
 *                 if self._calculate_gradients_classify([label], scores):             # <<<<<<<<<<<<<<
 *                     self._backpropagate()
 *                     self._calculate_input_deltas(sentence, token, head)
*/
      }

      /* "nltkor/tag/libs/networkdependencyconv.pyx":161
 *             answer[token] = scores.argmax()
 * 
 *             if training:             # <<<<<<<<<<<<<<
 *                 label = labels[token]
 *                 if self._calculate_gradients_classify([label], scores):
*/
    }
  }

  /* "nltkor/tag/libs/networkdependencyconv.pyx":170
 * 
 * 
 *         return answer             # <<<<<<<<<<<<<<
 * 
 *     def _calculate_gradients(self, gold_head, scores):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_answer);
  __pyx_r = ((PyObject *)__pyx_v_answer);
  __Pyx_TraceReturnValue(__pyx_r, 80, 0, __PYX_ERR(5, 170, __pyx_L1_error));
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":134
 *         return answer
 * 
 *     def _tag_sentence_labeled_dependency(self, np.ndarray sentence, np.ndarray heads,             # <<<<<<<<<<<<<<
 *                                          np.ndarray labels=None):
 *         """
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_answer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_scores.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(5, 134, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._tag_sentence_labeled_dependency", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_answer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_scores.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_answer);
  __Pyx_XDECREF((PyObject *)__pyx_v_scores);
  __Pyx_XDECREF(__pyx_v_training);
  __Pyx_XDECREF(__pyx_v_head);
  __Pyx_XDECREF(__pyx_v_label);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":172
 *         return answer
 * 
 *     def _calculate_gradients(self, gold_head, scores):             # <<<<<<<<<<<<<<
 *         """
 *         Calculate the gradients to be applied in the backpropagation. Gradients
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_15_calculate_gradients(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_14_calculate_gradients, "ConvolutionalDependencyNetwork._calculate_gradients(self, gold_head, scores)\nCalculate the gradients to be applied in the backpropagation. Gradients\nare calculated after the network has output the scores for assigning \neach token as head of a given token. \n\nWe aim at maximizing the log probability of the right head:\nlog(p(head)) = score(head) - logadd(scores for all heads)\n\n:param gold_head: the index of the token that should have the highest \n    score\n:param scores: the scores output by the network\n:returns: if True, normal gradient calculation was performed.\n    If False, the error was too low and weight correction should be\n    skipped. ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_15_calculate_gradients = {"_calculate_gradients", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_15_calculate_gradients, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_14_calculate_gradients};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_15_calculate_gradients(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_gold_head = 0;
  PyObject *__pyx_v_scores = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_calculate_gradients (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_gold_head,&__pyx_mstate_global->__pyx_n_u_scores,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(5, 172, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(5, 172, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 172, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_calculate_gradients", 0) < 0) __PYX_ERR(5, 172, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_calculate_gradients", 1, 2, 2, i); __PYX_ERR(5, 172, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 172, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(5, 172, __pyx_L3_error)
    }
    __pyx_v_gold_head = values[0];
    __pyx_v_scores = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_calculate_gradients", 1, 2, 2, __pyx_nargs); __PYX_ERR(5, 172, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._calculate_gradients", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_14_calculate_gradients(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self), __pyx_v_gold_head, __pyx_v_scores);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_14_calculate_gradients(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyObject *__pyx_v_gold_head, PyObject *__pyx_v_scores) {
  PyArrayObject *__pyx_v_exp_scores = 0;
  PyObject *__pyx_v_exp_sum = NULL;
  PyObject *__pyx_v_error = NULL;
  PyObject *__pyx_v_new_shape = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_exp_scores;
  __Pyx_Buffer __pyx_pybuffer_exp_scores;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  float __pyx_t_6;
  int __pyx_t_7;
  PyArrayObject *__pyx_t_8 = NULL;
  npy_intp *__pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[143]))
  __Pyx_RefNannySetupContext("_calculate_gradients", 0);
  __Pyx_TraceStartFunc("_calculate_gradients", __pyx_f[5], 172, 0, 0, 0, __PYX_ERR(5, 172, __pyx_L1_error));
  __pyx_pybuffer_exp_scores.pybuffer.buf = NULL;
  __pyx_pybuffer_exp_scores.refcount = 0;
  __pyx_pybuffernd_exp_scores.data = NULL;
  __pyx_pybuffernd_exp_scores.rcbuffer = &__pyx_pybuffer_exp_scores;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":191
 *         # -exp(score(token)) / sum_j exp(score(token_j))
 *         # i.e., the negative of its probability
 *         cdef np.ndarray[FLOAT_t, ndim=1] exp_scores = np.exp(scores)             # <<<<<<<<<<<<<<
 *         exp_sum = np.sum(exp_scores)
 *         self.net_gradients = -exp_scores / exp_sum
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_exp); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_scores};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 191, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 191, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_exp_scores.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_exp_scores = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_exp_scores.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(5, 191, __pyx_L1_error)
    } else {__pyx_pybuffernd_exp_scores.diminfo[0].strides = __pyx_pybuffernd_exp_scores.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_exp_scores.diminfo[0].shape = __pyx_pybuffernd_exp_scores.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_v_exp_scores = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":192
 *         # i.e., the negative of its probability
 *         cdef np.ndarray[FLOAT_t, ndim=1] exp_scores = np.exp(scores)
 *         exp_sum = np.sum(exp_scores)             # <<<<<<<<<<<<<<
 *         self.net_gradients = -exp_scores / exp_sum
 *         error = 1 + self.net_gradients[gold_head]
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_sum); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_exp_scores)};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_exp_sum = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":193
 *         cdef np.ndarray[FLOAT_t, ndim=1] exp_scores = np.exp(scores)
 *         exp_sum = np.sum(exp_scores)
 *         self.net_gradients = -exp_scores / exp_sum             # <<<<<<<<<<<<<<
 *         error = 1 + self.net_gradients[gold_head]
 *         self.error += error
*/
  __pyx_t_1 = PyNumber_Negative(((PyObject *)__pyx_v_exp_scores)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_exp_sum); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 193, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.net_gradients);
  __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.net_gradients);
  __pyx_v_self->__pyx_base.__pyx_base.net_gradients = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":194
 *         exp_sum = np.sum(exp_scores)
 *         self.net_gradients = -exp_scores / exp_sum
 *         error = 1 + self.net_gradients[gold_head]             # <<<<<<<<<<<<<<
 *         self.error += error
 * 
*/
  __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.net_gradients), __pyx_v_gold_head); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyLong_AddCObj(__pyx_mstate_global->__pyx_int_1, __pyx_t_3, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_error = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":195
 *         self.net_gradients = -exp_scores / exp_sum
 *         error = 1 + self.net_gradients[gold_head]
 *         self.error += error             # <<<<<<<<<<<<<<
 * 
 *         # check if the error is too small - if so, not worth to continue
*/
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.error); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_6 == (float)-1) && PyErr_Occurred())) __PYX_ERR(5, 195, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->__pyx_base.__pyx_base.error = __pyx_t_6;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":198
 * 
 *         # check if the error is too small - if so, not worth to continue
 *         if error <= 0.01:             # <<<<<<<<<<<<<<
 *             self.skips += 1
 *             return False
*/
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_error, __pyx_mstate_global->__pyx_float_0_01, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 198, __pyx_L1_error)
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(5, 198, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_7) {

    /* "nltkor/tag/libs/networkdependencyconv.pyx":199
 *         # check if the error is too small - if so, not worth to continue
 *         if error <= 0.01:
 *             self.skips += 1             # <<<<<<<<<<<<<<
 *             return False
 * 
*/
    __pyx_v_self->__pyx_base.__pyx_base.skips = (__pyx_v_self->__pyx_base.__pyx_base.skips + 1);

    /* "nltkor/tag/libs/networkdependencyconv.pyx":200
 *         if error <= 0.01:
 *             self.skips += 1
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         # and add 1 to the right head
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    __Pyx_TraceReturnValue(__pyx_r, 34, 0, __PYX_ERR(5, 200, __pyx_L1_error));
    goto __pyx_L0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":198
 * 
 *         # check if the error is too small - if so, not worth to continue
 *         if error <= 0.01:             # <<<<<<<<<<<<<<
 *             self.skips += 1
 *             return False
*/
  }

  /* "nltkor/tag/libs/networkdependencyconv.pyx":203
 * 
 *         # and add 1 to the right head
 *         self.net_gradients[gold_head] += 1             # <<<<<<<<<<<<<<
 * 
 *         # the ConvolutionalNetwork class deals with multi dimensional gradients
*/
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.net_gradients);
  __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx_base.net_gradients;
  __Pyx_INCREF(__pyx_v_gold_head);
  __pyx_t_3 = __pyx_v_gold_head;
  __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_t_8), __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyLong_AddObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely((PyObject_SetItem(((PyObject *)__pyx_t_8), __pyx_t_3, __pyx_t_4) < 0))) __PYX_ERR(5, 203, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":207
 *         # the ConvolutionalNetwork class deals with multi dimensional gradients
 *         # (because of more than one output neuron), so let's reshape
 *         new_shape = (self.net_gradients.shape[0], 1)             # <<<<<<<<<<<<<<
 *         self.net_gradients = self.net_gradients.reshape(new_shape)
 * 
*/
  __pyx_t_3 = ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.net_gradients);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_9 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_3)); if (unlikely(__pyx_t_9 == ((npy_intp *)0) && PyErr_Occurred())) __PYX_ERR(5, 207, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyLong_From_Py_intptr_t((__pyx_t_9[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3) != (0)) __PYX_ERR(5, 207, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(5, 207, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_v_new_shape = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":208
 *         # (because of more than one output neuron), so let's reshape
 *         new_shape = (self.net_gradients.shape[0], 1)
 *         self.net_gradients = self.net_gradients.reshape(new_shape)             # <<<<<<<<<<<<<<
 * 
 *         return True
*/
  __pyx_t_3 = ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.net_gradients);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_new_shape};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 208, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 208, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.net_gradients);
  __Pyx_DECREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.net_gradients);
  __pyx_v_self->__pyx_base.__pyx_base.net_gradients = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":210
 *         self.net_gradients = self.net_gradients.reshape(new_shape)
 * 
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     def _validate(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  __Pyx_TraceReturnValue(__pyx_r, 55, 0, __PYX_ERR(5, 210, __pyx_L1_error));
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":172
 *         return answer
 * 
 *     def _calculate_gradients(self, gold_head, scores):             # <<<<<<<<<<<<<<
 *         """
 *         Calculate the gradients to be applied in the backpropagation. Gradients
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF((PyObject *)__pyx_t_8);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exp_scores.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(5, 172, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._calculate_gradients", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exp_scores.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_exp_scores);
  __Pyx_XDECREF(__pyx_v_exp_sum);
  __Pyx_XDECREF(__pyx_v_error);
  __Pyx_XDECREF(__pyx_v_new_shape);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":212
 *         return True
 * 
 *     def _validate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Evaluate the network performance by token hit and whole sentence hit.
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_17_validate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_16_validate, "ConvolutionalDependencyNetwork._validate(self)\nEvaluate the network performance by token hit and whole sentence hit.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_17_validate = {"_validate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_17_validate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_16_validate};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_17_validate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_validate (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_validate", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_validate", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_16_validate(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_16_validate(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self) {
  PyObject *__pyx_v_hits = NULL;
  PyObject *__pyx_v_num_tokens = NULL;
  PyObject *__pyx_v_sentence_hits = NULL;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_sent = NULL;
  PyObject *__pyx_v_heads = NULL;
  int __pyx_v_sentence_hit;
  PyObject *__pyx_v_answer = NULL;
  PyObject *__pyx_v_gold_tags = NULL;
  Py_ssize_t __pyx_v_j;
  PyObject *__pyx_v_net_tag = NULL;
  PyObject *__pyx_v_gold_tag = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  float __pyx_t_13;
  double __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[144]))
  __Pyx_RefNannySetupContext("_validate", 0);
  __Pyx_TraceStartFunc("_validate", __pyx_f[5], 212, 0, 0, 0, __PYX_ERR(5, 212, __pyx_L1_error));

  /* "nltkor/tag/libs/networkdependencyconv.pyx":216
 *         Evaluate the network performance by token hit and whole sentence hit.
 *         """
 *         hits = 0             # <<<<<<<<<<<<<<
 *         num_tokens = 0
 *         sentence_hits = 0
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_v_hits = __pyx_mstate_global->__pyx_int_0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":217
 *         """
 *         hits = 0
 *         num_tokens = 0             # <<<<<<<<<<<<<<
 *         sentence_hits = 0
 * 
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_v_num_tokens = __pyx_mstate_global->__pyx_int_0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":218
 *         hits = 0
 *         num_tokens = 0
 *         sentence_hits = 0             # <<<<<<<<<<<<<<
 * 
 *         for i in range(len(self.validation_sentences)):
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_v_sentence_hits = __pyx_mstate_global->__pyx_int_0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":220
 *         sentence_hits = 0
 * 
 *         for i in range(len(self.validation_sentences)):             # <<<<<<<<<<<<<<
 *             sent = self.validation_sentences[i]
 *             heads = self.validation_heads[i]
*/
  __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.validation_sentences;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(5, 220, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(5, 220, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":221
 * 
 *         for i in range(len(self.validation_sentences)):
 *             sent = self.validation_sentences[i]             # <<<<<<<<<<<<<<
 *             heads = self.validation_heads[i]
 *             sentence_hit = True
*/
    if (unlikely(__pyx_v_self->__pyx_base.__pyx_base.validation_sentences == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(5, 221, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->__pyx_base.__pyx_base.validation_sentences, __pyx_v_i, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 221, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_sent, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":222
 *         for i in range(len(self.validation_sentences)):
 *             sent = self.validation_sentences[i]
 *             heads = self.validation_heads[i]             # <<<<<<<<<<<<<<
 *             sentence_hit = True
 * 
*/
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->validation_heads, __pyx_v_i, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_heads, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":223
 *             sent = self.validation_sentences[i]
 *             heads = self.validation_heads[i]
 *             sentence_hit = True             # <<<<<<<<<<<<<<
 * 
 *             if self.validation_tags is None:
*/
    __pyx_v_sentence_hit = 1;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":225
 *             sentence_hit = True
 * 
 *             if self.validation_tags is None:             # <<<<<<<<<<<<<<
 *                 # unlabeled dependency
 *                 answer = self._tag_sentence_unlabeled_dependency(sent)
*/
    __pyx_t_5 = (__pyx_v_self->__pyx_base.__pyx_base.validation_tags == ((PyObject*)Py_None));
    if (__pyx_t_5) {

      /* "nltkor/tag/libs/networkdependencyconv.pyx":227
 *             if self.validation_tags is None:
 *                 # unlabeled dependency
 *                 answer = self._tag_sentence_unlabeled_dependency(sent)             # <<<<<<<<<<<<<<
 *                 gold_tags = heads
 *             else:
*/
      __pyx_t_6 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_7 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_sent};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_tag_sentence_unlabeled_dependen, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 227, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XDECREF_SET(__pyx_v_answer, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "nltkor/tag/libs/networkdependencyconv.pyx":228
 *                 # unlabeled dependency
 *                 answer = self._tag_sentence_unlabeled_dependency(sent)
 *                 gold_tags = heads             # <<<<<<<<<<<<<<
 *             else:
 *                 # labeled dependency
*/
      __Pyx_INCREF(__pyx_v_heads);
      __Pyx_XDECREF_SET(__pyx_v_gold_tags, __pyx_v_heads);

      /* "nltkor/tag/libs/networkdependencyconv.pyx":225
 *             sentence_hit = True
 * 
 *             if self.validation_tags is None:             # <<<<<<<<<<<<<<
 *                 # unlabeled dependency
 *                 answer = self._tag_sentence_unlabeled_dependency(sent)
*/
      goto __pyx_L5;
    }

    /* "nltkor/tag/libs/networkdependencyconv.pyx":231
 *             else:
 *                 # labeled dependency
 *                 gold_tags = self.validation_tags[i]             # <<<<<<<<<<<<<<
 *                 answer = self._tag_sentence_labeled_dependency(sent, heads)
 * 
*/
    /*else*/ {
      if (unlikely(__pyx_v_self->__pyx_base.__pyx_base.validation_tags == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(5, 231, __pyx_L1_error)
      }
      __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->__pyx_base.__pyx_base.validation_tags, __pyx_v_i, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 231, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_gold_tags, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "nltkor/tag/libs/networkdependencyconv.pyx":232
 *                 # labeled dependency
 *                 gold_tags = self.validation_tags[i]
 *                 answer = self._tag_sentence_labeled_dependency(sent, heads)             # <<<<<<<<<<<<<<
 * 
 *             for j in range(len(gold_tags)):
*/
      __pyx_t_6 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_7 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_sent, __pyx_v_heads};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_tag_sentence_labeled_dependency, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 232, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XDECREF_SET(__pyx_v_answer, __pyx_t_1);
      __pyx_t_1 = 0;
    }
    __pyx_L5:;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":234
 *                 answer = self._tag_sentence_labeled_dependency(sent, heads)
 * 
 *             for j in range(len(gold_tags)):             # <<<<<<<<<<<<<<
 *                 net_tag = answer[j]
 *                 gold_tag = gold_tags[j]
*/
    __pyx_t_8 = PyObject_Length(__pyx_v_gold_tags); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(5, 234, __pyx_L1_error)
    __pyx_t_9 = __pyx_t_8;
    for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
      __pyx_v_j = __pyx_t_10;

      /* "nltkor/tag/libs/networkdependencyconv.pyx":235
 * 
 *             for j in range(len(gold_tags)):
 *                 net_tag = answer[j]             # <<<<<<<<<<<<<<
 *                 gold_tag = gold_tags[j]
 * 
*/
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_answer, __pyx_v_j, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 235, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_net_tag, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "nltkor/tag/libs/networkdependencyconv.pyx":236
 *             for j in range(len(gold_tags)):
 *                 net_tag = answer[j]
 *                 gold_tag = gold_tags[j]             # <<<<<<<<<<<<<<
 * 
 *                 if net_tag == gold_tag or (gold_tag == j and net_tag == len(sent)):
*/
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_gold_tags, __pyx_v_j, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 236, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_gold_tag, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "nltkor/tag/libs/networkdependencyconv.pyx":238
 *                 gold_tag = gold_tags[j]
 * 
 *                 if net_tag == gold_tag or (gold_tag == j and net_tag == len(sent)):             # <<<<<<<<<<<<<<
 *                     hits += 1
 *                 else:
*/
      __pyx_t_1 = PyObject_RichCompare(__pyx_v_net_tag, __pyx_v_gold_tag, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 238, __pyx_L1_error)
      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(5, 238, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!__pyx_t_11) {
      } else {
        __pyx_t_5 = __pyx_t_11;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 238, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = PyObject_RichCompare(__pyx_v_gold_tag, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 238, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(5, 238, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_11) {
      } else {
        __pyx_t_5 = __pyx_t_11;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_12 = PyObject_Length(__pyx_v_sent); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(5, 238, __pyx_L1_error)
      __pyx_t_6 = PyLong_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 238, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = PyObject_RichCompare(__pyx_v_net_tag, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 238, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(5, 238, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __pyx_t_11;
      __pyx_L9_bool_binop_done:;
      if (__pyx_t_5) {

        /* "nltkor/tag/libs/networkdependencyconv.pyx":239
 * 
 *                 if net_tag == gold_tag or (gold_tag == j and net_tag == len(sent)):
 *                     hits += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     sentence_hit = False
*/
        __pyx_t_1 = __Pyx_PyLong_AddObjC(__pyx_v_hits, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 239, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_hits, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "nltkor/tag/libs/networkdependencyconv.pyx":238
 *                 gold_tag = gold_tags[j]
 * 
 *                 if net_tag == gold_tag or (gold_tag == j and net_tag == len(sent)):             # <<<<<<<<<<<<<<
 *                     hits += 1
 *                 else:
*/
        goto __pyx_L8;
      }

      /* "nltkor/tag/libs/networkdependencyconv.pyx":241
 *                     hits += 1
 *                 else:
 *                     sentence_hit = False             # <<<<<<<<<<<<<<
 * 
 *             if sentence_hit:
*/
      /*else*/ {
        __pyx_v_sentence_hit = 0;
      }
      __pyx_L8:;
    }

    /* "nltkor/tag/libs/networkdependencyconv.pyx":243
 *                     sentence_hit = False
 * 
 *             if sentence_hit:             # <<<<<<<<<<<<<<
 *                 sentence_hits += 1
 *             num_tokens += len(sent)
*/
    if (__pyx_v_sentence_hit) {

      /* "nltkor/tag/libs/networkdependencyconv.pyx":244
 * 
 *             if sentence_hit:
 *                 sentence_hits += 1             # <<<<<<<<<<<<<<
 *             num_tokens += len(sent)
 * 
*/
      __pyx_t_1 = __Pyx_PyLong_AddObjC(__pyx_v_sentence_hits, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 244, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_sentence_hits, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "nltkor/tag/libs/networkdependencyconv.pyx":243
 *                     sentence_hit = False
 * 
 *             if sentence_hit:             # <<<<<<<<<<<<<<
 *                 sentence_hits += 1
 *             num_tokens += len(sent)
*/
    }

    /* "nltkor/tag/libs/networkdependencyconv.pyx":245
 *             if sentence_hit:
 *                 sentence_hits += 1
 *             num_tokens += len(sent)             # <<<<<<<<<<<<<<
 * 
 *         self.accuracy = float(hits) / num_tokens
*/
    __pyx_t_8 = PyObject_Length(__pyx_v_sent); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(5, 245, __pyx_L1_error)
    __pyx_t_1 = PyLong_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_num_tokens, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_num_tokens, __pyx_t_6);
    __pyx_t_6 = 0;
  }

  /* "nltkor/tag/libs/networkdependencyconv.pyx":247
 *             num_tokens += len(sent)
 * 
 *         self.accuracy = float(hits) / num_tokens             # <<<<<<<<<<<<<<
 *         self.sentence_accuracy = float(sentence_hits) / len(self.validation_sentences)
 * 
*/
  __pyx_t_6 = __Pyx_PyNumber_Float(__pyx_v_hits); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_v_num_tokens); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_13 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_13 == (float)-1) && PyErr_Occurred())) __PYX_ERR(5, 247, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->__pyx_base.__pyx_base.accuracy = __pyx_t_13;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":248
 * 
 *         self.accuracy = float(hits) / num_tokens
 *         self.sentence_accuracy = float(sentence_hits) / len(self.validation_sentences)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __Pyx_PyObject_AsDouble(__pyx_v_sentence_hits); if (unlikely(__pyx_t_14 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(5, 248, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.validation_sentences;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(5, 248, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(5, 248, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2 == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(5, 248, __pyx_L1_error)
  }
  __pyx_v_self->__pyx_base.__pyx_base.sentence_accuracy = (__pyx_t_14 / ((double)__pyx_t_2));

  /* "nltkor/tag/libs/networkdependencyconv.pyx":212
 *         return True
 * 
 *     def _validate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Evaluate the network performance by token hit and whole sentence hit.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(5, 212, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(5, 212, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._validate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_hits);
  __Pyx_XDECREF(__pyx_v_num_tokens);
  __Pyx_XDECREF(__pyx_v_sentence_hits);
  __Pyx_XDECREF(__pyx_v_sent);
  __Pyx_XDECREF(__pyx_v_heads);
  __Pyx_XDECREF(__pyx_v_answer);
  __Pyx_XDECREF(__pyx_v_gold_tags);
  __Pyx_XDECREF(__pyx_v_net_tag);
  __Pyx_XDECREF(__pyx_v_gold_tag);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":251
 * 
 * 
 *     def _average_error(self):             # <<<<<<<<<<<<<<
 *         """
 *         Average the network error over tokens.
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_19_average_error(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_18_average_error, "ConvolutionalDependencyNetwork._average_error(self)\nAverage the network error over tokens.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_19_average_error = {"_average_error", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_19_average_error, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_18_average_error};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_19_average_error(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_average_error (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_average_error", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_average_error", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_18_average_error(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_18_average_error(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[145]))
  __Pyx_RefNannySetupContext("_average_error", 0);
  __Pyx_TraceStartFunc("_average_error", __pyx_f[5], 251, 0, 0, 0, __PYX_ERR(5, 251, __pyx_L1_error));

  /* "nltkor/tag/libs/networkdependencyconv.pyx":255
 *         Average the network error over tokens.
 *         """
 *         self.error = self.error / self.num_tokens             # <<<<<<<<<<<<<<
 * 
 *     def _print_epoch_report(self, int num):
*/
  if (unlikely(__pyx_v_self->__pyx_base.__pyx_base.num_tokens == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(5, 255, __pyx_L1_error)
  }
  __pyx_v_self->__pyx_base.__pyx_base.error = (__pyx_v_self->__pyx_base.__pyx_base.error / ((float)__pyx_v_self->__pyx_base.__pyx_base.num_tokens));

  /* "nltkor/tag/libs/networkdependencyconv.pyx":251
 * 
 * 
 *     def _average_error(self):             # <<<<<<<<<<<<<<
 *         """
 *         Average the network error over tokens.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(5, 251, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(5, 251, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._average_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":257
 *         self.error = self.error / self.num_tokens
 * 
 *     def _print_epoch_report(self, int num):             # <<<<<<<<<<<<<<
 *         """
 *         Reports the status of the network in the given training
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_21_print_epoch_report(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_20_print_epoch_report, "ConvolutionalDependencyNetwork._print_epoch_report(self, int num)\nReports the status of the network in the given training\nepoch, including error, token and sentence accuracy.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_21_print_epoch_report = {"_print_epoch_report", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_21_print_epoch_report, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_20_print_epoch_report};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_21_print_epoch_report(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  int __pyx_v_num;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_print_epoch_report (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_num,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(5, 257, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 257, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_print_epoch_report", 0) < 0) __PYX_ERR(5, 257, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_print_epoch_report", 1, 1, 1, i); __PYX_ERR(5, 257, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 257, __pyx_L3_error)
    }
    __pyx_v_num = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_num == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 257, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_print_epoch_report", 1, 1, 1, __pyx_nargs); __PYX_ERR(5, 257, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._print_epoch_report", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_20_print_epoch_report(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self), __pyx_v_num);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_20_print_epoch_report(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, int __pyx_v_num) {
  PyObject *__pyx_v_logger = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11[11];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[146]))
  __Pyx_RefNannySetupContext("_print_epoch_report", 0);
  __Pyx_TraceStartFunc("_print_epoch_report", __pyx_f[5], 257, 0, 0, 0, __PYX_ERR(5, 257, __pyx_L1_error));

  /* "nltkor/tag/libs/networkdependencyconv.pyx":262
 *         epoch, including error, token and sentence accuracy.
 *         """
 *         logger = logging.getLogger("Logger")             # <<<<<<<<<<<<<<
 *         logger.info("%d epochs   Error: %f   Token accuracy: %f   " \
 *                     "Sentence accuracy: %f    " \
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_logging); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_getLogger); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Logger};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_logger = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":263
 *         """
 *         logger = logging.getLogger("Logger")
 *         logger.info("%d epochs   Error: %f   Token accuracy: %f   " \             # <<<<<<<<<<<<<<
 *                     "Sentence accuracy: %f    " \
 *                     "%d corrections skipped   " \
*/
  __pyx_t_4 = __pyx_v_logger;
  __Pyx_INCREF(__pyx_t_4);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":266
 *                     "Sentence accuracy: %f    " \
 *                     "%d corrections skipped   " \
 *                     "Learning rate: %f"  % (num,             # <<<<<<<<<<<<<<
 *                                             self.error,
 *                                             self.accuracy,
*/
  __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_num, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":267
 *                     "%d corrections skipped   " \
 *                     "Learning rate: %f"  % (num,
 *                                             self.error,             # <<<<<<<<<<<<<<
 *                                             self.accuracy,
 *                                             self.sentence_accuracy,
*/
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.error); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_Format(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_f); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":268
 *                     "Learning rate: %f"  % (num,
 *                                             self.error,
 *                                             self.accuracy,             # <<<<<<<<<<<<<<
 *                                             self.sentence_accuracy,
 *                                             self.skips,
*/
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.accuracy); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyObject_Format(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_f); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":269
 *                                             self.error,
 *                                             self.accuracy,
 *                                             self.sentence_accuracy,             # <<<<<<<<<<<<<<
 *                                             self.skips,
 *                                             self.learning_rate))
*/
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.sentence_accuracy); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_8 = __Pyx_PyObject_Format(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_f); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":270
 *                                             self.accuracy,
 *                                             self.sentence_accuracy,
 *                                             self.skips,             # <<<<<<<<<<<<<<
 *                                             self.learning_rate))
 * 
*/
  __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_v_self->__pyx_base.__pyx_base.skips, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":271
 *                                             self.sentence_accuracy,
 *                                             self.skips,
 *                                             self.learning_rate))             # <<<<<<<<<<<<<<
 * 
 *     def tag_sentence(self, np.ndarray sentence, np.ndarray heads=None):
*/
  __pyx_t_9 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.learning_rate); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_Format(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_f); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_11[0] = __pyx_t_2;
  __pyx_t_11[1] = __pyx_mstate_global->__pyx_kp_u_epochs_Error;
  __pyx_t_11[2] = __pyx_t_6;
  __pyx_t_11[3] = __pyx_mstate_global->__pyx_kp_u_Token_accuracy;
  __pyx_t_11[4] = __pyx_t_7;
  __pyx_t_11[5] = __pyx_mstate_global->__pyx_kp_u_Sentence_accuracy;
  __pyx_t_11[6] = __pyx_t_8;
  __pyx_t_11[7] = __pyx_mstate_global->__pyx_kp_u__4;
  __pyx_t_11[8] = __pyx_t_3;
  __pyx_t_11[9] = __pyx_mstate_global->__pyx_kp_u_corrections_skipped_Learning_ra;
  __pyx_t_11[10] = __pyx_t_10;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":263
 *         """
 *         logger = logging.getLogger("Logger")
 *         logger.info("%d epochs   Error: %f   Token accuracy: %f   " \             # <<<<<<<<<<<<<<
 *                     "Sentence accuracy: %f    " \
 *                     "%d corrections skipped   " \
*/
  __pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_11, 11, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 17 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 19 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 22 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 4 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 38 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10));
  if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_9};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_info, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":257
 *         self.error = self.error / self.num_tokens
 * 
 *     def _print_epoch_report(self, int num):             # <<<<<<<<<<<<<<
 *         """
 *         Reports the status of the network in the given training
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(5, 257, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(5, 257, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._print_epoch_report", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_logger);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":273
 *                                             self.learning_rate))
 * 
 *     def tag_sentence(self, np.ndarray sentence, np.ndarray heads=None):             # <<<<<<<<<<<<<<
 *         """
 *         If heads is not given, compute the dependency edges in the sentence.
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_23tag_sentence(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_22tag_sentence, "ConvolutionalDependencyNetwork.tag_sentence(self, ndarray sentence, ndarray heads=None)\nIf heads is not given, compute the dependency edges in the sentence.\nIf it is given, compute the label of each dependency.\n\n:returns: a numpy 1-dim array with the head for each token or label\n    of each edge. In the first case, a dependency from the root is \n    represented as a value equal to the sentence length. ");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_23tag_sentence = {"tag_sentence", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_23tag_sentence, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_22tag_sentence};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_23tag_sentence(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyArrayObject *__pyx_v_sentence = 0;
  PyArrayObject *__pyx_v_heads = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tag_sentence (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sentence,&__pyx_mstate_global->__pyx_n_u_heads,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(5, 273, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(5, 273, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 273, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "tag_sentence", 0) < 0) __PYX_ERR(5, 273, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((PyArrayObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("tag_sentence", 0, 1, 2, i); __PYX_ERR(5, 273, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(5, 273, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 273, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((PyArrayObject *)Py_None));
    }
    __pyx_v_sentence = ((PyArrayObject *)values[0]);
    __pyx_v_heads = ((PyArrayObject *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tag_sentence", 0, 1, 2, __pyx_nargs); __PYX_ERR(5, 273, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork.tag_sentence", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sentence), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "sentence", 0))) __PYX_ERR(5, 273, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_heads), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "heads", 0))) __PYX_ERR(5, 273, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_22tag_sentence(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self), __pyx_v_sentence, __pyx_v_heads);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_22tag_sentence(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyArrayObject *__pyx_v_sentence, PyArrayObject *__pyx_v_heads) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[147]))
  __Pyx_RefNannySetupContext("tag_sentence", 0);
  __Pyx_TraceStartFunc("tag_sentence", __pyx_f[5], 273, 0, 0, 0, __PYX_ERR(5, 273, __pyx_L1_error));

  /* "nltkor/tag/libs/networkdependencyconv.pyx":282
 *             represented as a value equal to the sentence length.
 *         """
 *         if heads is None:             # <<<<<<<<<<<<<<
 *             return self._tag_sentence_unlabeled_dependency(sentence)
 *         else:
*/
  __pyx_t_1 = (((PyObject *)__pyx_v_heads) == Py_None);
  if (__pyx_t_1) {

    /* "nltkor/tag/libs/networkdependencyconv.pyx":283
 *         """
 *         if heads is None:
 *             return self._tag_sentence_unlabeled_dependency(sentence)             # <<<<<<<<<<<<<<
 *         else:
 *             return self._tag_sentence_labeled_dependency(sentence, heads)
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_sentence)};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_tag_sentence_unlabeled_dependen, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 283, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_TraceReturnValue(__pyx_r, 6, 0, __PYX_ERR(5, 283, __pyx_L1_error));
    goto __pyx_L0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":282
 *             represented as a value equal to the sentence length.
 *         """
 *         if heads is None:             # <<<<<<<<<<<<<<
 *             return self._tag_sentence_unlabeled_dependency(sentence)
 *         else:
*/
  }

  /* "nltkor/tag/libs/networkdependencyconv.pyx":285
 *             return self._tag_sentence_unlabeled_dependency(sentence)
 *         else:
 *             return self._tag_sentence_labeled_dependency(sentence, heads)             # <<<<<<<<<<<<<<
 * 
 *     def _find_cycles(self, np.ndarray graph):
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, ((PyObject *)__pyx_v_sentence), ((PyObject *)__pyx_v_heads)};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_tag_sentence_labeled_dependency, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 285, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_TraceReturnValue(__pyx_r, 11, 0, __PYX_ERR(5, 285, __pyx_L1_error));
    goto __pyx_L0;
  }

  /* "nltkor/tag/libs/networkdependencyconv.pyx":273
 *                                             self.learning_rate))
 * 
 *     def tag_sentence(self, np.ndarray sentence, np.ndarray heads=None):             # <<<<<<<<<<<<<<
 *         """
 *         If heads is not given, compute the dependency edges in the sentence.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(5, 273, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork.tag_sentence", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":287
 *             return self._tag_sentence_labeled_dependency(sentence, heads)
 * 
 *     def _find_cycles(self, np.ndarray graph):             # <<<<<<<<<<<<<<
 *         """
 *         Check if the given graph has cycles and returns the first one
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_25_find_cycles(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_24_find_cycles, "ConvolutionalDependencyNetwork._find_cycles(self, ndarray graph)\nCheck if the given graph has cycles and returns the first one\nto be found.\n\n:param graph: an array where graph[i] has the number of a\n    vertex with an incoming connection to i");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_25_find_cycles = {"_find_cycles", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_25_find_cycles, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_24_find_cycles};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_25_find_cycles(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyArrayObject *__pyx_v_graph = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_find_cycles (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_graph,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(5, 287, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 287, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_find_cycles", 0) < 0) __PYX_ERR(5, 287, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_find_cycles", 1, 1, 1, i); __PYX_ERR(5, 287, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 287, __pyx_L3_error)
    }
    __pyx_v_graph = ((PyArrayObject *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_find_cycles", 1, 1, 1, __pyx_nargs); __PYX_ERR(5, 287, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._find_cycles", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_graph), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "graph", 0))) __PYX_ERR(5, 287, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_24_find_cycles(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self), __pyx_v_graph);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_24_find_cycles(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyArrayObject *__pyx_v_graph) {
  PyObject *__pyx_v_reachable_vertices = NULL;
  PyObject *__pyx_v_vertices_in_cycles = NULL;
  PyObject *__pyx_v_visited = NULL;
  PyObject *__pyx_v_cycles = NULL;
  Py_ssize_t __pyx_v_vertex;
  PyObject *__pyx_v_cycle = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[148]))
  __Pyx_RefNannySetupContext("_find_cycles", 0);
  __Pyx_TraceStartFunc("_find_cycles", __pyx_f[5], 287, 0, 0, 0, __PYX_ERR(5, 287, __pyx_L1_error));

  /* "nltkor/tag/libs/networkdependencyconv.pyx":296
 *         """
 *         # this set stores all vertices with a valid path to the root
 *         reachable_vertices = set()             # <<<<<<<<<<<<<<
 * 
 *         # vertices known to be unreachable from the root, i.e., in a cycle
*/
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_reachable_vertices = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":299
 * 
 *         # vertices known to be unreachable from the root, i.e., in a cycle
 *         vertices_in_cycles = set()             # <<<<<<<<<<<<<<
 * 
 *         # vertices currently being evaluated, not known if they're reachable
*/
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_vertices_in_cycles = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":302
 * 
 *         # vertices currently being evaluated, not known if they're reachable
 *         visited = set()             # <<<<<<<<<<<<<<
 * 
 *         cycles = []
*/
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_visited = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":304
 *         visited = set()
 * 
 *         cycles = []             # <<<<<<<<<<<<<<
 * 
 *         # the directions of the edges don't matter if we only want to find cycles
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_cycles = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":307
 * 
 *         # the directions of the edges don't matter if we only want to find cycles
 *         for vertex in range(len(graph)):             # <<<<<<<<<<<<<<
 *             if vertex in reachable_vertices or vertex in vertices_in_cycles:
 *                 continue
*/
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_graph)); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(5, 307, __pyx_L1_error)
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_vertex = __pyx_t_4;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":308
 *         # the directions of the edges don't matter if we only want to find cycles
 *         for vertex in range(len(graph)):
 *             if vertex in reachable_vertices or vertex in vertices_in_cycles:             # <<<<<<<<<<<<<<
 *                 continue
 * 
*/
    __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_vertex); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_reachable_vertices, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(5, 308, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!__pyx_t_6) {
    } else {
      __pyx_t_5 = __pyx_t_6;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_vertex); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_vertices_in_cycles, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(5, 308, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = __pyx_t_6;
    __pyx_L6_bool_binop_done:;
    if (__pyx_t_5) {

      /* "nltkor/tag/libs/networkdependencyconv.pyx":309
 *         for vertex in range(len(graph)):
 *             if vertex in reachable_vertices or vertex in vertices_in_cycles:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             cycle = self._find_cycle_recursive(graph, vertex, visited,
*/
      goto __pyx_L3_continue;

      /* "nltkor/tag/libs/networkdependencyconv.pyx":308
 *         # the directions of the edges don't matter if we only want to find cycles
 *         for vertex in range(len(graph)):
 *             if vertex in reachable_vertices or vertex in vertices_in_cycles:             # <<<<<<<<<<<<<<
 *                 continue
 * 
*/
    }

    /* "nltkor/tag/libs/networkdependencyconv.pyx":311
 *                 continue
 * 
 *             cycle = self._find_cycle_recursive(graph, vertex, visited,             # <<<<<<<<<<<<<<
 *                                                reachable_vertices, vertices_in_cycles)
 *             if cycle is not None:
*/
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_vertex); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);

    /* "nltkor/tag/libs/networkdependencyconv.pyx":312
 * 
 *             cycle = self._find_cycle_recursive(graph, vertex, visited,
 *                                                reachable_vertices, vertices_in_cycles)             # <<<<<<<<<<<<<<
 *             if cycle is not None:
 *                 cycles.append(cycle)
*/
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[6] = {__pyx_t_7, ((PyObject *)__pyx_v_graph), __pyx_t_8, __pyx_v_visited, __pyx_v_reachable_vertices, __pyx_v_vertices_in_cycles};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_find_cycle_recursive, __pyx_callargs+__pyx_t_9, (6-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 311, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_cycle, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":313
 *             cycle = self._find_cycle_recursive(graph, vertex, visited,
 *                                                reachable_vertices, vertices_in_cycles)
 *             if cycle is not None:             # <<<<<<<<<<<<<<
 *                 cycles.append(cycle)
 * 
*/
    __pyx_t_5 = (__pyx_v_cycle != Py_None);
    if (__pyx_t_5) {

      /* "nltkor/tag/libs/networkdependencyconv.pyx":314
 *                                                reachable_vertices, vertices_in_cycles)
 *             if cycle is not None:
 *                 cycles.append(cycle)             # <<<<<<<<<<<<<<
 * 
 *         return cycles
*/
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_cycles, __pyx_v_cycle); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(5, 314, __pyx_L1_error)

      /* "nltkor/tag/libs/networkdependencyconv.pyx":313
 *             cycle = self._find_cycle_recursive(graph, vertex, visited,
 *                                                reachable_vertices, vertices_in_cycles)
 *             if cycle is not None:             # <<<<<<<<<<<<<<
 *                 cycles.append(cycle)
 * 
*/
    }
    __pyx_L3_continue:;
  }

  /* "nltkor/tag/libs/networkdependencyconv.pyx":316
 *                 cycles.append(cycle)
 * 
 *         return cycles             # <<<<<<<<<<<<<<
 * 
 *     def _find_cycle_recursive(self, np.ndarray graph, int vertex, set visited,
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_cycles);
  __pyx_r = __pyx_v_cycles;
  __Pyx_TraceReturnValue(__pyx_r, 42, 0, __PYX_ERR(5, 316, __pyx_L1_error));
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":287
 *             return self._tag_sentence_labeled_dependency(sentence, heads)
 * 
 *     def _find_cycles(self, np.ndarray graph):             # <<<<<<<<<<<<<<
 *         """
 *         Check if the given graph has cycles and returns the first one
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(5, 287, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._find_cycles", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_reachable_vertices);
  __Pyx_XDECREF(__pyx_v_vertices_in_cycles);
  __Pyx_XDECREF(__pyx_v_visited);
  __Pyx_XDECREF(__pyx_v_cycles);
  __Pyx_XDECREF(__pyx_v_cycle);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":318
 *         return cycles
 * 
 *     def _find_cycle_recursive(self, np.ndarray graph, int vertex, set visited,             # <<<<<<<<<<<<<<
 *                               set reachable, set unreachable):
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_27_find_cycle_recursive(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_26_find_cycle_recursive, "ConvolutionalDependencyNetwork._find_cycle_recursive(self, ndarray graph, int vertex, set visited, set reachable, set unreachable)\nAuxiliary recursive function for searching the graph for cycles.\nIt returns the first cycle it can find starting from the given\nvertex, or None.");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_27_find_cycle_recursive = {"_find_cycle_recursive", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_27_find_cycle_recursive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_26_find_cycle_recursive};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_27_find_cycle_recursive(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyArrayObject *__pyx_v_graph = 0;
  int __pyx_v_vertex;
  PyObject *__pyx_v_visited = 0;
  PyObject *__pyx_v_reachable = 0;
  PyObject *__pyx_v_unreachable = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_find_cycle_recursive (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_graph,&__pyx_mstate_global->__pyx_n_u_vertex,&__pyx_mstate_global->__pyx_n_u_visited,&__pyx_mstate_global->__pyx_n_u_reachable,&__pyx_mstate_global->__pyx_n_u_unreachable,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(5, 318, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(5, 318, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(5, 318, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(5, 318, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(5, 318, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 318, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_find_cycle_recursive", 0) < 0) __PYX_ERR(5, 318, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_find_cycle_recursive", 1, 5, 5, i); __PYX_ERR(5, 318, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 5)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 318, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(5, 318, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(5, 318, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(5, 318, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(5, 318, __pyx_L3_error)
    }
    __pyx_v_graph = ((PyArrayObject *)values[0]);
    __pyx_v_vertex = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_vertex == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 318, __pyx_L3_error)
    __pyx_v_visited = ((PyObject*)values[2]);
    __pyx_v_reachable = ((PyObject*)values[3]);
    __pyx_v_unreachable = ((PyObject*)values[4]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_find_cycle_recursive", 1, 5, 5, __pyx_nargs); __PYX_ERR(5, 318, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._find_cycle_recursive", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_graph), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "graph", 0))) __PYX_ERR(5, 318, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_visited), (&PySet_Type), 1, "visited", 1))) __PYX_ERR(5, 318, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_reachable), (&PySet_Type), 1, "reachable", 1))) __PYX_ERR(5, 319, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unreachable), (&PySet_Type), 1, "unreachable", 1))) __PYX_ERR(5, 319, __pyx_L1_error)
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_26_find_cycle_recursive(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self), __pyx_v_graph, __pyx_v_vertex, __pyx_v_visited, __pyx_v_reachable, __pyx_v_unreachable);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_26_find_cycle_recursive(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyArrayObject *__pyx_v_graph, int __pyx_v_vertex, PyObject *__pyx_v_visited, PyObject *__pyx_v_reachable, PyObject *__pyx_v_unreachable) {
  PyObject *__pyx_v_next_vertex = NULL;
  Py_ssize_t __pyx_v_root;
  PyObject *__pyx_v_cycle = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[149]))
  __Pyx_RefNannySetupContext("_find_cycle_recursive", 0);
  __Pyx_TraceStartFunc("_find_cycle_recursive", __pyx_f[5], 318, 0, 0, 0, __PYX_ERR(5, 318, __pyx_L1_error));

  /* "nltkor/tag/libs/networkdependencyconv.pyx":325
 *         vertex, or None.
 *         """
 *         next_vertex = graph[vertex]             # <<<<<<<<<<<<<<
 *         root = len(graph)
 *         visited.add(vertex)
*/
  __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_graph), __pyx_v_vertex, int, 1, __Pyx_PyLong_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_next_vertex = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":326
 *         """
 *         next_vertex = graph[vertex]
 *         root = len(graph)             # <<<<<<<<<<<<<<
 *         visited.add(vertex)
 * 
*/
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_graph)); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(5, 326, __pyx_L1_error)
  __pyx_v_root = __pyx_t_2;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":327
 *         next_vertex = graph[vertex]
 *         root = len(graph)
 *         visited.add(vertex)             # <<<<<<<<<<<<<<
 * 
 *         if next_vertex == root or next_vertex in reachable:
*/
  if (unlikely(__pyx_v_visited == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
    __PYX_ERR(5, 327, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_vertex); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PySet_Add(__pyx_v_visited, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 327, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":329
 *         visited.add(vertex)
 * 
 *         if next_vertex == root or next_vertex in reachable:             # <<<<<<<<<<<<<<
 *             # vertex linked to root
 *             reachable.update(visited)
*/
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_root); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_RichCompare(__pyx_v_next_vertex, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 329, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(5, 329, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (!__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  if (unlikely(__pyx_v_reachable == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(5, 329, __pyx_L1_error)
  }
  __pyx_t_6 = (__Pyx_PySet_ContainsTF(__pyx_v_next_vertex, __pyx_v_reachable, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(5, 329, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_4) {

    /* "nltkor/tag/libs/networkdependencyconv.pyx":331
 *         if next_vertex == root or next_vertex in reachable:
 *             # vertex linked to root
 *             reachable.update(visited)             # <<<<<<<<<<<<<<
 *             visited.clear()
 *             cycle = None
*/
    __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PySet_Type__update, __pyx_v_reachable, __pyx_v_visited); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 331, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":332
 *             # vertex linked to root
 *             reachable.update(visited)
 *             visited.clear()             # <<<<<<<<<<<<<<
 *             cycle = None
 * 
*/
    if (unlikely(__pyx_v_visited == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear");
      __PYX_ERR(5, 332, __pyx_L1_error)
    }
    __pyx_t_3 = PySet_Clear(__pyx_v_visited); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 332, __pyx_L1_error)

    /* "nltkor/tag/libs/networkdependencyconv.pyx":333
 *             reachable.update(visited)
 *             visited.clear()
 *             cycle = None             # <<<<<<<<<<<<<<
 * 
 *         elif next_vertex in visited:
*/
    __Pyx_INCREF(Py_None);
    __pyx_v_cycle = Py_None;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":329
 *         visited.add(vertex)
 * 
 *         if next_vertex == root or next_vertex in reachable:             # <<<<<<<<<<<<<<
 *             # vertex linked to root
 *             reachable.update(visited)
*/
    goto __pyx_L3;
  }

  /* "nltkor/tag/libs/networkdependencyconv.pyx":335
 *             cycle = None
 * 
 *         elif next_vertex in visited:             # <<<<<<<<<<<<<<
 *             # cycle detected! return all vertices in it
 *             visited.clear()
*/
  if (unlikely(__pyx_v_visited == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(5, 335, __pyx_L1_error)
  }
  __pyx_t_4 = (__Pyx_PySet_ContainsTF(__pyx_v_next_vertex, __pyx_v_visited, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(5, 335, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "nltkor/tag/libs/networkdependencyconv.pyx":337
 *         elif next_vertex in visited:
 *             # cycle detected! return all vertices in it
 *             visited.clear()             # <<<<<<<<<<<<<<
 *             cycle = set([vertex])
 *             while next_vertex != vertex:
*/
    if (unlikely(__pyx_v_visited == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear");
      __PYX_ERR(5, 337, __pyx_L1_error)
    }
    __pyx_t_3 = PySet_Clear(__pyx_v_visited); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 337, __pyx_L1_error)

    /* "nltkor/tag/libs/networkdependencyconv.pyx":338
 *             # cycle detected! return all vertices in it
 *             visited.clear()
 *             cycle = set([vertex])             # <<<<<<<<<<<<<<
 *             while next_vertex != vertex:
 *                 cycle.add(next_vertex)
*/
    __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_vertex); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 338, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 338, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PySet_Add(__pyx_t_1, __pyx_t_5) < 0) __PYX_ERR(5, 338, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_cycle = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":339
 *             visited.clear()
 *             cycle = set([vertex])
 *             while next_vertex != vertex:             # <<<<<<<<<<<<<<
 *                 cycle.add(next_vertex)
 *                 next_vertex = graph[next_vertex]
*/
    while (1) {
      __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_vertex); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 339, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_next_vertex, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 339, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(5, 339, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (!__pyx_t_4) break;

      /* "nltkor/tag/libs/networkdependencyconv.pyx":340
 *             cycle = set([vertex])
 *             while next_vertex != vertex:
 *                 cycle.add(next_vertex)             # <<<<<<<<<<<<<<
 *                 next_vertex = graph[next_vertex]
 * 
*/
      __pyx_t_1 = __pyx_v_cycle;
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_7 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_next_vertex};
        __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_add, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 340, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "nltkor/tag/libs/networkdependencyconv.pyx":341
 *             while next_vertex != vertex:
 *                 cycle.add(next_vertex)
 *                 next_vertex = graph[next_vertex]             # <<<<<<<<<<<<<<
 * 
 *             unreachable.update(cycle)
*/
      __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_graph), __pyx_v_next_vertex); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 341, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF_SET(__pyx_v_next_vertex, __pyx_t_5);
      __pyx_t_5 = 0;
    }

    /* "nltkor/tag/libs/networkdependencyconv.pyx":343
 *                 next_vertex = graph[next_vertex]
 * 
 *             unreachable.update(cycle)             # <<<<<<<<<<<<<<
 * 
 *         elif next_vertex in unreachable:
*/
    __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PySet_Type__update, __pyx_v_unreachable, __pyx_v_cycle); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":335
 *             cycle = None
 * 
 *         elif next_vertex in visited:             # <<<<<<<<<<<<<<
 *             # cycle detected! return all vertices in it
 *             visited.clear()
*/
    goto __pyx_L3;
  }

  /* "nltkor/tag/libs/networkdependencyconv.pyx":345
 *             unreachable.update(cycle)
 * 
 *         elif next_vertex in unreachable:             # <<<<<<<<<<<<<<
 *             # vertex linked to an existing cycle, but not part of it
 *             # (if it were, it should have been filtered out in _find_cycles)
*/
  if (unlikely(__pyx_v_unreachable == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(5, 345, __pyx_L1_error)
  }
  __pyx_t_4 = (__Pyx_PySet_ContainsTF(__pyx_v_next_vertex, __pyx_v_unreachable, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(5, 345, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "nltkor/tag/libs/networkdependencyconv.pyx":348
 *             # vertex linked to an existing cycle, but not part of it
 *             # (if it were, it should have been filtered out in _find_cycles)
 *             visited.clear()             # <<<<<<<<<<<<<<
 *             cycle = None
 * 
*/
    if (unlikely(__pyx_v_visited == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear");
      __PYX_ERR(5, 348, __pyx_L1_error)
    }
    __pyx_t_3 = PySet_Clear(__pyx_v_visited); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 348, __pyx_L1_error)

    /* "nltkor/tag/libs/networkdependencyconv.pyx":349
 *             # (if it were, it should have been filtered out in _find_cycles)
 *             visited.clear()
 *             cycle = None             # <<<<<<<<<<<<<<
 * 
 *         else:
*/
    __Pyx_INCREF(Py_None);
    __pyx_v_cycle = Py_None;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":345
 *             unreachable.update(cycle)
 * 
 *         elif next_vertex in unreachable:             # <<<<<<<<<<<<<<
 *             # vertex linked to an existing cycle, but not part of it
 *             # (if it were, it should have been filtered out in _find_cycles)
*/
    goto __pyx_L3;
  }

  /* "nltkor/tag/libs/networkdependencyconv.pyx":353
 *         else:
 *             # continue checking
 *             cycle = self._find_cycle_recursive(graph, next_vertex, visited,             # <<<<<<<<<<<<<<
 *                                                reachable, unreachable)
 * 
*/
  /*else*/ {
    __pyx_t_1 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_1);

    /* "nltkor/tag/libs/networkdependencyconv.pyx":354
 *             # continue checking
 *             cycle = self._find_cycle_recursive(graph, next_vertex, visited,
 *                                                reachable, unreachable)             # <<<<<<<<<<<<<<
 * 
 *         return cycle
*/
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[6] = {__pyx_t_1, ((PyObject *)__pyx_v_graph), __pyx_v_next_vertex, __pyx_v_visited, __pyx_v_reachable, __pyx_v_unreachable};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_find_cycle_recursive, __pyx_callargs+__pyx_t_7, (6-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 353, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_v_cycle = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __pyx_L3:;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":356
 *                                                reachable, unreachable)
 * 
 *         return cycle             # <<<<<<<<<<<<<<
 * 
 *     def _contract_cycle(self, heads, cycle):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_cycle);
  __pyx_r = __pyx_v_cycle;
  __Pyx_TraceReturnValue(__pyx_r, 74, 0, __PYX_ERR(5, 356, __pyx_L1_error));
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":318
 *         return cycles
 * 
 *     def _find_cycle_recursive(self, np.ndarray graph, int vertex, set visited,             # <<<<<<<<<<<<<<
 *                               set reachable, set unreachable):
 *         """
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(5, 318, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._find_cycle_recursive", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_next_vertex);
  __Pyx_XDECREF(__pyx_v_cycle);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":358
 *         return cycle
 * 
 *     def _contract_cycle(self, heads, cycle):             # <<<<<<<<<<<<<<
 *         """
 *         Contract the given cycle in the dependency graph.
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_29_contract_cycle(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_28_contract_cycle, "ConvolutionalDependencyNetwork._contract_cycle(self, heads, cycle)\nContract the given cycle in the dependency graph.\n\n:param heads: list of the heads of each token, such that\n    heads[i] contains the head for the i-th token\n:param cycle: a set containing the numbers of the vertices\n    in the cycle");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_29_contract_cycle = {"_contract_cycle", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_29_contract_cycle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_28_contract_cycle};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_29_contract_cycle(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_heads = 0;
  PyObject *__pyx_v_cycle = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_contract_cycle (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_heads,&__pyx_mstate_global->__pyx_n_u_cycle,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(5, 358, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(5, 358, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 358, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_contract_cycle", 0) < 0) __PYX_ERR(5, 358, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_contract_cycle", 1, 2, 2, i); __PYX_ERR(5, 358, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 358, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(5, 358, __pyx_L3_error)
    }
    __pyx_v_heads = values[0];
    __pyx_v_cycle = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_contract_cycle", 1, 2, 2, __pyx_nargs); __PYX_ERR(5, 358, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._contract_cycle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_28_contract_cycle(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self), __pyx_v_heads, __pyx_v_cycle);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_28_contract_cycle(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyObject *__pyx_v_heads, PyObject *__pyx_v_cycle) {
  npy_intp __pyx_v_num_vertices;
  PyObject *__pyx_v_outside = NULL;
  PyArrayObject *__pyx_v_outgoing_weights = 0;
  PyObject *__pyx_v_outside_inds = NULL;
  PyObject *__pyx_v_max_outgoing_inds = NULL;
  PyObject *__pyx_v_max_outgoing_weights = NULL;
  PyObject *__pyx_v_cycle_inds = NULL;
  PyArrayObject *__pyx_v_incoming_weights = 0;
  PyObject *__pyx_v_cycle_score = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_vertex = NULL;
  PyObject *__pyx_v_head_to_v = NULL;
  PyObject *__pyx_v_max_incoming_inds = NULL;
  PyObject *__pyx_v_max_incoming_weights = NULL;
  PyObject *__pyx_v_new_head_ind = NULL;
  PyObject *__pyx_v_vertex_leaving_cycle_ind = NULL;
  PyObject *__pyx_v_new_head = NULL;
  PyObject *__pyx_v_vertex_leaving_cycle = NULL;
  PyObject *__pyx_v_old_head = NULL;
  npy_intp __pyx_9genexpr10__pyx_v_x;
  PyObject *__pyx_9genexpr11__pyx_v_i = NULL;
  PyObject *__pyx_9genexpr12__pyx_v_i = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_incoming_weights;
  __Pyx_Buffer __pyx_pybuffer_incoming_weights;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_outgoing_weights;
  __Pyx_Buffer __pyx_pybuffer_outgoing_weights;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  npy_intp *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  npy_intp __pyx_t_6;
  npy_intp __pyx_t_7;
  npy_intp __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  size_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *(*__pyx_t_14)(PyObject *);
  int __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[150]))
  __Pyx_RefNannySetupContext("_contract_cycle", 0);
  __Pyx_TraceStartFunc("_contract_cycle", __pyx_f[5], 358, 0, 0, 0, __PYX_ERR(5, 358, __pyx_L1_error));
  __Pyx_INCREF(__pyx_v_cycle);
  __pyx_pybuffer_outgoing_weights.pybuffer.buf = NULL;
  __pyx_pybuffer_outgoing_weights.refcount = 0;
  __pyx_pybuffernd_outgoing_weights.data = NULL;
  __pyx_pybuffernd_outgoing_weights.rcbuffer = &__pyx_pybuffer_outgoing_weights;
  __pyx_pybuffer_incoming_weights.pybuffer.buf = NULL;
  __pyx_pybuffer_incoming_weights.refcount = 0;
  __pyx_pybuffernd_incoming_weights.data = NULL;
  __pyx_pybuffernd_incoming_weights.rcbuffer = &__pyx_pybuffer_incoming_weights;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":369
 *         # each cell i, j has the score for token i having j as its head.
 * 
 *         num_vertices = self.dependency_weights.shape[1]             # <<<<<<<<<<<<<<
 *         outside = np.array([x for x in range(num_vertices) if x not in cycle])
 *         cycle = np.array(list(cycle))
*/
  __pyx_t_1 = ((PyObject *)__pyx_v_self->dependency_weights);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((npy_intp *)0) && PyErr_Occurred())) __PYX_ERR(5, 369, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_num_vertices = (__pyx_t_2[1]);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":370
 * 
 *         num_vertices = self.dependency_weights.shape[1]
 *         outside = np.array([x for x in range(num_vertices) if x not in cycle])             # <<<<<<<<<<<<<<
 *         cycle = np.array(list(cycle))
 * 
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  { /* enter inner scope */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __pyx_v_num_vertices;
    __pyx_t_7 = __pyx_t_6;
    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
      __pyx_9genexpr10__pyx_v_x = __pyx_t_8;
      __pyx_t_9 = __Pyx_PyLong_From_Py_intptr_t(__pyx_9genexpr10__pyx_v_x); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 370, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_9, __pyx_v_cycle, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(5, 370, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (__pyx_t_10) {
        __pyx_t_9 = __Pyx_PyLong_From_Py_intptr_t(__pyx_9genexpr10__pyx_v_x); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 370, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_9))) __PYX_ERR(5, 370, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
  } /* exit inner scope */
  __pyx_t_11 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_11 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_outside = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":371
 *         num_vertices = self.dependency_weights.shape[1]
 *         outside = np.array([x for x in range(num_vertices) if x not in cycle])
 *         cycle = np.array(list(cycle))             # <<<<<<<<<<<<<<
 * 
 *         cdef np.ndarray[FLOAT_t, ndim=2] outgoing_weights
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PySequence_List(__pyx_v_cycle); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_11 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_11 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 371, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF_SET(__pyx_v_cycle, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":379
 * 
 *         # if len(outside) == 1, it means all vertices except for the root are in a cycle
 *         if len(outside) > 1:             # <<<<<<<<<<<<<<
 *             # weird index array we need in order to properly use fancy indexing
 *             # -1 because we can't take the root now
*/
  __pyx_t_12 = PyObject_Length(__pyx_v_outside); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(5, 379, __pyx_L1_error)
  __pyx_t_10 = (__pyx_t_12 > 1);
  if (__pyx_t_10) {

    /* "nltkor/tag/libs/networkdependencyconv.pyx":382
 *             # weird index array we need in order to properly use fancy indexing
 *             # -1 because we can't take the root now
 *             outside_inds = np.array([[i] for i in outside[:-1]])             # <<<<<<<<<<<<<<
 *             outgoing_weights = self.dependency_weights[outside_inds, cycle]
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    { /* enter inner scope */
      __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 382, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_9 = __Pyx_PyObject_GetSlice(__pyx_v_outside, 0, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 382, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) {
        __pyx_t_13 = __pyx_t_9; __Pyx_INCREF(__pyx_t_13);
        __pyx_t_12 = 0;
        __pyx_t_14 = NULL;
      } else {
        __pyx_t_12 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 382, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(5, 382, __pyx_L9_error)
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      for (;;) {
        if (likely(!__pyx_t_14)) {
          if (likely(PyList_CheckExact(__pyx_t_13))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_13);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 382, __pyx_L9_error)
              #endif
              if (__pyx_t_12 >= __pyx_temp) break;
            }
            __pyx_t_9 = __Pyx_PyList_GetItemRef(__pyx_t_13, __pyx_t_12);
            ++__pyx_t_12;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_13);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 382, __pyx_L9_error)
              #endif
              if (__pyx_t_12 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_9 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_12));
            #else
            __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_13, __pyx_t_12);
            #endif
            ++__pyx_t_12;
          }
          if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 382, __pyx_L9_error)
        } else {
          __pyx_t_9 = __pyx_t_14(__pyx_t_13);
          if (unlikely(!__pyx_t_9)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(5, 382, __pyx_L9_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_XDECREF_SET(__pyx_9genexpr11__pyx_v_i, __pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 382, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_INCREF(__pyx_9genexpr11__pyx_v_i);
        __Pyx_GIVEREF(__pyx_9genexpr11__pyx_v_i);
        if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 0, __pyx_9genexpr11__pyx_v_i) != (0)) __PYX_ERR(5, 382, __pyx_L9_error);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_9))) __PYX_ERR(5, 382, __pyx_L9_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_i); __pyx_9genexpr11__pyx_v_i = 0;
      goto __pyx_L13_exit_scope;
      __pyx_L9_error:;
      __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_i); __pyx_9genexpr11__pyx_v_i = 0;
      goto __pyx_L1_error;
      __pyx_L13_exit_scope:;
    } /* exit inner scope */
    __pyx_t_11 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_11 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_v_outside_inds = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":383
 *             # -1 because we can't take the root now
 *             outside_inds = np.array([[i] for i in outside[:-1]])
 *             outgoing_weights = self.dependency_weights[outside_inds, cycle]             # <<<<<<<<<<<<<<
 * 
 *             # the cycle should have only one outgoing edge for each vertex outside it
*/
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_outside_inds);
    __Pyx_GIVEREF(__pyx_v_outside_inds);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_outside_inds) != (0)) __PYX_ERR(5, 383, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_cycle);
    __Pyx_GIVEREF(__pyx_v_cycle);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_cycle) != (0)) __PYX_ERR(5, 383, __pyx_L1_error);
    __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->dependency_weights), __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 383, __pyx_L1_error)
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outgoing_weights.rcbuffer->pybuffer);
      __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outgoing_weights.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_5), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_15 < 0)) {
        PyErr_Fetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outgoing_weights.rcbuffer->pybuffer, (PyObject*)__pyx_v_outgoing_weights, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_18);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
        }
        __pyx_t_16 = __pyx_t_17 = __pyx_t_18 = 0;
      }
      __pyx_pybuffernd_outgoing_weights.diminfo[0].strides = __pyx_pybuffernd_outgoing_weights.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outgoing_weights.diminfo[0].shape = __pyx_pybuffernd_outgoing_weights.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_outgoing_weights.diminfo[1].strides = __pyx_pybuffernd_outgoing_weights.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_outgoing_weights.diminfo[1].shape = __pyx_pybuffernd_outgoing_weights.rcbuffer->pybuffer.shape[1];
      if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(5, 383, __pyx_L1_error)
    }
    __pyx_v_outgoing_weights = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":387
 *             # the cycle should have only one outgoing edge for each vertex outside it
 *             # so, search the maximum outgoing edge to each outside vertex
 *             max_outgoing_inds = outgoing_weights.argmax(1)             # <<<<<<<<<<<<<<
 *             max_outgoing_weights = outgoing_weights.max(1)
 * 
*/
    __pyx_t_1 = ((PyObject *)__pyx_v_outgoing_weights);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_11 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_int_1};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_argmax, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 387, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_v_max_outgoing_inds = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":388
 *             # so, search the maximum outgoing edge to each outside vertex
 *             max_outgoing_inds = outgoing_weights.argmax(1)
 *             max_outgoing_weights = outgoing_weights.max(1)             # <<<<<<<<<<<<<<
 * 
 *             # set every outgoing weight to -inf and then restore the highest ones
*/
    __pyx_t_1 = ((PyObject *)__pyx_v_outgoing_weights);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_11 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_int_1};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_max, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 388, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_v_max_outgoing_weights = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":391
 * 
 *             # set every outgoing weight to -inf and then restore the highest ones
 *             outgoing_weights[:] = -np.Infinity             # <<<<<<<<<<<<<<
 *             outgoing_weights[np.arange(len(outside_inds)),
 *                              max_outgoing_inds] = max_outgoing_weights
*/
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 391, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Infinity); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 391, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Negative(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 391, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_outgoing_weights), __pyx_mstate_global->__pyx_slice[0], __pyx_t_5) < 0))) __PYX_ERR(5, 391, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":392
 *             # set every outgoing weight to -inf and then restore the highest ones
 *             outgoing_weights[:] = -np.Infinity
 *             outgoing_weights[np.arange(len(outside_inds)),             # <<<<<<<<<<<<<<
 *                              max_outgoing_inds] = max_outgoing_weights
 *             self.dependency_weights[outside_inds, cycle] = outgoing_weights
*/
    __pyx_t_1 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 392, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_arange); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 392, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_12 = PyObject_Length(__pyx_v_outside_inds); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(5, 392, __pyx_L1_error)
    __pyx_t_4 = PyLong_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 392, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_11 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_11 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_4};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 392, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }

    /* "nltkor/tag/libs/networkdependencyconv.pyx":393
 *             outgoing_weights[:] = -np.Infinity
 *             outgoing_weights[np.arange(len(outside_inds)),
 *                              max_outgoing_inds] = max_outgoing_weights             # <<<<<<<<<<<<<<
 *             self.dependency_weights[outside_inds, cycle] = outgoing_weights
 * 
*/
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 392, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5) != (0)) __PYX_ERR(5, 392, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_max_outgoing_inds);
    __Pyx_GIVEREF(__pyx_v_max_outgoing_inds);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_max_outgoing_inds) != (0)) __PYX_ERR(5, 392, __pyx_L1_error);
    __pyx_t_5 = 0;
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_outgoing_weights), __pyx_t_3, __pyx_v_max_outgoing_weights) < 0))) __PYX_ERR(5, 392, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":394
 *             outgoing_weights[np.arange(len(outside_inds)),
 *                              max_outgoing_inds] = max_outgoing_weights
 *             self.dependency_weights[outside_inds, cycle] = outgoing_weights             # <<<<<<<<<<<<<<
 * 
 *         # now, adjust incoming edges. the incoming edge from each vertex v
*/
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 394, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_outside_inds);
    __Pyx_GIVEREF(__pyx_v_outside_inds);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_outside_inds) != (0)) __PYX_ERR(5, 394, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_cycle);
    __Pyx_GIVEREF(__pyx_v_cycle);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_cycle) != (0)) __PYX_ERR(5, 394, __pyx_L1_error);
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->dependency_weights), __pyx_t_3, ((PyObject *)__pyx_v_outgoing_weights)) < 0))) __PYX_ERR(5, 394, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":379
 * 
 *         # if len(outside) == 1, it means all vertices except for the root are in a cycle
 *         if len(outside) > 1:             # <<<<<<<<<<<<<<
 *             # weird index array we need in order to properly use fancy indexing
 *             # -1 because we can't take the root now
*/
  }

  /* "nltkor/tag/libs/networkdependencyconv.pyx":401
 *         # and then we pick the highest edge for each outside vertex
 *         # s(c) = sum_v s(head(v), v)
 *         cycle_inds = np.array([[i] for i in cycle])             # <<<<<<<<<<<<<<
 *         cdef np.ndarray[FLOAT_t, ndim=2] incoming_weights
 *         incoming_weights = self.dependency_weights[cycle_inds, outside]
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  { /* enter inner scope */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 401, __pyx_L16_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (likely(PyList_CheckExact(__pyx_v_cycle)) || PyTuple_CheckExact(__pyx_v_cycle)) {
      __pyx_t_13 = __pyx_v_cycle; __Pyx_INCREF(__pyx_t_13);
      __pyx_t_12 = 0;
      __pyx_t_14 = NULL;
    } else {
      __pyx_t_12 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_v_cycle); if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 401, __pyx_L16_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(5, 401, __pyx_L16_error)
    }
    for (;;) {
      if (likely(!__pyx_t_14)) {
        if (likely(PyList_CheckExact(__pyx_t_13))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_13);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 401, __pyx_L16_error)
            #endif
            if (__pyx_t_12 >= __pyx_temp) break;
          }
          __pyx_t_9 = __Pyx_PyList_GetItemRef(__pyx_t_13, __pyx_t_12);
          ++__pyx_t_12;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_13);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 401, __pyx_L16_error)
            #endif
            if (__pyx_t_12 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_9 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_12));
          #else
          __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_13, __pyx_t_12);
          #endif
          ++__pyx_t_12;
        }
        if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 401, __pyx_L16_error)
      } else {
        __pyx_t_9 = __pyx_t_14(__pyx_t_13);
        if (unlikely(!__pyx_t_9)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(5, 401, __pyx_L16_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_XDECREF_SET(__pyx_9genexpr12__pyx_v_i, __pyx_t_9);
      __pyx_t_9 = 0;
      __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 401, __pyx_L16_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_9genexpr12__pyx_v_i);
      __Pyx_GIVEREF(__pyx_9genexpr12__pyx_v_i);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 0, __pyx_9genexpr12__pyx_v_i) != (0)) __PYX_ERR(5, 401, __pyx_L16_error);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_9))) __PYX_ERR(5, 401, __pyx_L16_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_i); __pyx_9genexpr12__pyx_v_i = 0;
    goto __pyx_L20_exit_scope;
    __pyx_L16_error:;
    __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_i); __pyx_9genexpr12__pyx_v_i = 0;
    goto __pyx_L1_error;
    __pyx_L20_exit_scope:;
  } /* exit inner scope */
  __pyx_t_11 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
    __pyx_t_11 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 401, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_cycle_inds = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":403
 *         cycle_inds = np.array([[i] for i in cycle])
 *         cdef np.ndarray[FLOAT_t, ndim=2] incoming_weights
 *         incoming_weights = self.dependency_weights[cycle_inds, outside]             # <<<<<<<<<<<<<<
 * 
 *         cycle_score = 0
*/
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_cycle_inds);
  __Pyx_GIVEREF(__pyx_v_cycle_inds);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_cycle_inds) != (0)) __PYX_ERR(5, 403, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_outside);
  __Pyx_GIVEREF(__pyx_v_outside);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_outside) != (0)) __PYX_ERR(5, 403, __pyx_L1_error);
  __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->dependency_weights), __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 403, __pyx_L1_error)
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_incoming_weights.rcbuffer->pybuffer);
    __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_incoming_weights.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_15 < 0)) {
      PyErr_Fetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_incoming_weights.rcbuffer->pybuffer, (PyObject*)__pyx_v_incoming_weights, &__Pyx_TypeInfo_nn___pyx_t_6nltkor_3tag_4libs_7network_FLOAT_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_18, __pyx_t_17, __pyx_t_16);
      }
      __pyx_t_18 = __pyx_t_17 = __pyx_t_16 = 0;
    }
    __pyx_pybuffernd_incoming_weights.diminfo[0].strides = __pyx_pybuffernd_incoming_weights.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_incoming_weights.diminfo[0].shape = __pyx_pybuffernd_incoming_weights.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_incoming_weights.diminfo[1].strides = __pyx_pybuffernd_incoming_weights.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_incoming_weights.diminfo[1].shape = __pyx_pybuffernd_incoming_weights.rcbuffer->pybuffer.shape[1];
    if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(5, 403, __pyx_L1_error)
  }
  __pyx_v_incoming_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":405
 *         incoming_weights = self.dependency_weights[cycle_inds, outside]
 * 
 *         cycle_score = 0             # <<<<<<<<<<<<<<
 *         for i, vertex in enumerate(cycle):
 *             head_to_v = self.dependency_weights[vertex, heads[vertex]]
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_v_cycle_score = __pyx_mstate_global->__pyx_int_0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":406
 * 
 *         cycle_score = 0
 *         for i, vertex in enumerate(cycle):             # <<<<<<<<<<<<<<
 *             head_to_v = self.dependency_weights[vertex, heads[vertex]]
 *             cycle_score += head_to_v
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_t_1 = __pyx_mstate_global->__pyx_int_0;
  if (likely(PyList_CheckExact(__pyx_v_cycle)) || PyTuple_CheckExact(__pyx_v_cycle)) {
    __pyx_t_3 = __pyx_v_cycle; __Pyx_INCREF(__pyx_t_3);
    __pyx_t_12 = 0;
    __pyx_t_14 = NULL;
  } else {
    __pyx_t_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_cycle); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 406, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(5, 406, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_14)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 406, __pyx_L1_error)
          #endif
          if (__pyx_t_12 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_12);
        ++__pyx_t_12;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 406, __pyx_L1_error)
          #endif
          if (__pyx_t_12 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_12));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_12);
        #endif
        ++__pyx_t_12;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 406, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_14(__pyx_t_3);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(5, 406, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_vertex, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_4 = __Pyx_PyLong_AddObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 406, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":407
 *         cycle_score = 0
 *         for i, vertex in enumerate(cycle):
 *             head_to_v = self.dependency_weights[vertex, heads[vertex]]             # <<<<<<<<<<<<<<
 *             cycle_score += head_to_v
 *             incoming_weights[i] -= head_to_v
*/
    __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_heads, __pyx_v_vertex); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_vertex);
    __Pyx_GIVEREF(__pyx_v_vertex);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_vertex) != (0)) __PYX_ERR(5, 407, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4) != (0)) __PYX_ERR(5, 407, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->dependency_weights), __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_head_to_v, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":408
 *         for i, vertex in enumerate(cycle):
 *             head_to_v = self.dependency_weights[vertex, heads[vertex]]
 *             cycle_score += head_to_v             # <<<<<<<<<<<<<<
 *             incoming_weights[i] -= head_to_v
 * 
*/
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_cycle_score, __pyx_v_head_to_v); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_cycle_score, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":409
 *             head_to_v = self.dependency_weights[vertex, heads[vertex]]
 *             cycle_score += head_to_v
 *             incoming_weights[i] -= head_to_v             # <<<<<<<<<<<<<<
 * 
 *         max_incoming_inds = incoming_weights.argmax(0)
*/
    __Pyx_INCREF(__pyx_v_i);
    __pyx_t_4 = __pyx_v_i;
    __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_incoming_weights), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 409, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_13 = PyNumber_InPlaceSubtract(__pyx_t_5, __pyx_v_head_to_v); if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 409, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_incoming_weights), __pyx_t_4, __pyx_t_13) < 0))) __PYX_ERR(5, 409, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":406
 * 
 *         cycle_score = 0
 *         for i, vertex in enumerate(cycle):             # <<<<<<<<<<<<<<
 *             head_to_v = self.dependency_weights[vertex, heads[vertex]]
 *             cycle_score += head_to_v
*/
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":411
 *             incoming_weights[i] -= head_to_v
 * 
 *         max_incoming_inds = incoming_weights.argmax(0)             # <<<<<<<<<<<<<<
 *         max_incoming_weights = incoming_weights.max(0)
 *         # we leave the + s(c) to the end
*/
  __pyx_t_3 = ((PyObject *)__pyx_v_incoming_weights);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_11 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_int_0};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_argmax, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 411, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_max_incoming_inds = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":412
 * 
 *         max_incoming_inds = incoming_weights.argmax(0)
 *         max_incoming_weights = incoming_weights.max(0)             # <<<<<<<<<<<<<<
 *         # we leave the + s(c) to the end
 *         max_incoming_weights += cycle_score
*/
  __pyx_t_3 = ((PyObject *)__pyx_v_incoming_weights);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_11 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_int_0};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_max, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 412, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_max_incoming_weights = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":414
 *         max_incoming_weights = incoming_weights.max(0)
 *         # we leave the + s(c) to the end
 *         max_incoming_weights += cycle_score             # <<<<<<<<<<<<<<
 * 
 *         # the vertex with the maximum weighted incoming edge now changes
*/
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_max_incoming_weights, __pyx_v_cycle_score); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_max_incoming_weights, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":418
 *         # the vertex with the maximum weighted incoming edge now changes
 *         # its head, thus breaking the cycle
 *         new_head_ind = max_incoming_weights.argmax()             # <<<<<<<<<<<<<<
 *         vertex_leaving_cycle_ind = max_incoming_inds[new_head_ind]
 * 
*/
  __pyx_t_3 = __pyx_v_max_incoming_weights;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_11 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_argmax, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_new_head_ind = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":419
 *         # its head, thus breaking the cycle
 *         new_head_ind = max_incoming_weights.argmax()
 *         vertex_leaving_cycle_ind = max_incoming_inds[new_head_ind]             # <<<<<<<<<<<<<<
 * 
 *         new_head = outside[new_head_ind]
*/
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_max_incoming_inds, __pyx_v_new_head_ind); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_vertex_leaving_cycle_ind = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":421
 *         vertex_leaving_cycle_ind = max_incoming_inds[new_head_ind]
 * 
 *         new_head = outside[new_head_ind]             # <<<<<<<<<<<<<<
 *         vertex_leaving_cycle = cycle[vertex_leaving_cycle_ind]
 *         old_head = heads[vertex_leaving_cycle]
*/
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_outside, __pyx_v_new_head_ind); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_new_head = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":422
 * 
 *         new_head = outside[new_head_ind]
 *         vertex_leaving_cycle = cycle[vertex_leaving_cycle_ind]             # <<<<<<<<<<<<<<
 *         old_head = heads[vertex_leaving_cycle]
 *         heads[vertex_leaving_cycle] = new_head
*/
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_cycle, __pyx_v_vertex_leaving_cycle_ind); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_vertex_leaving_cycle = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":423
 *         new_head = outside[new_head_ind]
 *         vertex_leaving_cycle = cycle[vertex_leaving_cycle_ind]
 *         old_head = heads[vertex_leaving_cycle]             # <<<<<<<<<<<<<<
 *         heads[vertex_leaving_cycle] = new_head
 *         self.dependency_weights[vertex_leaving_cycle, old_head] = -np.Infinity
*/
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_heads, __pyx_v_vertex_leaving_cycle); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_old_head = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":424
 *         vertex_leaving_cycle = cycle[vertex_leaving_cycle_ind]
 *         old_head = heads[vertex_leaving_cycle]
 *         heads[vertex_leaving_cycle] = new_head             # <<<<<<<<<<<<<<
 *         self.dependency_weights[vertex_leaving_cycle, old_head] = -np.Infinity
 * 
*/
  if (unlikely((PyObject_SetItem(__pyx_v_heads, __pyx_v_vertex_leaving_cycle, __pyx_v_new_head) < 0))) __PYX_ERR(5, 424, __pyx_L1_error)

  /* "nltkor/tag/libs/networkdependencyconv.pyx":425
 *         old_head = heads[vertex_leaving_cycle]
 *         heads[vertex_leaving_cycle] = new_head
 *         self.dependency_weights[vertex_leaving_cycle, old_head] = -np.Infinity             # <<<<<<<<<<<<<<
 * 
 *         # analagous to the outgoing weights
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Infinity); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Negative(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_vertex_leaving_cycle);
  __Pyx_GIVEREF(__pyx_v_vertex_leaving_cycle);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_vertex_leaving_cycle) != (0)) __PYX_ERR(5, 425, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_old_head);
  __Pyx_GIVEREF(__pyx_v_old_head);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_old_head) != (0)) __PYX_ERR(5, 425, __pyx_L1_error);
  if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->dependency_weights), __pyx_t_3, __pyx_t_1) < 0))) __PYX_ERR(5, 425, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":428
 * 
 *         # analagous to the outgoing weights
 *         incoming_weights[:] = -np.Infinity             # <<<<<<<<<<<<<<
 *         incoming_weights[max_incoming_inds,
 *                          np.arange(len(outside))] = max_incoming_weights
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Infinity); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Negative(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_incoming_weights), __pyx_mstate_global->__pyx_slice[0], __pyx_t_1) < 0))) __PYX_ERR(5, 428, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":430
 *         incoming_weights[:] = -np.Infinity
 *         incoming_weights[max_incoming_inds,
 *                          np.arange(len(outside))] = max_incoming_weights             # <<<<<<<<<<<<<<
 *         self.dependency_weights[cycle_inds, outside] = incoming_weights
 * 
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_arange); if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_12 = PyObject_Length(__pyx_v_outside); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(5, 430, __pyx_L1_error)
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_11 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_13))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_13);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
    __pyx_t_11 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }

  /* "nltkor/tag/libs/networkdependencyconv.pyx":429
 *         # analagous to the outgoing weights
 *         incoming_weights[:] = -np.Infinity
 *         incoming_weights[max_incoming_inds,             # <<<<<<<<<<<<<<
 *                          np.arange(len(outside))] = max_incoming_weights
 *         self.dependency_weights[cycle_inds, outside] = incoming_weights
*/
  __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_INCREF(__pyx_v_max_incoming_inds);
  __Pyx_GIVEREF(__pyx_v_max_incoming_inds);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_max_incoming_inds) != (0)) __PYX_ERR(5, 429, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_1) != (0)) __PYX_ERR(5, 429, __pyx_L1_error);
  __pyx_t_1 = 0;
  if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_incoming_weights), __pyx_t_13, __pyx_v_max_incoming_weights) < 0))) __PYX_ERR(5, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":431
 *         incoming_weights[max_incoming_inds,
 *                          np.arange(len(outside))] = max_incoming_weights
 *         self.dependency_weights[cycle_inds, outside] = incoming_weights             # <<<<<<<<<<<<<<
 * 
 *     def _find_maximum_spanning_tree(self):
*/
  __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_INCREF(__pyx_v_cycle_inds);
  __Pyx_GIVEREF(__pyx_v_cycle_inds);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_cycle_inds) != (0)) __PYX_ERR(5, 431, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_outside);
  __Pyx_GIVEREF(__pyx_v_outside);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_v_outside) != (0)) __PYX_ERR(5, 431, __pyx_L1_error);
  if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->dependency_weights), __pyx_t_13, ((PyObject *)__pyx_v_incoming_weights)) < 0))) __PYX_ERR(5, 431, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":358
 *         return cycle
 * 
 *     def _contract_cycle(self, heads, cycle):             # <<<<<<<<<<<<<<
 *         """
 *         Contract the given cycle in the dependency graph.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(5, 358, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_13);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_incoming_weights.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outgoing_weights.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(5, 358, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._contract_cycle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_incoming_weights.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outgoing_weights.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_outside);
  __Pyx_XDECREF((PyObject *)__pyx_v_outgoing_weights);
  __Pyx_XDECREF(__pyx_v_outside_inds);
  __Pyx_XDECREF(__pyx_v_max_outgoing_inds);
  __Pyx_XDECREF(__pyx_v_max_outgoing_weights);
  __Pyx_XDECREF(__pyx_v_cycle_inds);
  __Pyx_XDECREF((PyObject *)__pyx_v_incoming_weights);
  __Pyx_XDECREF(__pyx_v_cycle_score);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_vertex);
  __Pyx_XDECREF(__pyx_v_head_to_v);
  __Pyx_XDECREF(__pyx_v_max_incoming_inds);
  __Pyx_XDECREF(__pyx_v_max_incoming_weights);
  __Pyx_XDECREF(__pyx_v_new_head_ind);
  __Pyx_XDECREF(__pyx_v_vertex_leaving_cycle_ind);
  __Pyx_XDECREF(__pyx_v_new_head);
  __Pyx_XDECREF(__pyx_v_vertex_leaving_cycle);
  __Pyx_XDECREF(__pyx_v_old_head);
  __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_i);
  __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_cycle);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":433
 *         self.dependency_weights[cycle_inds, outside] = incoming_weights
 * 
 *     def _find_maximum_spanning_tree(self):             # <<<<<<<<<<<<<<
 *         """
 *         Run the Chu-Liu / Edmond's algorithm in order to find the highest
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_31_find_maximum_spanning_tree(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_30_find_maximum_spanning_tree, "ConvolutionalDependencyNetwork._find_maximum_spanning_tree(self)\nRun the Chu-Liu / Edmond's algorithm in order to find the highest\nscoring dependency tree from the dependency graph weights.\n\n:returns: a 1-dim array with the head of each token in the sentence");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_31_find_maximum_spanning_tree = {"_find_maximum_spanning_tree", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_31_find_maximum_spanning_tree, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_30_find_maximum_spanning_tree};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_31_find_maximum_spanning_tree(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_find_maximum_spanning_tree (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_find_maximum_spanning_tree", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_find_maximum_spanning_tree", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_30_find_maximum_spanning_tree(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_30_find_maximum_spanning_tree(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self) {
  PyObject *__pyx_v_heads = NULL;
  PyObject *__pyx_v_cycles = NULL;
  PyObject *__pyx_v_cycle = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[151]))
  __Pyx_RefNannySetupContext("_find_maximum_spanning_tree", 0);
  __Pyx_TraceStartFunc("_find_maximum_spanning_tree", __pyx_f[5], 433, 0, 0, 0, __PYX_ERR(5, 433, __pyx_L1_error));

  /* "nltkor/tag/libs/networkdependencyconv.pyx":441
 *         """
 *         # pick the highest scoring dependency for each word
 *         heads = self.dependency_weights.argmax(1)             # <<<<<<<<<<<<<<
 * 
 *         # check if there are cycles. if there isn't any, we're done
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self->dependency_weights);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_int_1};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_argmax, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 441, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_heads = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":444
 * 
 *         # check if there are cycles. if there isn't any, we're done
 *         cycles = self._find_cycles(heads)             # <<<<<<<<<<<<<<
 * 
 *         for cycle in cycles:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_heads};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_find_cycles, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_cycles = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":446
 *         cycles = self._find_cycles(heads)
 * 
 *         for cycle in cycles:             # <<<<<<<<<<<<<<
 *             # resolve each cycle c
 *             self._contract_cycle(heads, cycle)
*/
  if (likely(PyList_CheckExact(__pyx_v_cycles)) || PyTuple_CheckExact(__pyx_v_cycles)) {
    __pyx_t_1 = __pyx_v_cycles; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_cycles); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 446, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 446, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4);
        ++__pyx_t_4;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 446, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4));
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4);
        #endif
        ++__pyx_t_4;
      }
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 446, __pyx_L1_error)
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(5, 446, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_cycle, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":448
 *         for cycle in cycles:
 *             # resolve each cycle c
 *             self._contract_cycle(heads, cycle)             # <<<<<<<<<<<<<<
 * 
 *         return heads
*/
    __pyx_t_6 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_heads, __pyx_v_cycle};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_contract_cycle, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 448, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "nltkor/tag/libs/networkdependencyconv.pyx":446
 *         cycles = self._find_cycles(heads)
 * 
 *         for cycle in cycles:             # <<<<<<<<<<<<<<
 *             # resolve each cycle c
 *             self._contract_cycle(heads, cycle)
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":450
 *             self._contract_cycle(heads, cycle)
 * 
 *         return heads             # <<<<<<<<<<<<<<
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_heads);
  __pyx_r = __pyx_v_heads;
  __Pyx_TraceReturnValue(__pyx_r, 20, 0, __PYX_ERR(5, 450, __pyx_L1_error));
  goto __pyx_L0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":433
 *         self.dependency_weights[cycle_inds, outside] = incoming_weights
 * 
 *     def _find_maximum_spanning_tree(self):             # <<<<<<<<<<<<<<
 *         """
 *         Run the Chu-Liu / Edmond's algorithm in order to find the highest
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(5, 433, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork._find_maximum_spanning_tree", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_heads);
  __Pyx_XDECREF(__pyx_v_cycles);
  __Pyx_XDECREF(__pyx_v_cycle);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "nltkor/tag/libs/networkdependencyconv.pyx":14
 * 
 *     # the weights of all possible dependency among tokens
 *     cdef readonly np.ndarray dependency_weights             # <<<<<<<<<<<<<<
 * 
 *     # validation data
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_18dependency_weights_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_18dependency_weights_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_18dependency_weights___get__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_18dependency_weights___get__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[152]))
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceStartFunc("__get__", __pyx_f[5], 14, 0, 0, 0, __PYX_ERR(5, 14, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->dependency_weights);
  __pyx_r = ((PyObject *)__pyx_v_self->dependency_weights);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(5, 14, __pyx_L1_error));
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(5, 14, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork.dependency_weights.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_33__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_32__reduce_cython__, "ConvolutionalDependencyNetwork.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_33__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_33__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_32__reduce_cython__};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_33__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_32__reduce_cython__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_32__reduce_cython__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  int __pyx_t_24;
  int __pyx_t_25;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[153]))
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
  __Pyx_TraceStartFunc("__reduce_cython__", __pyx_f[4], 1, 0, 0, 0, __PYX_ERR(4, 1, __pyx_L1_error));

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.accuracy, self.answer_score, self.convolution_lookup, self.decay_factor, self.dependency_weights, self.error, self.feature_tables, self.features_per_token, self.float_errors, self.half_window, self.hidden2_before_activation, self.hidden2_bias, self.hidden2_gradients, self.hidden2_size, self.hidden2_values, self.hidden2_weights, self.hidden_before_activation, self.hidden_bias, self.hidden_gradients, self.hidden_sent_values, self.hidden_size, self.hidden_values, self.hidden_weights, self.input_deltas, self.input_sent_values, self.input_size, self.input_values, self.layer2_sent_values, self.layer2_values, self.learning_rate, self.learning_rate_features, self.learning_rate_trans, self.max_indices, self.net_gradients, self.network_filename, self.network_text_filename, self.num_sentences, self.num_targets, self.num_tokens, self.only_classify, self.output_bias, self.output_size, self.output_weights, self.padding_left, self.padding_right, self.pos_padding, self.pre_padding, self.pred_convolution_lookup, self.pred_dist_deltas, self.pred_dist_lookup, self.pred_dist_offset, self.pred_dist_table, self.pred_dist_weights, self.sentence_accuracy, self.sentence_lookup, self.skips, self.target_convolution_lookup, self.target_dist_deltas, self.target_dist_lookup, self.target_dist_offset, self.target_dist_table, self.target_dist_weights, self.trans_gradients, self.transitions, self.use_learning_rate_decay, self.validation_arguments, self.validation_heads, self.validation_predicates, self.validation_sentences, self.validation_tags, self.word_window_size)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
*/
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.accuracy); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.answer_score); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.decay_factor); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.error); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.__pyx_base.features_per_token); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.float_errors); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.half_window); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.hidden2_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.__pyx_base.hidden_size); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.__pyx_base.input_size); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.learning_rate); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.learning_rate_features); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.learning_rate_trans); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.num_sentences); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_15 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.num_targets); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_16 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.__pyx_base.num_tokens); if (unlikely(!__pyx_t_16)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_17 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.__pyx_base.output_size); if (unlikely(!__pyx_t_17)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_18 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.pred_dist_offset); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.sentence_accuracy); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_20 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.__pyx_base.skips); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_21 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.target_dist_offset); if (unlikely(!__pyx_t_21)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_21);
  __pyx_t_22 = __Pyx_PyLong_From_int(__pyx_v_self->__pyx_base.__pyx_base.word_window_size); if (unlikely(!__pyx_t_22)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_22);
  __pyx_t_23 = PyTuple_New(71); if (unlikely(!__pyx_t_23)) __PYX_ERR(4, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_23);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_1) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_t_2) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.convolution_lookup);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.convolution_lookup);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 2, ((PyObject *)__pyx_v_self->__pyx_base.convolution_lookup)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 3, __pyx_t_3) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->dependency_weights);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->dependency_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 4, ((PyObject *)__pyx_v_self->dependency_weights)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 5, __pyx_t_4) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base.feature_tables);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.__pyx_base.feature_tables);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 6, __pyx_v_self->__pyx_base.__pyx_base.feature_tables) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 7, __pyx_t_5) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 8, __pyx_t_6) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 9, __pyx_t_7) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.hidden2_before_activation);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.hidden2_before_activation);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 10, ((PyObject *)__pyx_v_self->__pyx_base.hidden2_before_activation)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.hidden2_bias);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.hidden2_bias);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 11, ((PyObject *)__pyx_v_self->__pyx_base.hidden2_bias)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.hidden2_gradients);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.hidden2_gradients);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 12, ((PyObject *)__pyx_v_self->__pyx_base.hidden2_gradients)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 13, __pyx_t_8) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.hidden2_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.hidden2_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 14, ((PyObject *)__pyx_v_self->__pyx_base.hidden2_values)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.hidden2_weights);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.hidden2_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 15, ((PyObject *)__pyx_v_self->__pyx_base.hidden2_weights)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.hidden_before_activation);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.hidden_before_activation);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 16, ((PyObject *)__pyx_v_self->__pyx_base.hidden_before_activation)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.hidden_bias);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.hidden_bias);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 17, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.hidden_bias)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.hidden_gradients);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.hidden_gradients);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 18, ((PyObject *)__pyx_v_self->__pyx_base.hidden_gradients)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.hidden_sent_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.hidden_sent_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 19, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.hidden_sent_values)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_9);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 20, __pyx_t_9) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.hidden_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.hidden_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 21, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.hidden_values)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.hidden_weights);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.hidden_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 22, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.hidden_weights)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.input_deltas);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.input_deltas);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 23, ((PyObject *)__pyx_v_self->__pyx_base.input_deltas)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.input_sent_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.input_sent_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 24, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.input_sent_values)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_10);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 25, __pyx_t_10) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.input_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.input_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 26, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.input_values)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.layer2_sent_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.layer2_sent_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 27, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.layer2_sent_values)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.layer2_values);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.layer2_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 28, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.layer2_values)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_11);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 29, __pyx_t_11) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_12);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 30, __pyx_t_12) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_13);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 31, __pyx_t_13) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.max_indices);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.max_indices);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 32, ((PyObject *)__pyx_v_self->__pyx_base.max_indices)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.net_gradients);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.net_gradients);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 33, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.net_gradients)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base.network_filename);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.__pyx_base.network_filename);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 34, __pyx_v_self->__pyx_base.__pyx_base.network_filename) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base.network_text_filename);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.__pyx_base.network_text_filename);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 35, __pyx_v_self->__pyx_base.__pyx_base.network_text_filename) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_14);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 36, __pyx_t_14) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_15);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 37, __pyx_t_15) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_16);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 38, __pyx_t_16) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.only_classify);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.only_classify);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 39, ((PyObject *)__pyx_v_self->__pyx_base.only_classify)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.output_bias);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.output_bias);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 40, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.output_bias)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_17);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 41, __pyx_t_17) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.output_weights);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.output_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 42, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.output_weights)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.padding_left);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.padding_left);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 43, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.padding_left)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.padding_right);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.padding_right);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 44, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.padding_right)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.pos_padding);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.pos_padding);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 45, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.pos_padding)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.pre_padding);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.pre_padding);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 46, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.pre_padding)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.pred_convolution_lookup);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.pred_convolution_lookup);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 47, ((PyObject *)__pyx_v_self->__pyx_base.pred_convolution_lookup)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.pred_dist_deltas);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.pred_dist_deltas);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 48, ((PyObject *)__pyx_v_self->__pyx_base.pred_dist_deltas)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.pred_dist_lookup);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.pred_dist_lookup);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 49, ((PyObject *)__pyx_v_self->__pyx_base.pred_dist_lookup)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_18);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 50, __pyx_t_18) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.pred_dist_table);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.pred_dist_table);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 51, ((PyObject *)__pyx_v_self->__pyx_base.pred_dist_table)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.pred_dist_weights);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.pred_dist_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 52, ((PyObject *)__pyx_v_self->__pyx_base.pred_dist_weights)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_19);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 53, __pyx_t_19) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.sentence_lookup);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.sentence_lookup);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 54, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.sentence_lookup)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_20);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 55, __pyx_t_20) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.target_convolution_lookup);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.target_convolution_lookup);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 56, ((PyObject *)__pyx_v_self->__pyx_base.target_convolution_lookup)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.target_dist_deltas);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.target_dist_deltas);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 57, ((PyObject *)__pyx_v_self->__pyx_base.target_dist_deltas)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.target_dist_lookup);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.target_dist_lookup);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 58, ((PyObject *)__pyx_v_self->__pyx_base.target_dist_lookup)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_21);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 59, __pyx_t_21) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.target_dist_table);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.target_dist_table);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 60, ((PyObject *)__pyx_v_self->__pyx_base.target_dist_table)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.target_dist_weights);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.target_dist_weights);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 61, ((PyObject *)__pyx_v_self->__pyx_base.target_dist_weights)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.trans_gradients);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.trans_gradients);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 62, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.trans_gradients)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.transitions);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.transitions);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 63, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.transitions)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.use_learning_rate_decay);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.use_learning_rate_decay);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 64, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.use_learning_rate_decay)) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.validation_arguments);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.validation_arguments);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 65, __pyx_v_self->__pyx_base.validation_arguments) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->validation_heads);
  __Pyx_GIVEREF(__pyx_v_self->validation_heads);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 66, __pyx_v_self->validation_heads) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.validation_predicates);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.validation_predicates);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 67, __pyx_v_self->__pyx_base.validation_predicates) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base.validation_sentences);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.__pyx_base.validation_sentences);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 68, __pyx_v_self->__pyx_base.__pyx_base.validation_sentences) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base.validation_tags);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.__pyx_base.validation_tags);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 69, __pyx_v_self->__pyx_base.__pyx_base.validation_tags) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_22);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 70, __pyx_t_22) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_9 = 0;
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;
  __pyx_t_13 = 0;
  __pyx_t_14 = 0;
  __pyx_t_15 = 0;
  __pyx_t_16 = 0;
  __pyx_t_17 = 0;
  __pyx_t_18 = 0;
  __pyx_t_19 = 0;
  __pyx_t_20 = 0;
  __pyx_t_21 = 0;
  __pyx_t_22 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_23);
  __pyx_t_23 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.accuracy, self.answer_score, self.convolution_lookup, self.decay_factor, self.dependency_weights, self.error, self.feature_tables, self.features_per_token, self.float_errors, self.half_window, self.hidden2_before_activation, self.hidden2_bias, self.hidden2_gradients, self.hidden2_size, self.hidden2_values, self.hidden2_weights, self.hidden_before_activation, self.hidden_bias, self.hidden_gradients, self.hidden_sent_values, self.hidden_size, self.hidden_values, self.hidden_weights, self.input_deltas, self.input_sent_values, self.input_size, self.input_values, self.layer2_sent_values, self.layer2_values, self.learning_rate, self.learning_rate_features, self.learning_rate_trans, self.max_indices, self.net_gradients, self.network_filename, self.network_text_filename, self.num_sentences, self.num_targets, self.num_tokens, self.only_classify, self.output_bias, self.output_size, self.output_weights, self.padding_left, self.padding_right, self.pos_padding, self.pre_padding, self.pred_convolution_lookup, self.pred_dist_deltas, self.pred_dist_lookup, self.pred_dist_offset, self.pred_dist_table, self.pred_dist_weights, self.sentence_accuracy, self.sentence_lookup, self.skips, self.target_convolution_lookup, self.target_dist_deltas, self.target_dist_lookup, self.target_dist_offset, self.target_dist_table, self.target_dist_weights, self.trans_gradients, self.transitions, self.use_learning_rate_decay, self.validation_arguments, self.validation_heads, self.validation_predicates, self.validation_sentences, self.validation_tags, self.word_window_size)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
*/
  __pyx_t_23 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_23)) __PYX_ERR(4, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_23);
  __pyx_v__dict = __pyx_t_23;
  __pyx_t_23 = 0;

  /* "(tree fragment)":7
 *     state = (self.accuracy, self.answer_score, self.convolution_lookup, self.decay_factor, self.dependency_weights, self.error, self.feature_tables, self.features_per_token, self.float_errors, self.half_window, self.hidden2_before_activation, self.hidden2_bias, self.hidden2_gradients, self.hidden2_size, self.hidden2_values, self.hidden2_weights, self.hidden_before_activation, self.hidden_bias, self.hidden_gradients, self.hidden_sent_values, self.hidden_size, self.hidden_values, self.hidden_weights, self.input_deltas, self.input_sent_values, self.input_size, self.input_values, self.layer2_sent_values, self.layer2_values, self.learning_rate, self.learning_rate_features, self.learning_rate_trans, self.max_indices, self.net_gradients, self.network_filename, self.network_text_filename, self.num_sentences, self.num_targets, self.num_tokens, self.only_classify, self.output_bias, self.output_size, self.output_weights, self.padding_left, self.padding_right, self.pos_padding, self.pre_padding, self.pred_convolution_lookup, self.pred_dist_deltas, self.pred_dist_lookup, self.pred_dist_offset, self.pred_dist_table, self.pred_dist_weights, self.sentence_accuracy, self.sentence_lookup, self.skips, self.target_convolution_lookup, self.target_dist_deltas, self.target_dist_lookup, self.target_dist_offset, self.target_dist_table, self.target_dist_weights, self.trans_gradients, self.transitions, self.use_learning_rate_decay, self.validation_arguments, self.validation_heads, self.validation_predicates, self.validation_sentences, self.validation_tags, self.word_window_size)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_24 = (__pyx_v__dict != Py_None);
  if (__pyx_t_24) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_23 = PyTuple_New(1); if (unlikely(!__pyx_t_23)) __PYX_ERR(4, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_23);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_v__dict) != (0)) __PYX_ERR(4, 8, __pyx_L1_error);
    __pyx_t_22 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_23); if (unlikely(!__pyx_t_22)) __PYX_ERR(4, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_22);
    __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_22));
    __pyx_t_22 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.convolution_lookup is not None or self.dependency_weights is not None or self.feature_tables is not None or self.hidden2_before_activation is not None or self.hidden2_bias is not None or self.hidden2_gradients is not None or self.hidden2_values is not None or self.hidden2_weights is not None or self.hidden_before_activation is not None or self.hidden_bias is not None or self.hidden_gradients is not None or self.hidden_sent_values is not None or self.hidden_values is not None or self.hidden_weights is not None or self.input_deltas is not None or self.input_sent_values is not None or self.input_values is not None or self.layer2_sent_values is not None or self.layer2_values is not None or self.max_indices is not None or self.net_gradients is not None or self.network_filename is not None or self.network_text_filename is not None or self.only_classify is not None or self.output_bias is not None or self.output_weights is not None or self.padding_left is not None or self.padding_right is not None or self.pos_padding is not None or self.pre_padding is not None or self.pred_convolution_lookup is not None or self.pred_dist_deltas is not None or self.pred_dist_lookup is not None or self.pred_dist_table is not None or self.pred_dist_weights is not None or self.sentence_lookup is not None or self.target_convolution_lookup is not None or self.target_dist_deltas is not None or self.target_dist_lookup is not None or self.target_dist_table is not None or self.target_dist_weights is not None or self.trans_gradients is not None or self.transitions is not None or self.use_learning_rate_decay is not None or self.validation_arguments is not None or self.validation_heads is not None or self.validation_predicates is not None or self.validation_sentences is not None or self.validation_tags is not None
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.accuracy, self.answer_score, self.convolution_lookup, self.decay_factor, self.dependency_weights, self.error, self.feature_tables, self.features_per_token, self.float_errors, self.half_window, self.hidden2_before_activation, self.hidden2_bias, self.hidden2_gradients, self.hidden2_size, self.hidden2_values, self.hidden2_weights, self.hidden_before_activation, self.hidden_bias, self.hidden_gradients, self.hidden_sent_values, self.hidden_size, self.hidden_values, self.hidden_weights, self.input_deltas, self.input_sent_values, self.input_size, self.input_values, self.layer2_sent_values, self.layer2_values, self.learning_rate, self.learning_rate_features, self.learning_rate_trans, self.max_indices, self.net_gradients, self.network_filename, self.network_text_filename, self.num_sentences, self.num_targets, self.num_tokens, self.only_classify, self.output_bias, self.output_size, self.output_weights, self.padding_left, self.padding_right, self.pos_padding, self.pre_padding, self.pred_convolution_lookup, self.pred_dist_deltas, self.pred_dist_lookup, self.pred_dist_offset, self.pred_dist_table, self.pred_dist_weights, self.sentence_accuracy, self.sentence_lookup, self.skips, self.target_convolution_lookup, self.target_dist_deltas, self.target_dist_lookup, self.target_dist_offset, self.target_dist_table, self.target_dist_weights, self.trans_gradients, self.transitions, self.use_learning_rate_decay, self.validation_arguments, self.validation_heads, self.validation_predicates, self.validation_sentences, self.validation_tags, self.word_window_size)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.convolution_lookup is not None or self.dependency_weights is not None or self.feature_tables is not None or self.hidden2_before_activation is not None or self.hidden2_bias is not None or self.hidden2_gradients is not None or self.hidden2_values is not None or self.hidden2_weights is not None or self.hidden_before_activation is not None or self.hidden_bias is not None or self.hidden_gradients is not None or self.hidden_sent_values is not None or self.hidden_values is not None or self.hidden_weights is not None or self.input_deltas is not None or self.input_sent_values is not None or self.input_values is not None or self.layer2_sent_values is not None or self.layer2_values is not None or self.max_indices is not None or self.net_gradients is not None or self.network_filename is not None or self.network_text_filename is not None or self.only_classify is not None or self.output_bias is not None or self.output_weights is not None or self.padding_left is not None or self.padding_right is not None or self.pos_padding is not None or self.pre_padding is not None or self.pred_convolution_lookup is not None or self.pred_dist_deltas is not None or self.pred_dist_lookup is not None or self.pred_dist_table is not None or self.pred_dist_weights is not None or self.sentence_lookup is not None or self.target_convolution_lookup is not None or self.target_dist_deltas is not None or self.target_dist_lookup is not None or self.target_dist_table is not None or self.target_dist_weights is not None or self.trans_gradients is not None or self.transitions is not None or self.use_learning_rate_decay is not None or self.validation_arguments is not None or self.validation_heads is not None or self.validation_predicates is not None or self.validation_sentences is not None or self.validation_tags is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_ConvolutionalDependencyNetwork, (type(self), 0xca52c1e, None), state
*/
  /*else*/ {
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.convolution_lookup) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->dependency_weights) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->__pyx_base.__pyx_base.feature_tables != ((PyObject*)Py_None));
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.hidden2_before_activation) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.hidden2_bias) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.hidden2_gradients) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.hidden2_values) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.hidden2_weights) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.hidden_before_activation) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.hidden_bias) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.hidden_gradients) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.hidden_sent_values) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.hidden_values) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.hidden_weights) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.input_deltas) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.input_sent_values) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.input_values) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.layer2_sent_values) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.layer2_values) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.max_indices) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.net_gradients) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->__pyx_base.__pyx_base.network_filename != ((PyObject*)Py_None));
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->__pyx_base.__pyx_base.network_text_filename != ((PyObject*)Py_None));
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.only_classify) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.output_bias) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.output_weights) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.padding_left) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.padding_right) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.pos_padding) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.pre_padding) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.pred_convolution_lookup) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.pred_dist_deltas) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.pred_dist_lookup) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.pred_dist_table) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.pred_dist_weights) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.sentence_lookup) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.target_convolution_lookup) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.target_dist_deltas) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.target_dist_lookup) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.target_dist_table) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.target_dist_weights) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.trans_gradients) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.transitions) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.use_learning_rate_decay) != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->__pyx_base.validation_arguments != ((PyObject*)Py_None));
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->validation_heads != Py_None);
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->__pyx_base.validation_predicates != ((PyObject*)Py_None));
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->__pyx_base.__pyx_base.validation_sentences != ((PyObject*)Py_None));
    if (!__pyx_t_25) {
    } else {
      __pyx_t_24 = __pyx_t_25;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_25 = (__pyx_v_self->__pyx_base.__pyx_base.validation_tags != ((PyObject*)Py_None));
    __pyx_t_24 = __pyx_t_25;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_24;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.convolution_lookup is not None or self.dependency_weights is not None or self.feature_tables is not None or self.hidden2_before_activation is not None or self.hidden2_bias is not None or self.hidden2_gradients is not None or self.hidden2_values is not None or self.hidden2_weights is not None or self.hidden_before_activation is not None or self.hidden_bias is not None or self.hidden_gradients is not None or self.hidden_sent_values is not None or self.hidden_values is not None or self.hidden_weights is not None or self.input_deltas is not None or self.input_sent_values is not None or self.input_values is not None or self.layer2_sent_values is not None or self.layer2_values is not None or self.max_indices is not None or self.net_gradients is not None or self.network_filename is not None or self.network_text_filename is not None or self.only_classify is not None or self.output_bias is not None or self.output_weights is not None or self.padding_left is not None or self.padding_right is not None or self.pos_padding is not None or self.pre_padding is not None or self.pred_convolution_lookup is not None or self.pred_dist_deltas is not None or self.pred_dist_lookup is not None or self.pred_dist_table is not None or self.pred_dist_weights is not None or self.sentence_lookup is not None or self.target_convolution_lookup is not None or self.target_dist_deltas is not None or self.target_dist_lookup is not None or self.target_dist_table is not None or self.target_dist_weights is not None or self.trans_gradients is not None or self.transitions is not None or self.use_learning_rate_decay is not None or self.validation_arguments is not None or self.validation_heads is not None or self.validation_predicates is not None or self.validation_sentences is not None or self.validation_tags is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_ConvolutionalDependencyNetwork, (type(self), 0xca52c1e, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = self.convolution_lookup is not None or self.dependency_weights is not None or self.feature_tables is not None or self.hidden2_before_activation is not None or self.hidden2_bias is not None or self.hidden2_gradients is not None or self.hidden2_values is not None or self.hidden2_weights is not None or self.hidden_before_activation is not None or self.hidden_bias is not None or self.hidden_gradients is not None or self.hidden_sent_values is not None or self.hidden_values is not None or self.hidden_weights is not None or self.input_deltas is not None or self.input_sent_values is not None or self.input_values is not None or self.layer2_sent_values is not None or self.layer2_values is not None or self.max_indices is not None or self.net_gradients is not None or self.network_filename is not None or self.network_text_filename is not None or self.only_classify is not None or self.output_bias is not None or self.output_weights is not None or self.padding_left is not None or self.padding_right is not None or self.pos_padding is not None or self.pre_padding is not None or self.pred_convolution_lookup is not None or self.pred_dist_deltas is not None or self.pred_dist_lookup is not None or self.pred_dist_table is not None or self.pred_dist_weights is not None or self.sentence_lookup is not None or self.target_convolution_lookup is not None or self.target_dist_deltas is not None or self.target_dist_lookup is not None or self.target_dist_table is not None or self.target_dist_weights is not None or self.trans_gradients is not None or self.transitions is not None or self.use_learning_rate_decay is not None or self.validation_arguments is not None or self.validation_heads is not None or self.validation_predicates is not None or self.validation_sentences is not None or self.validation_tags is not None
 *     if use_setstate:
 *         return __pyx_unpickle_ConvolutionalDependencyNetwork, (type(self), 0xca52c1e, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_ConvolutionalDependencyNetwork, (type(self), 0xca52c1e, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_22, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ConvolutionalDepe); if (unlikely(!__pyx_t_22)) __PYX_ERR(4, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_22);
    __pyx_t_23 = PyTuple_New(3); if (unlikely(!__pyx_t_23)) __PYX_ERR(4, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_23);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(4, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_212151326);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_212151326);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_mstate_global->__pyx_int_212151326) != (0)) __PYX_ERR(4, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 2, Py_None) != (0)) __PYX_ERR(4, 13, __pyx_L1_error);
    __pyx_t_21 = PyTuple_New(3); if (unlikely(!__pyx_t_21)) __PYX_ERR(4, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_21);
    __Pyx_GIVEREF(__pyx_t_22);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_22) != (0)) __PYX_ERR(4, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_23);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_23) != (0)) __PYX_ERR(4, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 2, __pyx_v_state) != (0)) __PYX_ERR(4, 13, __pyx_L1_error);
    __pyx_t_22 = 0;
    __pyx_t_23 = 0;
    __pyx_r = __pyx_t_21;
    __pyx_t_21 = 0;
    __Pyx_TraceReturnValue(__pyx_r, 405, 0, __PYX_ERR(4, 13, __pyx_L1_error));
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.convolution_lookup is not None or self.dependency_weights is not None or self.feature_tables is not None or self.hidden2_before_activation is not None or self.hidden2_bias is not None or self.hidden2_gradients is not None or self.hidden2_values is not None or self.hidden2_weights is not None or self.hidden_before_activation is not None or self.hidden_bias is not None or self.hidden_gradients is not None or self.hidden_sent_values is not None or self.hidden_values is not None or self.hidden_weights is not None or self.input_deltas is not None or self.input_sent_values is not None or self.input_values is not None or self.layer2_sent_values is not None or self.layer2_values is not None or self.max_indices is not None or self.net_gradients is not None or self.network_filename is not None or self.network_text_filename is not None or self.only_classify is not None or self.output_bias is not None or self.output_weights is not None or self.padding_left is not None or self.padding_right is not None or self.pos_padding is not None or self.pre_padding is not None or self.pred_convolution_lookup is not None or self.pred_dist_deltas is not None or self.pred_dist_lookup is not None or self.pred_dist_table is not None or self.pred_dist_weights is not None or self.sentence_lookup is not None or self.target_convolution_lookup is not None or self.target_dist_deltas is not None or self.target_dist_lookup is not None or self.target_dist_table is not None or self.target_dist_weights is not None or self.trans_gradients is not None or self.transitions is not None or self.use_learning_rate_decay is not None or self.validation_arguments is not None or self.validation_heads is not None or self.validation_predicates is not None or self.validation_sentences is not None or self.validation_tags is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_ConvolutionalDependencyNetwork, (type(self), 0xca52c1e, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_ConvolutionalDependencyNetwork, (type(self), 0xca52c1e, None), state
 *     else:
 *         return __pyx_unpickle_ConvolutionalDependencyNetwork, (type(self), 0xca52c1e, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ConvolutionalDepe); if (unlikely(!__pyx_t_21)) __PYX_ERR(4, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_21);
    __pyx_t_23 = PyTuple_New(3); if (unlikely(!__pyx_t_23)) __PYX_ERR(4, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_23);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(4, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_212151326);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_212151326);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_mstate_global->__pyx_int_212151326) != (0)) __PYX_ERR(4, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 2, __pyx_v_state) != (0)) __PYX_ERR(4, 15, __pyx_L1_error);
    __pyx_t_22 = PyTuple_New(2); if (unlikely(!__pyx_t_22)) __PYX_ERR(4, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_22);
    __Pyx_GIVEREF(__pyx_t_21);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_21) != (0)) __PYX_ERR(4, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_23);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_23) != (0)) __PYX_ERR(4, 15, __pyx_L1_error);
    __pyx_t_21 = 0;
    __pyx_t_23 = 0;
    __pyx_r = __pyx_t_22;
    __pyx_t_22 = 0;
    __Pyx_TraceReturnValue(__pyx_r, 413, 0, __PYX_ERR(4, 15, __pyx_L1_error));
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_XDECREF(__pyx_t_21);
  __Pyx_XDECREF(__pyx_t_22);
  __Pyx_XDECREF(__pyx_t_23);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(4, 1, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ConvolutionalDependencyNetwork, (type(self), 0xca52c1e, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_35__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_34__setstate_cython__, "ConvolutionalDependencyNetwork.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_35__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_35__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_34__setstate_cython__};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_35__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 16, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 16, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < 0) __PYX_ERR(4, 16, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(4, 16, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 16, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(4, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_34__setstate_cython__(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_34__setstate_cython__(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[154]))
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
  __Pyx_TraceStartFunc("__setstate_cython__", __pyx_f[4], 16, 0, 0, 0, __PYX_ERR(4, 16, __pyx_L1_error));

  /* "(tree fragment)":17
 *         return __pyx_unpickle_ConvolutionalDependencyNetwork, (type(self), 0xca52c1e, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(4, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_6nltkor_3tag_4libs_7network___pyx_unpickle_ConvolutionalDependencyNetwork__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ConvolutionalDependencyNetwork, (type(self), 0xca52c1e, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(self, __pyx_state)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(4, 16, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(4, 16, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.ConvolutionalDependencyNetwork.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_Network(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_1__pyx_unpickle_Network(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network___pyx_unpickle_Network, "__pyx_unpickle_Network(__pyx_type, long __pyx_checksum, __pyx_state)");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_1__pyx_unpickle_Network = {"__pyx_unpickle_Network", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_1__pyx_unpickle_Network, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network___pyx_unpickle_Network};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_1__pyx_unpickle_Network(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_Network (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 1, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(4, 1, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 1, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle_Network", 0) < 0) __PYX_ERR(4, 1, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Network", 1, 3, 3, i); __PYX_ERR(4, 1, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 1, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(4, 1, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(4, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Network", 1, 3, 3, __pyx_nargs); __PYX_ERR(4, 1, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.__pyx_unpickle_Network", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network___pyx_unpickle_Network(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network___pyx_unpickle_Network(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[155]))
  __Pyx_RefNannySetupContext("__pyx_unpickle_Network", 0);
  __Pyx_TraceStartFunc("__pyx_unpickle_Network", __pyx_f[4], 1, 0, 0, 0, __PYX_ERR(4, 1, __pyx_L1_error));

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x72479d4, 0xd248f0d, 0xc0e08fa):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x72479d4, 0xd248f0d, 0xc0e08fa) = (accuracy, answer_score, decay_factor, error, feature_tables, features_per_token, float_errors, hidden_bias, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, net_gradients, network_filename, network_text_filename, num_tokens, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, sentence_accuracy, sentence_lookup, skips, trans_gradients, transitions, use_learning_rate_decay, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
*/
  __pyx_t_1 = __Pyx_PyLong_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[2], Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x72479d4, 0xd248f0d, 0xc0e08fa):
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x72479d4, 0xd248f0d, 0xc0e08fa) = (accuracy, answer_score, decay_factor, error, feature_tables, features_per_token, float_errors, hidden_bias, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, net_gradients, network_filename, network_text_filename, num_tokens, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, sentence_accuracy, sentence_lookup, skips, trans_gradients, transitions, use_learning_rate_decay, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
 *     __pyx_result = Network.__new__(__pyx_type)
*/
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_PickleError);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_PickleError);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_n_u_PickleError) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
    __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_v___pyx_PickleError = __pyx_t_1;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum not in (0x72479d4, 0xd248f0d, 0xc0e08fa):
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x72479d4, 0xd248f0d, 0xc0e08fa) = (accuracy, answer_score, decay_factor, error, feature_tables, features_per_token, float_errors, hidden_bias, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, net_gradients, network_filename, network_text_filename, num_tokens, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, sentence_accuracy, sentence_lookup, skips, trans_gradients, transitions, use_learning_rate_decay, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum             # <<<<<<<<<<<<<<
 *     __pyx_result = Network.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
    __pyx_t_3 = __Pyx_PyLong_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x72479d4, 0xd248f0d, 0xc0e08fa):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x72479d4, 0xd248f0d, 0xc0e08fa) = (accuracy, answer_score, decay_factor, error, feature_tables, features_per_token, float_errors, hidden_bias, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, net_gradients, network_filename, network_text_filename, num_tokens, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, sentence_accuracy, sentence_lookup, skips, trans_gradients, transitions, use_learning_rate_decay, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
*/
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x72479d4, 0xd248f0d, 0xc0e08fa) = (accuracy, answer_score, decay_factor, error, feature_tables, features_per_token, float_errors, hidden_bias, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, net_gradients, network_filename, network_text_filename, num_tokens, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, sentence_accuracy, sentence_lookup, skips, trans_gradients, transitions, use_learning_rate_decay, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
 *     __pyx_result = Network.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Network__set_state(<Network> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v___pyx_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x72479d4, 0xd248f0d, 0xc0e08fa) = (accuracy, answer_score, decay_factor, error, feature_tables, features_per_token, float_errors, hidden_bias, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, net_gradients, network_filename, network_text_filename, num_tokens, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, sentence_accuracy, sentence_lookup, skips, trans_gradients, transitions, use_learning_rate_decay, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
 *     __pyx_result = Network.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Network__set_state(<Network> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_2 = (__pyx_v___pyx_state != Py_None);
  if (__pyx_t_2) {

    /* "(tree fragment)":9
 *     __pyx_result = Network.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Network__set_state(<Network> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_Network__set_state(Network __pyx_result, tuple __pyx_state):
*/
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(4, 9, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_6nltkor_3tag_4libs_7network___pyx_unpickle_Network__set_state(((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x72479d4, 0xd248f0d, 0xc0e08fa) = (accuracy, answer_score, decay_factor, error, feature_tables, features_per_token, float_errors, hidden_bias, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, net_gradients, network_filename, network_text_filename, num_tokens, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, sentence_accuracy, sentence_lookup, skips, trans_gradients, transitions, use_learning_rate_decay, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
 *     __pyx_result = Network.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Network__set_state(<Network> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Network__set_state(<Network> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_Network__set_state(Network __pyx_result, tuple __pyx_state):
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.decay_factor = __pyx_state[2]; __pyx_result.error = __pyx_state[3]; __pyx_result.feature_tables = __pyx_state[4]; __pyx_result.features_per_token = __pyx_state[5]; __pyx_result.float_errors = __pyx_state[6]; __pyx_result.hidden_bias = __pyx_state[7]; __pyx_result.hidden_sent_values = __pyx_state[8]; __pyx_result.hidden_size = __pyx_state[9]; __pyx_result.hidden_values = __pyx_state[10]; __pyx_result.hidden_weights = __pyx_state[11]; __pyx_result.input_sent_values = __pyx_state[12]; __pyx_result.input_size = __pyx_state[13]; __pyx_result.input_values = __pyx_state[14]; __pyx_result.layer2_sent_values = __pyx_state[15]; __pyx_result.layer2_values = __pyx_state[16]; __pyx_result.learning_rate = __pyx_state[17]; __pyx_result.learning_rate_features = __pyx_state[18]; __pyx_result.learning_rate_trans = __pyx_state[19]; __pyx_result.net_gradients = __pyx_state[20]; __pyx_result.network_filename = __pyx_state[21]; __pyx_result.network_text_filename = __pyx_state[22]; __pyx_result.num_tokens = __pyx_state[23]; __pyx_result.output_bias = __pyx_state[24]; __pyx_result.output_size = __pyx_state[25]; __pyx_result.output_weights = __pyx_state[26]; __pyx_result.padding_left = __pyx_state[27]; __pyx_result.padding_right = __pyx_state[28]; __pyx_result.pos_padding = __pyx_state[29]; __pyx_result.pre_padding = __pyx_state[30]; __pyx_result.sentence_accuracy = __pyx_state[31]; __pyx_result.sentence_lookup = __pyx_state[32]; __pyx_result.skips = __pyx_state[33]; __pyx_result.trans_gradients = __pyx_state[34]; __pyx_result.transitions = __pyx_state[35]; __pyx_result.use_learning_rate_decay = __pyx_state[36]; __pyx_result.validation_sentences = __pyx_state[37]; __pyx_result.validation_tags = __pyx_state[38]; __pyx_result.word_window_size = __pyx_state[39]
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  __Pyx_TraceReturnValue(__pyx_r, 29, 0, __PYX_ERR(4, 10, __pyx_L1_error));
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_Network(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(4, 1, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.__pyx_unpickle_Network", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_Network__set_state(<Network> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Network__set_state(Network __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.decay_factor = __pyx_state[2]; __pyx_result.error = __pyx_state[3]; __pyx_result.feature_tables = __pyx_state[4]; __pyx_result.features_per_token = __pyx_state[5]; __pyx_result.float_errors = __pyx_state[6]; __pyx_result.hidden_bias = __pyx_state[7]; __pyx_result.hidden_sent_values = __pyx_state[8]; __pyx_result.hidden_size = __pyx_state[9]; __pyx_result.hidden_values = __pyx_state[10]; __pyx_result.hidden_weights = __pyx_state[11]; __pyx_result.input_sent_values = __pyx_state[12]; __pyx_result.input_size = __pyx_state[13]; __pyx_result.input_values = __pyx_state[14]; __pyx_result.layer2_sent_values = __pyx_state[15]; __pyx_result.layer2_values = __pyx_state[16]; __pyx_result.learning_rate = __pyx_state[17]; __pyx_result.learning_rate_features = __pyx_state[18]; __pyx_result.learning_rate_trans = __pyx_state[19]; __pyx_result.net_gradients = __pyx_state[20]; __pyx_result.network_filename = __pyx_state[21]; __pyx_result.network_text_filename = __pyx_state[22]; __pyx_result.num_tokens = __pyx_state[23]; __pyx_result.output_bias = __pyx_state[24]; __pyx_result.output_size = __pyx_state[25]; __pyx_result.output_weights = __pyx_state[26]; __pyx_result.padding_left = __pyx_state[27]; __pyx_result.padding_right = __pyx_state[28]; __pyx_result.pos_padding = __pyx_state[29]; __pyx_result.pre_padding = __pyx_state[30]; __pyx_result.sentence_accuracy = __pyx_state[31]; __pyx_result.sentence_lookup = __pyx_state[32]; __pyx_result.skips = __pyx_state[33]; __pyx_result.trans_gradients = __pyx_state[34]; __pyx_result.transitions = __pyx_state[35]; __pyx_result.use_learning_rate_decay = __pyx_state[36]; __pyx_result.validation_sentences = __pyx_state[37]; __pyx_result.validation_tags = __pyx_state[38]; __pyx_result.word_window_size = __pyx_state[39]
 *     if len(__pyx_state) > 40 and hasattr(__pyx_result, '__dict__'):
*/

static PyObject *__pyx_f_6nltkor_3tag_4libs_7network___pyx_unpickle_Network__set_state(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  float __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  size_t __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[156]))
  __Pyx_RefNannySetupContext("__pyx_unpickle_Network__set_state", 0);
  __Pyx_TraceStartFunc("__pyx_unpickle_Network__set_state", __pyx_f[4], 11, 0, 0, 0, __PYX_ERR(4, 11, __pyx_L1_error));

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_Network__set_state(Network __pyx_result, tuple __pyx_state):
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.decay_factor = __pyx_state[2]; __pyx_result.error = __pyx_state[3]; __pyx_result.feature_tables = __pyx_state[4]; __pyx_result.features_per_token = __pyx_state[5]; __pyx_result.float_errors = __pyx_state[6]; __pyx_result.hidden_bias = __pyx_state[7]; __pyx_result.hidden_sent_values = __pyx_state[8]; __pyx_result.hidden_size = __pyx_state[9]; __pyx_result.hidden_values = __pyx_state[10]; __pyx_result.hidden_weights = __pyx_state[11]; __pyx_result.input_sent_values = __pyx_state[12]; __pyx_result.input_size = __pyx_state[13]; __pyx_result.input_values = __pyx_state[14]; __pyx_result.layer2_sent_values = __pyx_state[15]; __pyx_result.layer2_values = __pyx_state[16]; __pyx_result.learning_rate = __pyx_state[17]; __pyx_result.learning_rate_features = __pyx_state[18]; __pyx_result.learning_rate_trans = __pyx_state[19]; __pyx_result.net_gradients = __pyx_state[20]; __pyx_result.network_filename = __pyx_state[21]; __pyx_result.network_text_filename = __pyx_state[22]; __pyx_result.num_tokens = __pyx_state[23]; __pyx_result.output_bias = __pyx_state[24]; __pyx_result.output_size = __pyx_state[25]; __pyx_result.output_weights = __pyx_state[26]; __pyx_result.padding_left = __pyx_state[27]; __pyx_result.padding_right = __pyx_state[28]; __pyx_result.pos_padding = __pyx_state[29]; __pyx_result.pre_padding = __pyx_state[30]; __pyx_result.sentence_accuracy = __pyx_state[31]; __pyx_result.sentence_lookup = __pyx_state[32]; __pyx_result.skips = __pyx_state[33]; __pyx_result.trans_gradients = __pyx_state[34]; __pyx_result.transitions = __pyx_state[35]; __pyx_result.use_learning_rate_decay = __pyx_state[36]; __pyx_result.validation_sentences = __pyx_state[37]; __pyx_result.validation_tags = __pyx_state[38]; __pyx_result.word_window_size = __pyx_state[39]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 40 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[40])
*/
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->accuracy = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->answer_score = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->decay_factor = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->error = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->feature_tables);
  __Pyx_DECREF(__pyx_v___pyx_result->feature_tables);
  __pyx_v___pyx_result->feature_tables = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->features_per_token = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->float_errors = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->hidden_bias);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->hidden_bias);
  __pyx_v___pyx_result->hidden_bias = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->hidden_sent_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->hidden_sent_values);
  __pyx_v___pyx_result->hidden_sent_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->hidden_size = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->hidden_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->hidden_values);
  __pyx_v___pyx_result->hidden_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->hidden_weights);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->hidden_weights);
  __pyx_v___pyx_result->hidden_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->input_sent_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->input_sent_values);
  __pyx_v___pyx_result->input_sent_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->input_size = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 14, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->input_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->input_values);
  __pyx_v___pyx_result->input_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 15, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->layer2_sent_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->layer2_sent_values);
  __pyx_v___pyx_result->layer2_sent_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 16, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->layer2_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->layer2_values);
  __pyx_v___pyx_result->layer2_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 17, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->learning_rate = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 18, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->learning_rate_features = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 19, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->learning_rate_trans = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 20, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->net_gradients);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->net_gradients);
  __pyx_v___pyx_result->net_gradients = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 21, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->network_filename);
  __Pyx_DECREF(__pyx_v___pyx_result->network_filename);
  __pyx_v___pyx_result->network_filename = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 22, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->network_text_filename);
  __Pyx_DECREF(__pyx_v___pyx_result->network_text_filename);
  __pyx_v___pyx_result->network_text_filename = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 23, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->num_tokens = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 24, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->output_bias);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->output_bias);
  __pyx_v___pyx_result->output_bias = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 25, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->output_size = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 26, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->output_weights);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->output_weights);
  __pyx_v___pyx_result->output_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 27, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->padding_left);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->padding_left);
  __pyx_v___pyx_result->padding_left = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 28, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->padding_right);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->padding_right);
  __pyx_v___pyx_result->padding_right = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 29, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->pos_padding);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->pos_padding);
  __pyx_v___pyx_result->pos_padding = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 30, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->pre_padding);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->pre_padding);
  __pyx_v___pyx_result->pre_padding = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 31, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->sentence_accuracy = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 32, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->sentence_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->sentence_lookup);
  __pyx_v___pyx_result->sentence_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 33, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->skips = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 34, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->trans_gradients);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->trans_gradients);
  __pyx_v___pyx_result->trans_gradients = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 35, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->transitions);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->transitions);
  __pyx_v___pyx_result->transitions = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 36, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->use_learning_rate_decay);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->use_learning_rate_decay);
  __pyx_v___pyx_result->use_learning_rate_decay = ((PyLongObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 37, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->validation_sentences);
  __Pyx_DECREF(__pyx_v___pyx_result->validation_sentences);
  __pyx_v___pyx_result->validation_sentences = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 38, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->validation_tags);
  __Pyx_DECREF(__pyx_v___pyx_result->validation_tags);
  __pyx_v___pyx_result->validation_tags = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 39, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->word_window_size = __pyx_t_3;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_Network__set_state(Network __pyx_result, tuple __pyx_state):
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.decay_factor = __pyx_state[2]; __pyx_result.error = __pyx_state[3]; __pyx_result.feature_tables = __pyx_state[4]; __pyx_result.features_per_token = __pyx_state[5]; __pyx_result.float_errors = __pyx_state[6]; __pyx_result.hidden_bias = __pyx_state[7]; __pyx_result.hidden_sent_values = __pyx_state[8]; __pyx_result.hidden_size = __pyx_state[9]; __pyx_result.hidden_values = __pyx_state[10]; __pyx_result.hidden_weights = __pyx_state[11]; __pyx_result.input_sent_values = __pyx_state[12]; __pyx_result.input_size = __pyx_state[13]; __pyx_result.input_values = __pyx_state[14]; __pyx_result.layer2_sent_values = __pyx_state[15]; __pyx_result.layer2_values = __pyx_state[16]; __pyx_result.learning_rate = __pyx_state[17]; __pyx_result.learning_rate_features = __pyx_state[18]; __pyx_result.learning_rate_trans = __pyx_state[19]; __pyx_result.net_gradients = __pyx_state[20]; __pyx_result.network_filename = __pyx_state[21]; __pyx_result.network_text_filename = __pyx_state[22]; __pyx_result.num_tokens = __pyx_state[23]; __pyx_result.output_bias = __pyx_state[24]; __pyx_result.output_size = __pyx_state[25]; __pyx_result.output_weights = __pyx_state[26]; __pyx_result.padding_left = __pyx_state[27]; __pyx_result.padding_right = __pyx_state[28]; __pyx_result.pos_padding = __pyx_state[29]; __pyx_result.pre_padding = __pyx_state[30]; __pyx_result.sentence_accuracy = __pyx_state[31]; __pyx_result.sentence_lookup = __pyx_state[32]; __pyx_result.skips = __pyx_state[33]; __pyx_result.trans_gradients = __pyx_state[34]; __pyx_result.transitions = __pyx_state[35]; __pyx_result.use_learning_rate_decay = __pyx_state[36]; __pyx_result.validation_sentences = __pyx_state[37]; __pyx_result.validation_tags = __pyx_state[38]; __pyx_result.word_window_size = __pyx_state[39]
 *     if len(__pyx_state) > 40 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[40])
*/
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(4, 13, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(4, 13, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_5 > 40);
  if (__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_mstate_global->__pyx_n_u_dict); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(4, 13, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_4) {

    /* "(tree fragment)":14
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.decay_factor = __pyx_state[2]; __pyx_result.error = __pyx_state[3]; __pyx_result.feature_tables = __pyx_state[4]; __pyx_result.features_per_token = __pyx_state[5]; __pyx_result.float_errors = __pyx_state[6]; __pyx_result.hidden_bias = __pyx_state[7]; __pyx_result.hidden_sent_values = __pyx_state[8]; __pyx_result.hidden_size = __pyx_state[9]; __pyx_result.hidden_values = __pyx_state[10]; __pyx_result.hidden_weights = __pyx_state[11]; __pyx_result.input_sent_values = __pyx_state[12]; __pyx_result.input_size = __pyx_state[13]; __pyx_result.input_values = __pyx_state[14]; __pyx_result.layer2_sent_values = __pyx_state[15]; __pyx_result.layer2_values = __pyx_state[16]; __pyx_result.learning_rate = __pyx_state[17]; __pyx_result.learning_rate_features = __pyx_state[18]; __pyx_result.learning_rate_trans = __pyx_state[19]; __pyx_result.net_gradients = __pyx_state[20]; __pyx_result.network_filename = __pyx_state[21]; __pyx_result.network_text_filename = __pyx_state[22]; __pyx_result.num_tokens = __pyx_state[23]; __pyx_result.output_bias = __pyx_state[24]; __pyx_result.output_size = __pyx_state[25]; __pyx_result.output_weights = __pyx_state[26]; __pyx_result.padding_left = __pyx_state[27]; __pyx_result.padding_right = __pyx_state[28]; __pyx_result.pos_padding = __pyx_state[29]; __pyx_result.pre_padding = __pyx_state[30]; __pyx_result.sentence_accuracy = __pyx_state[31]; __pyx_result.sentence_lookup = __pyx_state[32]; __pyx_result.skips = __pyx_state[33]; __pyx_result.trans_gradients = __pyx_state[34]; __pyx_result.transitions = __pyx_state[35]; __pyx_result.use_learning_rate_decay = __pyx_state[36]; __pyx_result.validation_sentences = __pyx_state[37]; __pyx_result.validation_tags = __pyx_state[38]; __pyx_result.word_window_size = __pyx_state[39]
 *     if len(__pyx_state) > 40 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[40])             # <<<<<<<<<<<<<<
*/
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_mstate_global->__pyx_n_u_dict); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = __pyx_t_8;
    __Pyx_INCREF(__pyx_t_7);
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(4, 14, __pyx_L1_error)
    }
    __pyx_t_9 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 40, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_9};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_update, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 14, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_Network__set_state(Network __pyx_result, tuple __pyx_state):
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.decay_factor = __pyx_state[2]; __pyx_result.error = __pyx_state[3]; __pyx_result.feature_tables = __pyx_state[4]; __pyx_result.features_per_token = __pyx_state[5]; __pyx_result.float_errors = __pyx_state[6]; __pyx_result.hidden_bias = __pyx_state[7]; __pyx_result.hidden_sent_values = __pyx_state[8]; __pyx_result.hidden_size = __pyx_state[9]; __pyx_result.hidden_values = __pyx_state[10]; __pyx_result.hidden_weights = __pyx_state[11]; __pyx_result.input_sent_values = __pyx_state[12]; __pyx_result.input_size = __pyx_state[13]; __pyx_result.input_values = __pyx_state[14]; __pyx_result.layer2_sent_values = __pyx_state[15]; __pyx_result.layer2_values = __pyx_state[16]; __pyx_result.learning_rate = __pyx_state[17]; __pyx_result.learning_rate_features = __pyx_state[18]; __pyx_result.learning_rate_trans = __pyx_state[19]; __pyx_result.net_gradients = __pyx_state[20]; __pyx_result.network_filename = __pyx_state[21]; __pyx_result.network_text_filename = __pyx_state[22]; __pyx_result.num_tokens = __pyx_state[23]; __pyx_result.output_bias = __pyx_state[24]; __pyx_result.output_size = __pyx_state[25]; __pyx_result.output_weights = __pyx_state[26]; __pyx_result.padding_left = __pyx_state[27]; __pyx_result.padding_right = __pyx_state[28]; __pyx_result.pos_padding = __pyx_state[29]; __pyx_result.pre_padding = __pyx_state[30]; __pyx_result.sentence_accuracy = __pyx_state[31]; __pyx_result.sentence_lookup = __pyx_state[32]; __pyx_result.skips = __pyx_state[33]; __pyx_result.trans_gradients = __pyx_state[34]; __pyx_result.transitions = __pyx_state[35]; __pyx_result.use_learning_rate_decay = __pyx_state[36]; __pyx_result.validation_sentences = __pyx_state[37]; __pyx_result.validation_tags = __pyx_state[38]; __pyx_result.word_window_size = __pyx_state[39]
 *     if len(__pyx_state) > 40 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[40])
*/
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_Network__set_state(<Network> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Network__set_state(Network __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.decay_factor = __pyx_state[2]; __pyx_result.error = __pyx_state[3]; __pyx_result.feature_tables = __pyx_state[4]; __pyx_result.features_per_token = __pyx_state[5]; __pyx_result.float_errors = __pyx_state[6]; __pyx_result.hidden_bias = __pyx_state[7]; __pyx_result.hidden_sent_values = __pyx_state[8]; __pyx_result.hidden_size = __pyx_state[9]; __pyx_result.hidden_values = __pyx_state[10]; __pyx_result.hidden_weights = __pyx_state[11]; __pyx_result.input_sent_values = __pyx_state[12]; __pyx_result.input_size = __pyx_state[13]; __pyx_result.input_values = __pyx_state[14]; __pyx_result.layer2_sent_values = __pyx_state[15]; __pyx_result.layer2_values = __pyx_state[16]; __pyx_result.learning_rate = __pyx_state[17]; __pyx_result.learning_rate_features = __pyx_state[18]; __pyx_result.learning_rate_trans = __pyx_state[19]; __pyx_result.net_gradients = __pyx_state[20]; __pyx_result.network_filename = __pyx_state[21]; __pyx_result.network_text_filename = __pyx_state[22]; __pyx_result.num_tokens = __pyx_state[23]; __pyx_result.output_bias = __pyx_state[24]; __pyx_result.output_size = __pyx_state[25]; __pyx_result.output_weights = __pyx_state[26]; __pyx_result.padding_left = __pyx_state[27]; __pyx_result.padding_right = __pyx_state[28]; __pyx_result.pos_padding = __pyx_state[29]; __pyx_result.pre_padding = __pyx_state[30]; __pyx_result.sentence_accuracy = __pyx_state[31]; __pyx_result.sentence_lookup = __pyx_state[32]; __pyx_result.skips = __pyx_state[33]; __pyx_result.trans_gradients = __pyx_state[34]; __pyx_result.transitions = __pyx_state[35]; __pyx_result.use_learning_rate_decay = __pyx_state[36]; __pyx_result.validation_sentences = __pyx_state[37]; __pyx_result.validation_tags = __pyx_state[38]; __pyx_result.word_window_size = __pyx_state[39]
 *     if len(__pyx_state) > 40 and hasattr(__pyx_result, '__dict__'):
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(4, 11, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(4, 11, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.__pyx_unpickle_Network__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_ConvolutionalNetwork(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_3__pyx_unpickle_ConvolutionalNetwork(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_2__pyx_unpickle_ConvolutionalNetwork, "__pyx_unpickle_ConvolutionalNetwork(__pyx_type, long __pyx_checksum, __pyx_state)");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_3__pyx_unpickle_ConvolutionalNetwork = {"__pyx_unpickle_ConvolutionalNetwork", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_3__pyx_unpickle_ConvolutionalNetwork, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_2__pyx_unpickle_ConvolutionalNetwork};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_3__pyx_unpickle_ConvolutionalNetwork(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_ConvolutionalNetwork (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 1, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(4, 1, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 1, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle_ConvolutionalNetwork", 0) < 0) __PYX_ERR(4, 1, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ConvolutionalNetwork", 1, 3, 3, i); __PYX_ERR(4, 1, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 1, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(4, 1, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(4, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ConvolutionalNetwork", 1, 3, 3, __pyx_nargs); __PYX_ERR(4, 1, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.__pyx_unpickle_ConvolutionalNetwork", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_2__pyx_unpickle_ConvolutionalNetwork(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_2__pyx_unpickle_ConvolutionalNetwork(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[157]))
  __Pyx_RefNannySetupContext("__pyx_unpickle_ConvolutionalNetwork", 0);
  __Pyx_TraceStartFunc("__pyx_unpickle_ConvolutionalNetwork", __pyx_f[4], 1, 0, 0, 0, __PYX_ERR(4, 1, __pyx_L1_error));

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x2f64fba, 0x8d42e09, 0x8e85e02):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x2f64fba, 0x8d42e09, 0x8e85e02) = (accuracy, answer_score, convolution_lookup, decay_factor, error, feature_tables, features_per_token, float_errors, half_window, hidden2_before_activation, hidden2_bias, hidden2_gradients, hidden2_size, hidden2_values, hidden2_weights, hidden_before_activation, hidden_bias, hidden_gradients, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_deltas, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, max_indices, net_gradients, network_filename, network_text_filename, num_sentences, num_targets, num_tokens, only_classify, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, pred_convolution_lookup, pred_dist_deltas, pred_dist_lookup, pred_dist_offset, pred_dist_table, pred_dist_weights, sentence_accuracy, sentence_lookup, skips, target_convolution_lookup, target_dist_deltas, target_dist_lookup, target_dist_offset, target_dist_table, target_dist_weights, trans_gradients, transitions, use_learning_rate_decay, validation_arguments, validation_predicates, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
*/
  __pyx_t_1 = __Pyx_PyLong_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[3], Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x2f64fba, 0x8d42e09, 0x8e85e02):
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x2f64fba, 0x8d42e09, 0x8e85e02) = (accuracy, answer_score, convolution_lookup, decay_factor, error, feature_tables, features_per_token, float_errors, half_window, hidden2_before_activation, hidden2_bias, hidden2_gradients, hidden2_size, hidden2_values, hidden2_weights, hidden_before_activation, hidden_bias, hidden_gradients, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_deltas, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, max_indices, net_gradients, network_filename, network_text_filename, num_sentences, num_targets, num_tokens, only_classify, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, pred_convolution_lookup, pred_dist_deltas, pred_dist_lookup, pred_dist_offset, pred_dist_table, pred_dist_weights, sentence_accuracy, sentence_lookup, skips, target_convolution_lookup, target_dist_deltas, target_dist_lookup, target_dist_offset, target_dist_table, target_dist_weights, trans_gradients, transitions, use_learning_rate_decay, validation_arguments, validation_predicates, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
 *     __pyx_result = ConvolutionalNetwork.__new__(__pyx_type)
*/
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_PickleError);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_PickleError);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_n_u_PickleError) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
    __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_v___pyx_PickleError = __pyx_t_1;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum not in (0x2f64fba, 0x8d42e09, 0x8e85e02):
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x2f64fba, 0x8d42e09, 0x8e85e02) = (accuracy, answer_score, convolution_lookup, decay_factor, error, feature_tables, features_per_token, float_errors, half_window, hidden2_before_activation, hidden2_bias, hidden2_gradients, hidden2_size, hidden2_values, hidden2_weights, hidden_before_activation, hidden_bias, hidden_gradients, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_deltas, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, max_indices, net_gradients, network_filename, network_text_filename, num_sentences, num_targets, num_tokens, only_classify, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, pred_convolution_lookup, pred_dist_deltas, pred_dist_lookup, pred_dist_offset, pred_dist_table, pred_dist_weights, sentence_accuracy, sentence_lookup, skips, target_convolution_lookup, target_dist_deltas, target_dist_lookup, target_dist_offset, target_dist_table, target_dist_weights, trans_gradients, transitions, use_learning_rate_decay, validation_arguments, validation_predicates, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum             # <<<<<<<<<<<<<<
 *     __pyx_result = ConvolutionalNetwork.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
    __pyx_t_3 = __Pyx_PyLong_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_Incompatible_checksums_0x_x_vs_0_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x2f64fba, 0x8d42e09, 0x8e85e02):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x2f64fba, 0x8d42e09, 0x8e85e02) = (accuracy, answer_score, convolution_lookup, decay_factor, error, feature_tables, features_per_token, float_errors, half_window, hidden2_before_activation, hidden2_bias, hidden2_gradients, hidden2_size, hidden2_values, hidden2_weights, hidden_before_activation, hidden_bias, hidden_gradients, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_deltas, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, max_indices, net_gradients, network_filename, network_text_filename, num_sentences, num_targets, num_tokens, only_classify, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, pred_convolution_lookup, pred_dist_deltas, pred_dist_lookup, pred_dist_offset, pred_dist_table, pred_dist_weights, sentence_accuracy, sentence_lookup, skips, target_convolution_lookup, target_dist_deltas, target_dist_lookup, target_dist_offset, target_dist_table, target_dist_weights, trans_gradients, transitions, use_learning_rate_decay, validation_arguments, validation_predicates, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
*/
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x2f64fba, 0x8d42e09, 0x8e85e02) = (accuracy, answer_score, convolution_lookup, decay_factor, error, feature_tables, features_per_token, float_errors, half_window, hidden2_before_activation, hidden2_bias, hidden2_gradients, hidden2_size, hidden2_values, hidden2_weights, hidden_before_activation, hidden_bias, hidden_gradients, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_deltas, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, max_indices, net_gradients, network_filename, network_text_filename, num_sentences, num_targets, num_tokens, only_classify, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, pred_convolution_lookup, pred_dist_deltas, pred_dist_lookup, pred_dist_offset, pred_dist_table, pred_dist_weights, sentence_accuracy, sentence_lookup, skips, target_convolution_lookup, target_dist_deltas, target_dist_lookup, target_dist_offset, target_dist_table, target_dist_weights, trans_gradients, transitions, use_learning_rate_decay, validation_arguments, validation_predicates, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
 *     __pyx_result = ConvolutionalNetwork.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ConvolutionalNetwork__set_state(<ConvolutionalNetwork> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v___pyx_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x2f64fba, 0x8d42e09, 0x8e85e02) = (accuracy, answer_score, convolution_lookup, decay_factor, error, feature_tables, features_per_token, float_errors, half_window, hidden2_before_activation, hidden2_bias, hidden2_gradients, hidden2_size, hidden2_values, hidden2_weights, hidden_before_activation, hidden_bias, hidden_gradients, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_deltas, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, max_indices, net_gradients, network_filename, network_text_filename, num_sentences, num_targets, num_tokens, only_classify, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, pred_convolution_lookup, pred_dist_deltas, pred_dist_lookup, pred_dist_offset, pred_dist_table, pred_dist_weights, sentence_accuracy, sentence_lookup, skips, target_convolution_lookup, target_dist_deltas, target_dist_lookup, target_dist_offset, target_dist_table, target_dist_weights, trans_gradients, transitions, use_learning_rate_decay, validation_arguments, validation_predicates, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
 *     __pyx_result = ConvolutionalNetwork.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_ConvolutionalNetwork__set_state(<ConvolutionalNetwork> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_2 = (__pyx_v___pyx_state != Py_None);
  if (__pyx_t_2) {

    /* "(tree fragment)":9
 *     __pyx_result = ConvolutionalNetwork.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ConvolutionalNetwork__set_state(<ConvolutionalNetwork> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_ConvolutionalNetwork__set_state(ConvolutionalNetwork __pyx_result, tuple __pyx_state):
*/
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(4, 9, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_6nltkor_3tag_4libs_7network___pyx_unpickle_ConvolutionalNetwork__set_state(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x2f64fba, 0x8d42e09, 0x8e85e02) = (accuracy, answer_score, convolution_lookup, decay_factor, error, feature_tables, features_per_token, float_errors, half_window, hidden2_before_activation, hidden2_bias, hidden2_gradients, hidden2_size, hidden2_values, hidden2_weights, hidden_before_activation, hidden_bias, hidden_gradients, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_deltas, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, max_indices, net_gradients, network_filename, network_text_filename, num_sentences, num_targets, num_tokens, only_classify, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, pred_convolution_lookup, pred_dist_deltas, pred_dist_lookup, pred_dist_offset, pred_dist_table, pred_dist_weights, sentence_accuracy, sentence_lookup, skips, target_convolution_lookup, target_dist_deltas, target_dist_lookup, target_dist_offset, target_dist_table, target_dist_weights, trans_gradients, transitions, use_learning_rate_decay, validation_arguments, validation_predicates, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
 *     __pyx_result = ConvolutionalNetwork.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_ConvolutionalNetwork__set_state(<ConvolutionalNetwork> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ConvolutionalNetwork__set_state(<ConvolutionalNetwork> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_ConvolutionalNetwork__set_state(ConvolutionalNetwork __pyx_result, tuple __pyx_state):
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.convolution_lookup = __pyx_state[2]; __pyx_result.decay_factor = __pyx_state[3]; __pyx_result.error = __pyx_state[4]; __pyx_result.feature_tables = __pyx_state[5]; __pyx_result.features_per_token = __pyx_state[6]; __pyx_result.float_errors = __pyx_state[7]; __pyx_result.half_window = __pyx_state[8]; __pyx_result.hidden2_before_activation = __pyx_state[9]; __pyx_result.hidden2_bias = __pyx_state[10]; __pyx_result.hidden2_gradients = __pyx_state[11]; __pyx_result.hidden2_size = __pyx_state[12]; __pyx_result.hidden2_values = __pyx_state[13]; __pyx_result.hidden2_weights = __pyx_state[14]; __pyx_result.hidden_before_activation = __pyx_state[15]; __pyx_result.hidden_bias = __pyx_state[16]; __pyx_result.hidden_gradients = __pyx_state[17]; __pyx_result.hidden_sent_values = __pyx_state[18]; __pyx_result.hidden_size = __pyx_state[19]; __pyx_result.hidden_values = __pyx_state[20]; __pyx_result.hidden_weights = __pyx_state[21]; __pyx_result.input_deltas = __pyx_state[22]; __pyx_result.input_sent_values = __pyx_state[23]; __pyx_result.input_size = __pyx_state[24]; __pyx_result.input_values = __pyx_state[25]; __pyx_result.layer2_sent_values = __pyx_state[26]; __pyx_result.layer2_values = __pyx_state[27]; __pyx_result.learning_rate = __pyx_state[28]; __pyx_result.learning_rate_features = __pyx_state[29]; __pyx_result.learning_rate_trans = __pyx_state[30]; __pyx_result.max_indices = __pyx_state[31]; __pyx_result.net_gradients = __pyx_state[32]; __pyx_result.network_filename = __pyx_state[33]; __pyx_result.network_text_filename = __pyx_state[34]; __pyx_result.num_sentences = __pyx_state[35]; __pyx_result.num_targets = __pyx_state[36]; __pyx_result.num_tokens = __pyx_state[37]; __pyx_result.only_classify = __pyx_state[38]; __pyx_result.output_bias = __pyx_state[39]; __pyx_result.output_size = __pyx_state[40]; __pyx_result.output_weights = __pyx_state[41]; __pyx_result.padding_left = __pyx_state[42]; __pyx_result.padding_right = __pyx_state[43]; __pyx_result.pos_padding = __pyx_state[44]; __pyx_result.pre_padding = __pyx_state[45]; __pyx_result.pred_convolution_lookup = __pyx_state[46]; __pyx_result.pred_dist_deltas = __pyx_state[47]; __pyx_result.pred_dist_lookup = __pyx_state[48]; __pyx_result.pred_dist_offset = __pyx_state[49]; __pyx_result.pred_dist_table = __pyx_state[50]; __pyx_result.pred_dist_weights = __pyx_state[51]; __pyx_result.sentence_accuracy = __pyx_state[52]; __pyx_result.sentence_lookup = __pyx_state[53]; __pyx_result.skips = __pyx_state[54]; __pyx_result.target_convolution_lookup = __pyx_state[55]; __pyx_result.target_dist_deltas = __pyx_state[56]; __pyx_result.target_dist_lookup = __pyx_state[57]; __pyx_result.target_dist_offset = __pyx_state[58]; __pyx_result.target_dist_table = __pyx_state[59]; __pyx_result.target_dist_weights = __pyx_state[60]; __pyx_result.trans_gradients = __pyx_state[61]; __pyx_result.transitions = __pyx_state[62]; __pyx_result.use_learning_rate_decay = __pyx_state[63]; __pyx_result.validation_arguments = __pyx_state[64]; __pyx_result.validation_predicates = __pyx_state[65]; __pyx_result.validation_sentences = __pyx_state[66]; __pyx_result.validation_tags = __pyx_state[67]; __pyx_result.word_window_size = __pyx_state[68]
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  __Pyx_TraceReturnValue(__pyx_r, 29, 0, __PYX_ERR(4, 10, __pyx_L1_error));
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_ConvolutionalNetwork(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(4, 1, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.__pyx_unpickle_ConvolutionalNetwork", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_ConvolutionalNetwork__set_state(<ConvolutionalNetwork> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_ConvolutionalNetwork__set_state(ConvolutionalNetwork __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.convolution_lookup = __pyx_state[2]; __pyx_result.decay_factor = __pyx_state[3]; __pyx_result.error = __pyx_state[4]; __pyx_result.feature_tables = __pyx_state[5]; __pyx_result.features_per_token = __pyx_state[6]; __pyx_result.float_errors = __pyx_state[7]; __pyx_result.half_window = __pyx_state[8]; __pyx_result.hidden2_before_activation = __pyx_state[9]; __pyx_result.hidden2_bias = __pyx_state[10]; __pyx_result.hidden2_gradients = __pyx_state[11]; __pyx_result.hidden2_size = __pyx_state[12]; __pyx_result.hidden2_values = __pyx_state[13]; __pyx_result.hidden2_weights = __pyx_state[14]; __pyx_result.hidden_before_activation = __pyx_state[15]; __pyx_result.hidden_bias = __pyx_state[16]; __pyx_result.hidden_gradients = __pyx_state[17]; __pyx_result.hidden_sent_values = __pyx_state[18]; __pyx_result.hidden_size = __pyx_state[19]; __pyx_result.hidden_values = __pyx_state[20]; __pyx_result.hidden_weights = __pyx_state[21]; __pyx_result.input_deltas = __pyx_state[22]; __pyx_result.input_sent_values = __pyx_state[23]; __pyx_result.input_size = __pyx_state[24]; __pyx_result.input_values = __pyx_state[25]; __pyx_result.layer2_sent_values = __pyx_state[26]; __pyx_result.layer2_values = __pyx_state[27]; __pyx_result.learning_rate = __pyx_state[28]; __pyx_result.learning_rate_features = __pyx_state[29]; __pyx_result.learning_rate_trans = __pyx_state[30]; __pyx_result.max_indices = __pyx_state[31]; __pyx_result.net_gradients = __pyx_state[32]; __pyx_result.network_filename = __pyx_state[33]; __pyx_result.network_text_filename = __pyx_state[34]; __pyx_result.num_sentences = __pyx_state[35]; __pyx_result.num_targets = __pyx_state[36]; __pyx_result.num_tokens = __pyx_state[37]; __pyx_result.only_classify = __pyx_state[38]; __pyx_result.output_bias = __pyx_state[39]; __pyx_result.output_size = __pyx_state[40]; __pyx_result.output_weights = __pyx_state[41]; __pyx_result.padding_left = __pyx_state[42]; __pyx_result.padding_right = __pyx_state[43]; __pyx_result.pos_padding = __pyx_state[44]; __pyx_result.pre_padding = __pyx_state[45]; __pyx_result.pred_convolution_lookup = __pyx_state[46]; __pyx_result.pred_dist_deltas = __pyx_state[47]; __pyx_result.pred_dist_lookup = __pyx_state[48]; __pyx_result.pred_dist_offset = __pyx_state[49]; __pyx_result.pred_dist_table = __pyx_state[50]; __pyx_result.pred_dist_weights = __pyx_state[51]; __pyx_result.sentence_accuracy = __pyx_state[52]; __pyx_result.sentence_lookup = __pyx_state[53]; __pyx_result.skips = __pyx_state[54]; __pyx_result.target_convolution_lookup = __pyx_state[55]; __pyx_result.target_dist_deltas = __pyx_state[56]; __pyx_result.target_dist_lookup = __pyx_state[57]; __pyx_result.target_dist_offset = __pyx_state[58]; __pyx_result.target_dist_table = __pyx_state[59]; __pyx_result.target_dist_weights = __pyx_state[60]; __pyx_result.trans_gradients = __pyx_state[61]; __pyx_result.transitions = __pyx_state[62]; __pyx_result.use_learning_rate_decay = __pyx_state[63]; __pyx_result.validation_arguments = __pyx_state[64]; __pyx_result.validation_predicates = __pyx_state[65]; __pyx_result.validation_sentences = __pyx_state[66]; __pyx_result.validation_tags = __pyx_state[67]; __pyx_result.word_window_size = __pyx_state[68]
 *     if len(__pyx_state) > 69 and hasattr(__pyx_result, '__dict__'):
*/

static PyObject *__pyx_f_6nltkor_3tag_4libs_7network___pyx_unpickle_ConvolutionalNetwork__set_state(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  float __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  size_t __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[158]))
  __Pyx_RefNannySetupContext("__pyx_unpickle_ConvolutionalNetwork__set_state", 0);
  __Pyx_TraceStartFunc("__pyx_unpickle_ConvolutionalNetwork__set_state", __pyx_f[4], 11, 0, 0, 0, __PYX_ERR(4, 11, __pyx_L1_error));

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_ConvolutionalNetwork__set_state(ConvolutionalNetwork __pyx_result, tuple __pyx_state):
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.convolution_lookup = __pyx_state[2]; __pyx_result.decay_factor = __pyx_state[3]; __pyx_result.error = __pyx_state[4]; __pyx_result.feature_tables = __pyx_state[5]; __pyx_result.features_per_token = __pyx_state[6]; __pyx_result.float_errors = __pyx_state[7]; __pyx_result.half_window = __pyx_state[8]; __pyx_result.hidden2_before_activation = __pyx_state[9]; __pyx_result.hidden2_bias = __pyx_state[10]; __pyx_result.hidden2_gradients = __pyx_state[11]; __pyx_result.hidden2_size = __pyx_state[12]; __pyx_result.hidden2_values = __pyx_state[13]; __pyx_result.hidden2_weights = __pyx_state[14]; __pyx_result.hidden_before_activation = __pyx_state[15]; __pyx_result.hidden_bias = __pyx_state[16]; __pyx_result.hidden_gradients = __pyx_state[17]; __pyx_result.hidden_sent_values = __pyx_state[18]; __pyx_result.hidden_size = __pyx_state[19]; __pyx_result.hidden_values = __pyx_state[20]; __pyx_result.hidden_weights = __pyx_state[21]; __pyx_result.input_deltas = __pyx_state[22]; __pyx_result.input_sent_values = __pyx_state[23]; __pyx_result.input_size = __pyx_state[24]; __pyx_result.input_values = __pyx_state[25]; __pyx_result.layer2_sent_values = __pyx_state[26]; __pyx_result.layer2_values = __pyx_state[27]; __pyx_result.learning_rate = __pyx_state[28]; __pyx_result.learning_rate_features = __pyx_state[29]; __pyx_result.learning_rate_trans = __pyx_state[30]; __pyx_result.max_indices = __pyx_state[31]; __pyx_result.net_gradients = __pyx_state[32]; __pyx_result.network_filename = __pyx_state[33]; __pyx_result.network_text_filename = __pyx_state[34]; __pyx_result.num_sentences = __pyx_state[35]; __pyx_result.num_targets = __pyx_state[36]; __pyx_result.num_tokens = __pyx_state[37]; __pyx_result.only_classify = __pyx_state[38]; __pyx_result.output_bias = __pyx_state[39]; __pyx_result.output_size = __pyx_state[40]; __pyx_result.output_weights = __pyx_state[41]; __pyx_result.padding_left = __pyx_state[42]; __pyx_result.padding_right = __pyx_state[43]; __pyx_result.pos_padding = __pyx_state[44]; __pyx_result.pre_padding = __pyx_state[45]; __pyx_result.pred_convolution_lookup = __pyx_state[46]; __pyx_result.pred_dist_deltas = __pyx_state[47]; __pyx_result.pred_dist_lookup = __pyx_state[48]; __pyx_result.pred_dist_offset = __pyx_state[49]; __pyx_result.pred_dist_table = __pyx_state[50]; __pyx_result.pred_dist_weights = __pyx_state[51]; __pyx_result.sentence_accuracy = __pyx_state[52]; __pyx_result.sentence_lookup = __pyx_state[53]; __pyx_result.skips = __pyx_state[54]; __pyx_result.target_convolution_lookup = __pyx_state[55]; __pyx_result.target_dist_deltas = __pyx_state[56]; __pyx_result.target_dist_lookup = __pyx_state[57]; __pyx_result.target_dist_offset = __pyx_state[58]; __pyx_result.target_dist_table = __pyx_state[59]; __pyx_result.target_dist_weights = __pyx_state[60]; __pyx_result.trans_gradients = __pyx_state[61]; __pyx_result.transitions = __pyx_state[62]; __pyx_result.use_learning_rate_decay = __pyx_state[63]; __pyx_result.validation_arguments = __pyx_state[64]; __pyx_result.validation_predicates = __pyx_state[65]; __pyx_result.validation_sentences = __pyx_state[66]; __pyx_result.validation_tags = __pyx_state[67]; __pyx_result.word_window_size = __pyx_state[68]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 69 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[69])
*/
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.accuracy = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.answer_score = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->convolution_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->convolution_lookup);
  __pyx_v___pyx_result->convolution_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.decay_factor = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.error = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.feature_tables);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.feature_tables);
  __pyx_v___pyx_result->__pyx_base.feature_tables = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.features_per_token = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.float_errors = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->half_window = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->hidden2_before_activation);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->hidden2_before_activation);
  __pyx_v___pyx_result->hidden2_before_activation = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->hidden2_bias);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->hidden2_bias);
  __pyx_v___pyx_result->hidden2_bias = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->hidden2_gradients);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->hidden2_gradients);
  __pyx_v___pyx_result->hidden2_gradients = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->hidden2_size = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->hidden2_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->hidden2_values);
  __pyx_v___pyx_result->hidden2_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 14, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->hidden2_weights);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->hidden2_weights);
  __pyx_v___pyx_result->hidden2_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 15, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->hidden_before_activation);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->hidden_before_activation);
  __pyx_v___pyx_result->hidden_before_activation = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 16, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden_bias);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden_bias);
  __pyx_v___pyx_result->__pyx_base.hidden_bias = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 17, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->hidden_gradients);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->hidden_gradients);
  __pyx_v___pyx_result->hidden_gradients = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 18, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden_sent_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden_sent_values);
  __pyx_v___pyx_result->__pyx_base.hidden_sent_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 19, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.hidden_size = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 20, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden_values);
  __pyx_v___pyx_result->__pyx_base.hidden_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 21, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden_weights);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden_weights);
  __pyx_v___pyx_result->__pyx_base.hidden_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 22, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->input_deltas);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->input_deltas);
  __pyx_v___pyx_result->input_deltas = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 23, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.input_sent_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.input_sent_values);
  __pyx_v___pyx_result->__pyx_base.input_sent_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 24, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.input_size = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 25, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.input_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.input_values);
  __pyx_v___pyx_result->__pyx_base.input_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 26, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.layer2_sent_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.layer2_sent_values);
  __pyx_v___pyx_result->__pyx_base.layer2_sent_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 27, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.layer2_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.layer2_values);
  __pyx_v___pyx_result->__pyx_base.layer2_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 28, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.learning_rate = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 29, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.learning_rate_features = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 30, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.learning_rate_trans = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 31, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->max_indices);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->max_indices);
  __pyx_v___pyx_result->max_indices = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 32, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.net_gradients);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.net_gradients);
  __pyx_v___pyx_result->__pyx_base.net_gradients = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 33, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.network_filename);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.network_filename);
  __pyx_v___pyx_result->__pyx_base.network_filename = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 34, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.network_text_filename);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.network_text_filename);
  __pyx_v___pyx_result->__pyx_base.network_text_filename = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 35, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->num_sentences = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 36, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->num_targets = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 37, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.num_tokens = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 38, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->only_classify);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->only_classify);
  __pyx_v___pyx_result->only_classify = ((PyLongObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 39, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.output_bias);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.output_bias);
  __pyx_v___pyx_result->__pyx_base.output_bias = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 40, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.output_size = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 41, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.output_weights);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.output_weights);
  __pyx_v___pyx_result->__pyx_base.output_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 42, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.padding_left);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.padding_left);
  __pyx_v___pyx_result->__pyx_base.padding_left = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 43, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.padding_right);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.padding_right);
  __pyx_v___pyx_result->__pyx_base.padding_right = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 44, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.pos_padding);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.pos_padding);
  __pyx_v___pyx_result->__pyx_base.pos_padding = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 45, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.pre_padding);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.pre_padding);
  __pyx_v___pyx_result->__pyx_base.pre_padding = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 46, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->pred_convolution_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->pred_convolution_lookup);
  __pyx_v___pyx_result->pred_convolution_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 47, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->pred_dist_deltas);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->pred_dist_deltas);
  __pyx_v___pyx_result->pred_dist_deltas = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 48, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->pred_dist_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->pred_dist_lookup);
  __pyx_v___pyx_result->pred_dist_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 49, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->pred_dist_offset = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 50, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->pred_dist_table);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->pred_dist_table);
  __pyx_v___pyx_result->pred_dist_table = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 51, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->pred_dist_weights);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->pred_dist_weights);
  __pyx_v___pyx_result->pred_dist_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 52, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.sentence_accuracy = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 53, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.sentence_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.sentence_lookup);
  __pyx_v___pyx_result->__pyx_base.sentence_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 54, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.skips = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 55, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->target_convolution_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->target_convolution_lookup);
  __pyx_v___pyx_result->target_convolution_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 56, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->target_dist_deltas);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->target_dist_deltas);
  __pyx_v___pyx_result->target_dist_deltas = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 57, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->target_dist_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->target_dist_lookup);
  __pyx_v___pyx_result->target_dist_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 58, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->target_dist_offset = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 59, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->target_dist_table);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->target_dist_table);
  __pyx_v___pyx_result->target_dist_table = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 60, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->target_dist_weights);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->target_dist_weights);
  __pyx_v___pyx_result->target_dist_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 61, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.trans_gradients);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.trans_gradients);
  __pyx_v___pyx_result->__pyx_base.trans_gradients = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 62, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.transitions);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.transitions);
  __pyx_v___pyx_result->__pyx_base.transitions = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 63, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.use_learning_rate_decay);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.use_learning_rate_decay);
  __pyx_v___pyx_result->__pyx_base.use_learning_rate_decay = ((PyLongObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 64, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->validation_arguments);
  __Pyx_DECREF(__pyx_v___pyx_result->validation_arguments);
  __pyx_v___pyx_result->validation_arguments = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 65, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->validation_predicates);
  __Pyx_DECREF(__pyx_v___pyx_result->validation_predicates);
  __pyx_v___pyx_result->validation_predicates = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 66, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.validation_sentences);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.validation_sentences);
  __pyx_v___pyx_result->__pyx_base.validation_sentences = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 67, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.validation_tags);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.validation_tags);
  __pyx_v___pyx_result->__pyx_base.validation_tags = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 68, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.word_window_size = __pyx_t_3;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_ConvolutionalNetwork__set_state(ConvolutionalNetwork __pyx_result, tuple __pyx_state):
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.convolution_lookup = __pyx_state[2]; __pyx_result.decay_factor = __pyx_state[3]; __pyx_result.error = __pyx_state[4]; __pyx_result.feature_tables = __pyx_state[5]; __pyx_result.features_per_token = __pyx_state[6]; __pyx_result.float_errors = __pyx_state[7]; __pyx_result.half_window = __pyx_state[8]; __pyx_result.hidden2_before_activation = __pyx_state[9]; __pyx_result.hidden2_bias = __pyx_state[10]; __pyx_result.hidden2_gradients = __pyx_state[11]; __pyx_result.hidden2_size = __pyx_state[12]; __pyx_result.hidden2_values = __pyx_state[13]; __pyx_result.hidden2_weights = __pyx_state[14]; __pyx_result.hidden_before_activation = __pyx_state[15]; __pyx_result.hidden_bias = __pyx_state[16]; __pyx_result.hidden_gradients = __pyx_state[17]; __pyx_result.hidden_sent_values = __pyx_state[18]; __pyx_result.hidden_size = __pyx_state[19]; __pyx_result.hidden_values = __pyx_state[20]; __pyx_result.hidden_weights = __pyx_state[21]; __pyx_result.input_deltas = __pyx_state[22]; __pyx_result.input_sent_values = __pyx_state[23]; __pyx_result.input_size = __pyx_state[24]; __pyx_result.input_values = __pyx_state[25]; __pyx_result.layer2_sent_values = __pyx_state[26]; __pyx_result.layer2_values = __pyx_state[27]; __pyx_result.learning_rate = __pyx_state[28]; __pyx_result.learning_rate_features = __pyx_state[29]; __pyx_result.learning_rate_trans = __pyx_state[30]; __pyx_result.max_indices = __pyx_state[31]; __pyx_result.net_gradients = __pyx_state[32]; __pyx_result.network_filename = __pyx_state[33]; __pyx_result.network_text_filename = __pyx_state[34]; __pyx_result.num_sentences = __pyx_state[35]; __pyx_result.num_targets = __pyx_state[36]; __pyx_result.num_tokens = __pyx_state[37]; __pyx_result.only_classify = __pyx_state[38]; __pyx_result.output_bias = __pyx_state[39]; __pyx_result.output_size = __pyx_state[40]; __pyx_result.output_weights = __pyx_state[41]; __pyx_result.padding_left = __pyx_state[42]; __pyx_result.padding_right = __pyx_state[43]; __pyx_result.pos_padding = __pyx_state[44]; __pyx_result.pre_padding = __pyx_state[45]; __pyx_result.pred_convolution_lookup = __pyx_state[46]; __pyx_result.pred_dist_deltas = __pyx_state[47]; __pyx_result.pred_dist_lookup = __pyx_state[48]; __pyx_result.pred_dist_offset = __pyx_state[49]; __pyx_result.pred_dist_table = __pyx_state[50]; __pyx_result.pred_dist_weights = __pyx_state[51]; __pyx_result.sentence_accuracy = __pyx_state[52]; __pyx_result.sentence_lookup = __pyx_state[53]; __pyx_result.skips = __pyx_state[54]; __pyx_result.target_convolution_lookup = __pyx_state[55]; __pyx_result.target_dist_deltas = __pyx_state[56]; __pyx_result.target_dist_lookup = __pyx_state[57]; __pyx_result.target_dist_offset = __pyx_state[58]; __pyx_result.target_dist_table = __pyx_state[59]; __pyx_result.target_dist_weights = __pyx_state[60]; __pyx_result.trans_gradients = __pyx_state[61]; __pyx_result.transitions = __pyx_state[62]; __pyx_result.use_learning_rate_decay = __pyx_state[63]; __pyx_result.validation_arguments = __pyx_state[64]; __pyx_result.validation_predicates = __pyx_state[65]; __pyx_result.validation_sentences = __pyx_state[66]; __pyx_result.validation_tags = __pyx_state[67]; __pyx_result.word_window_size = __pyx_state[68]
 *     if len(__pyx_state) > 69 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[69])
*/
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(4, 13, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(4, 13, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_5 > 69);
  if (__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_mstate_global->__pyx_n_u_dict); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(4, 13, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_4) {

    /* "(tree fragment)":14
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.convolution_lookup = __pyx_state[2]; __pyx_result.decay_factor = __pyx_state[3]; __pyx_result.error = __pyx_state[4]; __pyx_result.feature_tables = __pyx_state[5]; __pyx_result.features_per_token = __pyx_state[6]; __pyx_result.float_errors = __pyx_state[7]; __pyx_result.half_window = __pyx_state[8]; __pyx_result.hidden2_before_activation = __pyx_state[9]; __pyx_result.hidden2_bias = __pyx_state[10]; __pyx_result.hidden2_gradients = __pyx_state[11]; __pyx_result.hidden2_size = __pyx_state[12]; __pyx_result.hidden2_values = __pyx_state[13]; __pyx_result.hidden2_weights = __pyx_state[14]; __pyx_result.hidden_before_activation = __pyx_state[15]; __pyx_result.hidden_bias = __pyx_state[16]; __pyx_result.hidden_gradients = __pyx_state[17]; __pyx_result.hidden_sent_values = __pyx_state[18]; __pyx_result.hidden_size = __pyx_state[19]; __pyx_result.hidden_values = __pyx_state[20]; __pyx_result.hidden_weights = __pyx_state[21]; __pyx_result.input_deltas = __pyx_state[22]; __pyx_result.input_sent_values = __pyx_state[23]; __pyx_result.input_size = __pyx_state[24]; __pyx_result.input_values = __pyx_state[25]; __pyx_result.layer2_sent_values = __pyx_state[26]; __pyx_result.layer2_values = __pyx_state[27]; __pyx_result.learning_rate = __pyx_state[28]; __pyx_result.learning_rate_features = __pyx_state[29]; __pyx_result.learning_rate_trans = __pyx_state[30]; __pyx_result.max_indices = __pyx_state[31]; __pyx_result.net_gradients = __pyx_state[32]; __pyx_result.network_filename = __pyx_state[33]; __pyx_result.network_text_filename = __pyx_state[34]; __pyx_result.num_sentences = __pyx_state[35]; __pyx_result.num_targets = __pyx_state[36]; __pyx_result.num_tokens = __pyx_state[37]; __pyx_result.only_classify = __pyx_state[38]; __pyx_result.output_bias = __pyx_state[39]; __pyx_result.output_size = __pyx_state[40]; __pyx_result.output_weights = __pyx_state[41]; __pyx_result.padding_left = __pyx_state[42]; __pyx_result.padding_right = __pyx_state[43]; __pyx_result.pos_padding = __pyx_state[44]; __pyx_result.pre_padding = __pyx_state[45]; __pyx_result.pred_convolution_lookup = __pyx_state[46]; __pyx_result.pred_dist_deltas = __pyx_state[47]; __pyx_result.pred_dist_lookup = __pyx_state[48]; __pyx_result.pred_dist_offset = __pyx_state[49]; __pyx_result.pred_dist_table = __pyx_state[50]; __pyx_result.pred_dist_weights = __pyx_state[51]; __pyx_result.sentence_accuracy = __pyx_state[52]; __pyx_result.sentence_lookup = __pyx_state[53]; __pyx_result.skips = __pyx_state[54]; __pyx_result.target_convolution_lookup = __pyx_state[55]; __pyx_result.target_dist_deltas = __pyx_state[56]; __pyx_result.target_dist_lookup = __pyx_state[57]; __pyx_result.target_dist_offset = __pyx_state[58]; __pyx_result.target_dist_table = __pyx_state[59]; __pyx_result.target_dist_weights = __pyx_state[60]; __pyx_result.trans_gradients = __pyx_state[61]; __pyx_result.transitions = __pyx_state[62]; __pyx_result.use_learning_rate_decay = __pyx_state[63]; __pyx_result.validation_arguments = __pyx_state[64]; __pyx_result.validation_predicates = __pyx_state[65]; __pyx_result.validation_sentences = __pyx_state[66]; __pyx_result.validation_tags = __pyx_state[67]; __pyx_result.word_window_size = __pyx_state[68]
 *     if len(__pyx_state) > 69 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[69])             # <<<<<<<<<<<<<<
*/
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_mstate_global->__pyx_n_u_dict); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = __pyx_t_8;
    __Pyx_INCREF(__pyx_t_7);
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(4, 14, __pyx_L1_error)
    }
    __pyx_t_9 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 69, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_9};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_update, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 14, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_ConvolutionalNetwork__set_state(ConvolutionalNetwork __pyx_result, tuple __pyx_state):
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.convolution_lookup = __pyx_state[2]; __pyx_result.decay_factor = __pyx_state[3]; __pyx_result.error = __pyx_state[4]; __pyx_result.feature_tables = __pyx_state[5]; __pyx_result.features_per_token = __pyx_state[6]; __pyx_result.float_errors = __pyx_state[7]; __pyx_result.half_window = __pyx_state[8]; __pyx_result.hidden2_before_activation = __pyx_state[9]; __pyx_result.hidden2_bias = __pyx_state[10]; __pyx_result.hidden2_gradients = __pyx_state[11]; __pyx_result.hidden2_size = __pyx_state[12]; __pyx_result.hidden2_values = __pyx_state[13]; __pyx_result.hidden2_weights = __pyx_state[14]; __pyx_result.hidden_before_activation = __pyx_state[15]; __pyx_result.hidden_bias = __pyx_state[16]; __pyx_result.hidden_gradients = __pyx_state[17]; __pyx_result.hidden_sent_values = __pyx_state[18]; __pyx_result.hidden_size = __pyx_state[19]; __pyx_result.hidden_values = __pyx_state[20]; __pyx_result.hidden_weights = __pyx_state[21]; __pyx_result.input_deltas = __pyx_state[22]; __pyx_result.input_sent_values = __pyx_state[23]; __pyx_result.input_size = __pyx_state[24]; __pyx_result.input_values = __pyx_state[25]; __pyx_result.layer2_sent_values = __pyx_state[26]; __pyx_result.layer2_values = __pyx_state[27]; __pyx_result.learning_rate = __pyx_state[28]; __pyx_result.learning_rate_features = __pyx_state[29]; __pyx_result.learning_rate_trans = __pyx_state[30]; __pyx_result.max_indices = __pyx_state[31]; __pyx_result.net_gradients = __pyx_state[32]; __pyx_result.network_filename = __pyx_state[33]; __pyx_result.network_text_filename = __pyx_state[34]; __pyx_result.num_sentences = __pyx_state[35]; __pyx_result.num_targets = __pyx_state[36]; __pyx_result.num_tokens = __pyx_state[37]; __pyx_result.only_classify = __pyx_state[38]; __pyx_result.output_bias = __pyx_state[39]; __pyx_result.output_size = __pyx_state[40]; __pyx_result.output_weights = __pyx_state[41]; __pyx_result.padding_left = __pyx_state[42]; __pyx_result.padding_right = __pyx_state[43]; __pyx_result.pos_padding = __pyx_state[44]; __pyx_result.pre_padding = __pyx_state[45]; __pyx_result.pred_convolution_lookup = __pyx_state[46]; __pyx_result.pred_dist_deltas = __pyx_state[47]; __pyx_result.pred_dist_lookup = __pyx_state[48]; __pyx_result.pred_dist_offset = __pyx_state[49]; __pyx_result.pred_dist_table = __pyx_state[50]; __pyx_result.pred_dist_weights = __pyx_state[51]; __pyx_result.sentence_accuracy = __pyx_state[52]; __pyx_result.sentence_lookup = __pyx_state[53]; __pyx_result.skips = __pyx_state[54]; __pyx_result.target_convolution_lookup = __pyx_state[55]; __pyx_result.target_dist_deltas = __pyx_state[56]; __pyx_result.target_dist_lookup = __pyx_state[57]; __pyx_result.target_dist_offset = __pyx_state[58]; __pyx_result.target_dist_table = __pyx_state[59]; __pyx_result.target_dist_weights = __pyx_state[60]; __pyx_result.trans_gradients = __pyx_state[61]; __pyx_result.transitions = __pyx_state[62]; __pyx_result.use_learning_rate_decay = __pyx_state[63]; __pyx_result.validation_arguments = __pyx_state[64]; __pyx_result.validation_predicates = __pyx_state[65]; __pyx_result.validation_sentences = __pyx_state[66]; __pyx_result.validation_tags = __pyx_state[67]; __pyx_result.word_window_size = __pyx_state[68]
 *     if len(__pyx_state) > 69 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[69])
*/
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_ConvolutionalNetwork__set_state(<ConvolutionalNetwork> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_ConvolutionalNetwork__set_state(ConvolutionalNetwork __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.convolution_lookup = __pyx_state[2]; __pyx_result.decay_factor = __pyx_state[3]; __pyx_result.error = __pyx_state[4]; __pyx_result.feature_tables = __pyx_state[5]; __pyx_result.features_per_token = __pyx_state[6]; __pyx_result.float_errors = __pyx_state[7]; __pyx_result.half_window = __pyx_state[8]; __pyx_result.hidden2_before_activation = __pyx_state[9]; __pyx_result.hidden2_bias = __pyx_state[10]; __pyx_result.hidden2_gradients = __pyx_state[11]; __pyx_result.hidden2_size = __pyx_state[12]; __pyx_result.hidden2_values = __pyx_state[13]; __pyx_result.hidden2_weights = __pyx_state[14]; __pyx_result.hidden_before_activation = __pyx_state[15]; __pyx_result.hidden_bias = __pyx_state[16]; __pyx_result.hidden_gradients = __pyx_state[17]; __pyx_result.hidden_sent_values = __pyx_state[18]; __pyx_result.hidden_size = __pyx_state[19]; __pyx_result.hidden_values = __pyx_state[20]; __pyx_result.hidden_weights = __pyx_state[21]; __pyx_result.input_deltas = __pyx_state[22]; __pyx_result.input_sent_values = __pyx_state[23]; __pyx_result.input_size = __pyx_state[24]; __pyx_result.input_values = __pyx_state[25]; __pyx_result.layer2_sent_values = __pyx_state[26]; __pyx_result.layer2_values = __pyx_state[27]; __pyx_result.learning_rate = __pyx_state[28]; __pyx_result.learning_rate_features = __pyx_state[29]; __pyx_result.learning_rate_trans = __pyx_state[30]; __pyx_result.max_indices = __pyx_state[31]; __pyx_result.net_gradients = __pyx_state[32]; __pyx_result.network_filename = __pyx_state[33]; __pyx_result.network_text_filename = __pyx_state[34]; __pyx_result.num_sentences = __pyx_state[35]; __pyx_result.num_targets = __pyx_state[36]; __pyx_result.num_tokens = __pyx_state[37]; __pyx_result.only_classify = __pyx_state[38]; __pyx_result.output_bias = __pyx_state[39]; __pyx_result.output_size = __pyx_state[40]; __pyx_result.output_weights = __pyx_state[41]; __pyx_result.padding_left = __pyx_state[42]; __pyx_result.padding_right = __pyx_state[43]; __pyx_result.pos_padding = __pyx_state[44]; __pyx_result.pre_padding = __pyx_state[45]; __pyx_result.pred_convolution_lookup = __pyx_state[46]; __pyx_result.pred_dist_deltas = __pyx_state[47]; __pyx_result.pred_dist_lookup = __pyx_state[48]; __pyx_result.pred_dist_offset = __pyx_state[49]; __pyx_result.pred_dist_table = __pyx_state[50]; __pyx_result.pred_dist_weights = __pyx_state[51]; __pyx_result.sentence_accuracy = __pyx_state[52]; __pyx_result.sentence_lookup = __pyx_state[53]; __pyx_result.skips = __pyx_state[54]; __pyx_result.target_convolution_lookup = __pyx_state[55]; __pyx_result.target_dist_deltas = __pyx_state[56]; __pyx_result.target_dist_lookup = __pyx_state[57]; __pyx_result.target_dist_offset = __pyx_state[58]; __pyx_result.target_dist_table = __pyx_state[59]; __pyx_result.target_dist_weights = __pyx_state[60]; __pyx_result.trans_gradients = __pyx_state[61]; __pyx_result.transitions = __pyx_state[62]; __pyx_result.use_learning_rate_decay = __pyx_state[63]; __pyx_result.validation_arguments = __pyx_state[64]; __pyx_result.validation_predicates = __pyx_state[65]; __pyx_result.validation_sentences = __pyx_state[66]; __pyx_result.validation_tags = __pyx_state[67]; __pyx_result.word_window_size = __pyx_state[68]
 *     if len(__pyx_state) > 69 and hasattr(__pyx_result, '__dict__'):
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(4, 11, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(4, 11, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.__pyx_unpickle_ConvolutionalNetwork__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_ConvolutionalDependencyNetwork(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
*/

/* Python wrapper */
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_5__pyx_unpickle_ConvolutionalDependencyNetwork(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6nltkor_3tag_4libs_7network_4__pyx_unpickle_ConvolutionalDependencyNetwork, "__pyx_unpickle_ConvolutionalDependencyNetwork(__pyx_type, long __pyx_checksum, __pyx_state)");
static PyMethodDef __pyx_mdef_6nltkor_3tag_4libs_7network_5__pyx_unpickle_ConvolutionalDependencyNetwork = {"__pyx_unpickle_ConvolutionalDependencyNetwork", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_5__pyx_unpickle_ConvolutionalDependencyNetwork, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_4__pyx_unpickle_ConvolutionalDependencyNetwork};
static PyObject *__pyx_pw_6nltkor_3tag_4libs_7network_5__pyx_unpickle_ConvolutionalDependencyNetwork(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_ConvolutionalDependencyNetwork (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 1, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(4, 1, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 1, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle_ConvolutionalDependencyNetwork", 0) < 0) __PYX_ERR(4, 1, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ConvolutionalDependencyNetwork", 1, 3, 3, i); __PYX_ERR(4, 1, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 1, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 1, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(4, 1, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(4, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ConvolutionalDependencyNetwork", 1, 3, 3, __pyx_nargs); __PYX_ERR(4, 1, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("nltkor.tag.libs.network.__pyx_unpickle_ConvolutionalDependencyNetwork", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6nltkor_3tag_4libs_7network_4__pyx_unpickle_ConvolutionalDependencyNetwork(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6nltkor_3tag_4libs_7network_4__pyx_unpickle_ConvolutionalDependencyNetwork(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[159]))
  __Pyx_RefNannySetupContext("__pyx_unpickle_ConvolutionalDependencyNetwork", 0);
  __Pyx_TraceStartFunc("__pyx_unpickle_ConvolutionalDependencyNetwork", __pyx_f[4], 1, 0, 0, 0, __PYX_ERR(4, 1, __pyx_L1_error));

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0xca52c1e, 0x8b21fc2, 0x1a87293):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xca52c1e, 0x8b21fc2, 0x1a87293) = (accuracy, answer_score, convolution_lookup, decay_factor, dependency_weights, error, feature_tables, features_per_token, float_errors, half_window, hidden2_before_activation, hidden2_bias, hidden2_gradients, hidden2_size, hidden2_values, hidden2_weights, hidden_before_activation, hidden_bias, hidden_gradients, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_deltas, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, max_indices, net_gradients, network_filename, network_text_filename, num_sentences, num_targets, num_tokens, only_classify, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, pred_convolution_lookup, pred_dist_deltas, pred_dist_lookup, pred_dist_offset, pred_dist_table, pred_dist_weights, sentence_accuracy, sentence_lookup, skips, target_convolution_lookup, target_dist_deltas, target_dist_lookup, target_dist_offset, target_dist_table, target_dist_weights, trans_gradients, transitions, use_learning_rate_decay, validation_arguments, validation_heads, validation_predicates, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
*/
  __pyx_t_1 = __Pyx_PyLong_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[4], Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0xca52c1e, 0x8b21fc2, 0x1a87293):
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xca52c1e, 0x8b21fc2, 0x1a87293) = (accuracy, answer_score, convolution_lookup, decay_factor, dependency_weights, error, feature_tables, features_per_token, float_errors, half_window, hidden2_before_activation, hidden2_bias, hidden2_gradients, hidden2_size, hidden2_values, hidden2_weights, hidden_before_activation, hidden_bias, hidden_gradients, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_deltas, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, max_indices, net_gradients, network_filename, network_text_filename, num_sentences, num_targets, num_tokens, only_classify, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, pred_convolution_lookup, pred_dist_deltas, pred_dist_lookup, pred_dist_offset, pred_dist_table, pred_dist_weights, sentence_accuracy, sentence_lookup, skips, target_convolution_lookup, target_dist_deltas, target_dist_lookup, target_dist_offset, target_dist_table, target_dist_weights, trans_gradients, transitions, use_learning_rate_decay, validation_arguments, validation_heads, validation_predicates, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
 *     __pyx_result = ConvolutionalDependencyNetwork.__new__(__pyx_type)
*/
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_PickleError);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_PickleError);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_n_u_PickleError) != (0)) __PYX_ERR(4, 5, __pyx_L1_error);
    __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_v___pyx_PickleError = __pyx_t_1;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum not in (0xca52c1e, 0x8b21fc2, 0x1a87293):
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xca52c1e, 0x8b21fc2, 0x1a87293) = (accuracy, answer_score, convolution_lookup, decay_factor, dependency_weights, error, feature_tables, features_per_token, float_errors, half_window, hidden2_before_activation, hidden2_bias, hidden2_gradients, hidden2_size, hidden2_values, hidden2_weights, hidden_before_activation, hidden_bias, hidden_gradients, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_deltas, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, max_indices, net_gradients, network_filename, network_text_filename, num_sentences, num_targets, num_tokens, only_classify, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, pred_convolution_lookup, pred_dist_deltas, pred_dist_lookup, pred_dist_offset, pred_dist_table, pred_dist_weights, sentence_accuracy, sentence_lookup, skips, target_convolution_lookup, target_dist_deltas, target_dist_lookup, target_dist_offset, target_dist_table, target_dist_weights, trans_gradients, transitions, use_learning_rate_decay, validation_arguments, validation_heads, validation_predicates, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum             # <<<<<<<<<<<<<<
 *     __pyx_result = ConvolutionalDependencyNetwork.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
    __pyx_t_3 = __Pyx_PyLong_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_Incompatible_checksums_0x_x_vs_0_3, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0xca52c1e, 0x8b21fc2, 0x1a87293):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xca52c1e, 0x8b21fc2, 0x1a87293) = (accuracy, answer_score, convolution_lookup, decay_factor, dependency_weights, error, feature_tables, features_per_token, float_errors, half_window, hidden2_before_activation, hidden2_bias, hidden2_gradients, hidden2_size, hidden2_values, hidden2_weights, hidden_before_activation, hidden_bias, hidden_gradients, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_deltas, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, max_indices, net_gradients, network_filename, network_text_filename, num_sentences, num_targets, num_tokens, only_classify, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, pred_convolution_lookup, pred_dist_deltas, pred_dist_lookup, pred_dist_offset, pred_dist_table, pred_dist_weights, sentence_accuracy, sentence_lookup, skips, target_convolution_lookup, target_dist_deltas, target_dist_lookup, target_dist_offset, target_dist_table, target_dist_weights, trans_gradients, transitions, use_learning_rate_decay, validation_arguments, validation_heads, validation_predicates, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
*/
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xca52c1e, 0x8b21fc2, 0x1a87293) = (accuracy, answer_score, convolution_lookup, decay_factor, dependency_weights, error, feature_tables, features_per_token, float_errors, half_window, hidden2_before_activation, hidden2_bias, hidden2_gradients, hidden2_size, hidden2_values, hidden2_weights, hidden_before_activation, hidden_bias, hidden_gradients, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_deltas, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, max_indices, net_gradients, network_filename, network_text_filename, num_sentences, num_targets, num_tokens, only_classify, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, pred_convolution_lookup, pred_dist_deltas, pred_dist_lookup, pred_dist_offset, pred_dist_table, pred_dist_weights, sentence_accuracy, sentence_lookup, skips, target_convolution_lookup, target_dist_deltas, target_dist_lookup, target_dist_offset, target_dist_table, target_dist_weights, trans_gradients, transitions, use_learning_rate_decay, validation_arguments, validation_heads, validation_predicates, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
 *     __pyx_result = ConvolutionalDependencyNetwork.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(<ConvolutionalDependencyNetwork> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v___pyx_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xca52c1e, 0x8b21fc2, 0x1a87293) = (accuracy, answer_score, convolution_lookup, decay_factor, dependency_weights, error, feature_tables, features_per_token, float_errors, half_window, hidden2_before_activation, hidden2_bias, hidden2_gradients, hidden2_size, hidden2_values, hidden2_weights, hidden_before_activation, hidden_bias, hidden_gradients, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_deltas, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, max_indices, net_gradients, network_filename, network_text_filename, num_sentences, num_targets, num_tokens, only_classify, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, pred_convolution_lookup, pred_dist_deltas, pred_dist_lookup, pred_dist_offset, pred_dist_table, pred_dist_weights, sentence_accuracy, sentence_lookup, skips, target_convolution_lookup, target_dist_deltas, target_dist_lookup, target_dist_offset, target_dist_table, target_dist_weights, trans_gradients, transitions, use_learning_rate_decay, validation_arguments, validation_heads, validation_predicates, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
 *     __pyx_result = ConvolutionalDependencyNetwork.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(<ConvolutionalDependencyNetwork> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_2 = (__pyx_v___pyx_state != Py_None);
  if (__pyx_t_2) {

    /* "(tree fragment)":9
 *     __pyx_result = ConvolutionalDependencyNetwork.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(<ConvolutionalDependencyNetwork> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(ConvolutionalDependencyNetwork __pyx_result, tuple __pyx_state):
*/
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(4, 9, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_6nltkor_3tag_4libs_7network___pyx_unpickle_ConvolutionalDependencyNetwork__set_state(((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xca52c1e, 0x8b21fc2, 0x1a87293) = (accuracy, answer_score, convolution_lookup, decay_factor, dependency_weights, error, feature_tables, features_per_token, float_errors, half_window, hidden2_before_activation, hidden2_bias, hidden2_gradients, hidden2_size, hidden2_values, hidden2_weights, hidden_before_activation, hidden_bias, hidden_gradients, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_deltas, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, max_indices, net_gradients, network_filename, network_text_filename, num_sentences, num_targets, num_tokens, only_classify, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, pred_convolution_lookup, pred_dist_deltas, pred_dist_lookup, pred_dist_offset, pred_dist_table, pred_dist_weights, sentence_accuracy, sentence_lookup, skips, target_convolution_lookup, target_dist_deltas, target_dist_lookup, target_dist_offset, target_dist_table, target_dist_weights, trans_gradients, transitions, use_learning_rate_decay, validation_arguments, validation_heads, validation_predicates, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
 *     __pyx_result = ConvolutionalDependencyNetwork.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(<ConvolutionalDependencyNetwork> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(<ConvolutionalDependencyNetwork> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(ConvolutionalDependencyNetwork __pyx_result, tuple __pyx_state):
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.convolution_lookup = __pyx_state[2]; __pyx_result.decay_factor = __pyx_state[3]; __pyx_result.dependency_weights = __pyx_state[4]; __pyx_result.error = __pyx_state[5]; __pyx_result.feature_tables = __pyx_state[6]; __pyx_result.features_per_token = __pyx_state[7]; __pyx_result.float_errors = __pyx_state[8]; __pyx_result.half_window = __pyx_state[9]; __pyx_result.hidden2_before_activation = __pyx_state[10]; __pyx_result.hidden2_bias = __pyx_state[11]; __pyx_result.hidden2_gradients = __pyx_state[12]; __pyx_result.hidden2_size = __pyx_state[13]; __pyx_result.hidden2_values = __pyx_state[14]; __pyx_result.hidden2_weights = __pyx_state[15]; __pyx_result.hidden_before_activation = __pyx_state[16]; __pyx_result.hidden_bias = __pyx_state[17]; __pyx_result.hidden_gradients = __pyx_state[18]; __pyx_result.hidden_sent_values = __pyx_state[19]; __pyx_result.hidden_size = __pyx_state[20]; __pyx_result.hidden_values = __pyx_state[21]; __pyx_result.hidden_weights = __pyx_state[22]; __pyx_result.input_deltas = __pyx_state[23]; __pyx_result.input_sent_values = __pyx_state[24]; __pyx_result.input_size = __pyx_state[25]; __pyx_result.input_values = __pyx_state[26]; __pyx_result.layer2_sent_values = __pyx_state[27]; __pyx_result.layer2_values = __pyx_state[28]; __pyx_result.learning_rate = __pyx_state[29]; __pyx_result.learning_rate_features = __pyx_state[30]; __pyx_result.learning_rate_trans = __pyx_state[31]; __pyx_result.max_indices = __pyx_state[32]; __pyx_result.net_gradients = __pyx_state[33]; __pyx_result.network_filename = __pyx_state[34]; __pyx_result.network_text_filename = __pyx_state[35]; __pyx_result.num_sentences = __pyx_state[36]; __pyx_result.num_targets = __pyx_state[37]; __pyx_result.num_tokens = __pyx_state[38]; __pyx_result.only_classify = __pyx_state[39]; __pyx_result.output_bias = __pyx_state[40]; __pyx_result.output_size = __pyx_state[41]; __pyx_result.output_weights = __pyx_state[42]; __pyx_result.padding_left = __pyx_state[43]; __pyx_result.padding_right = __pyx_state[44]; __pyx_result.pos_padding = __pyx_state[45]; __pyx_result.pre_padding = __pyx_state[46]; __pyx_result.pred_convolution_lookup = __pyx_state[47]; __pyx_result.pred_dist_deltas = __pyx_state[48]; __pyx_result.pred_dist_lookup = __pyx_state[49]; __pyx_result.pred_dist_offset = __pyx_state[50]; __pyx_result.pred_dist_table = __pyx_state[51]; __pyx_result.pred_dist_weights = __pyx_state[52]; __pyx_result.sentence_accuracy = __pyx_state[53]; __pyx_result.sentence_lookup = __pyx_state[54]; __pyx_result.skips = __pyx_state[55]; __pyx_result.target_convolution_lookup = __pyx_state[56]; __pyx_result.target_dist_deltas = __pyx_state[57]; __pyx_result.target_dist_lookup = __pyx_state[58]; __pyx_result.target_dist_offset = __pyx_state[59]; __pyx_result.target_dist_table = __pyx_state[60]; __pyx_result.target_dist_weights = __pyx_state[61]; __pyx_result.trans_gradients = __pyx_state[62]; __pyx_result.transitions = __pyx_state[63]; __pyx_result.use_learning_rate_decay = __pyx_state[64]; __pyx_result.validation_arguments = __pyx_state[65]; __pyx_result.validation_heads = __pyx_state[66]; __pyx_result.validation_predicates = __pyx_state[67]; __pyx_result.validation_sentences = __pyx_state[68]; __pyx_result.validation_tags = __pyx_state[69]; __pyx_result.word_window_size = __pyx_state[70]
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  __Pyx_TraceReturnValue(__pyx_r, 29, 0, __PYX_ERR(4, 10, __pyx_L1_error));
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_ConvolutionalDependencyNetwork(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(4, 1, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.__pyx_unpickle_ConvolutionalDependencyNetwork", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(<ConvolutionalDependencyNetwork> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(ConvolutionalDependencyNetwork __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.convolution_lookup = __pyx_state[2]; __pyx_result.decay_factor = __pyx_state[3]; __pyx_result.dependency_weights = __pyx_state[4]; __pyx_result.error = __pyx_state[5]; __pyx_result.feature_tables = __pyx_state[6]; __pyx_result.features_per_token = __pyx_state[7]; __pyx_result.float_errors = __pyx_state[8]; __pyx_result.half_window = __pyx_state[9]; __pyx_result.hidden2_before_activation = __pyx_state[10]; __pyx_result.hidden2_bias = __pyx_state[11]; __pyx_result.hidden2_gradients = __pyx_state[12]; __pyx_result.hidden2_size = __pyx_state[13]; __pyx_result.hidden2_values = __pyx_state[14]; __pyx_result.hidden2_weights = __pyx_state[15]; __pyx_result.hidden_before_activation = __pyx_state[16]; __pyx_result.hidden_bias = __pyx_state[17]; __pyx_result.hidden_gradients = __pyx_state[18]; __pyx_result.hidden_sent_values = __pyx_state[19]; __pyx_result.hidden_size = __pyx_state[20]; __pyx_result.hidden_values = __pyx_state[21]; __pyx_result.hidden_weights = __pyx_state[22]; __pyx_result.input_deltas = __pyx_state[23]; __pyx_result.input_sent_values = __pyx_state[24]; __pyx_result.input_size = __pyx_state[25]; __pyx_result.input_values = __pyx_state[26]; __pyx_result.layer2_sent_values = __pyx_state[27]; __pyx_result.layer2_values = __pyx_state[28]; __pyx_result.learning_rate = __pyx_state[29]; __pyx_result.learning_rate_features = __pyx_state[30]; __pyx_result.learning_rate_trans = __pyx_state[31]; __pyx_result.max_indices = __pyx_state[32]; __pyx_result.net_gradients = __pyx_state[33]; __pyx_result.network_filename = __pyx_state[34]; __pyx_result.network_text_filename = __pyx_state[35]; __pyx_result.num_sentences = __pyx_state[36]; __pyx_result.num_targets = __pyx_state[37]; __pyx_result.num_tokens = __pyx_state[38]; __pyx_result.only_classify = __pyx_state[39]; __pyx_result.output_bias = __pyx_state[40]; __pyx_result.output_size = __pyx_state[41]; __pyx_result.output_weights = __pyx_state[42]; __pyx_result.padding_left = __pyx_state[43]; __pyx_result.padding_right = __pyx_state[44]; __pyx_result.pos_padding = __pyx_state[45]; __pyx_result.pre_padding = __pyx_state[46]; __pyx_result.pred_convolution_lookup = __pyx_state[47]; __pyx_result.pred_dist_deltas = __pyx_state[48]; __pyx_result.pred_dist_lookup = __pyx_state[49]; __pyx_result.pred_dist_offset = __pyx_state[50]; __pyx_result.pred_dist_table = __pyx_state[51]; __pyx_result.pred_dist_weights = __pyx_state[52]; __pyx_result.sentence_accuracy = __pyx_state[53]; __pyx_result.sentence_lookup = __pyx_state[54]; __pyx_result.skips = __pyx_state[55]; __pyx_result.target_convolution_lookup = __pyx_state[56]; __pyx_result.target_dist_deltas = __pyx_state[57]; __pyx_result.target_dist_lookup = __pyx_state[58]; __pyx_result.target_dist_offset = __pyx_state[59]; __pyx_result.target_dist_table = __pyx_state[60]; __pyx_result.target_dist_weights = __pyx_state[61]; __pyx_result.trans_gradients = __pyx_state[62]; __pyx_result.transitions = __pyx_state[63]; __pyx_result.use_learning_rate_decay = __pyx_state[64]; __pyx_result.validation_arguments = __pyx_state[65]; __pyx_result.validation_heads = __pyx_state[66]; __pyx_result.validation_predicates = __pyx_state[67]; __pyx_result.validation_sentences = __pyx_state[68]; __pyx_result.validation_tags = __pyx_state[69]; __pyx_result.word_window_size = __pyx_state[70]
 *     if len(__pyx_state) > 71 and hasattr(__pyx_result, '__dict__'):
*/

static PyObject *__pyx_f_6nltkor_3tag_4libs_7network___pyx_unpickle_ConvolutionalDependencyNetwork__set_state(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarationsFunc
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  float __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  size_t __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[160]))
  __Pyx_RefNannySetupContext("__pyx_unpickle_ConvolutionalDependencyNetwork__set_state", 0);
  __Pyx_TraceStartFunc("__pyx_unpickle_ConvolutionalDependencyNetwork__set_state", __pyx_f[4], 11, 0, 0, 0, __PYX_ERR(4, 11, __pyx_L1_error));

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(ConvolutionalDependencyNetwork __pyx_result, tuple __pyx_state):
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.convolution_lookup = __pyx_state[2]; __pyx_result.decay_factor = __pyx_state[3]; __pyx_result.dependency_weights = __pyx_state[4]; __pyx_result.error = __pyx_state[5]; __pyx_result.feature_tables = __pyx_state[6]; __pyx_result.features_per_token = __pyx_state[7]; __pyx_result.float_errors = __pyx_state[8]; __pyx_result.half_window = __pyx_state[9]; __pyx_result.hidden2_before_activation = __pyx_state[10]; __pyx_result.hidden2_bias = __pyx_state[11]; __pyx_result.hidden2_gradients = __pyx_state[12]; __pyx_result.hidden2_size = __pyx_state[13]; __pyx_result.hidden2_values = __pyx_state[14]; __pyx_result.hidden2_weights = __pyx_state[15]; __pyx_result.hidden_before_activation = __pyx_state[16]; __pyx_result.hidden_bias = __pyx_state[17]; __pyx_result.hidden_gradients = __pyx_state[18]; __pyx_result.hidden_sent_values = __pyx_state[19]; __pyx_result.hidden_size = __pyx_state[20]; __pyx_result.hidden_values = __pyx_state[21]; __pyx_result.hidden_weights = __pyx_state[22]; __pyx_result.input_deltas = __pyx_state[23]; __pyx_result.input_sent_values = __pyx_state[24]; __pyx_result.input_size = __pyx_state[25]; __pyx_result.input_values = __pyx_state[26]; __pyx_result.layer2_sent_values = __pyx_state[27]; __pyx_result.layer2_values = __pyx_state[28]; __pyx_result.learning_rate = __pyx_state[29]; __pyx_result.learning_rate_features = __pyx_state[30]; __pyx_result.learning_rate_trans = __pyx_state[31]; __pyx_result.max_indices = __pyx_state[32]; __pyx_result.net_gradients = __pyx_state[33]; __pyx_result.network_filename = __pyx_state[34]; __pyx_result.network_text_filename = __pyx_state[35]; __pyx_result.num_sentences = __pyx_state[36]; __pyx_result.num_targets = __pyx_state[37]; __pyx_result.num_tokens = __pyx_state[38]; __pyx_result.only_classify = __pyx_state[39]; __pyx_result.output_bias = __pyx_state[40]; __pyx_result.output_size = __pyx_state[41]; __pyx_result.output_weights = __pyx_state[42]; __pyx_result.padding_left = __pyx_state[43]; __pyx_result.padding_right = __pyx_state[44]; __pyx_result.pos_padding = __pyx_state[45]; __pyx_result.pre_padding = __pyx_state[46]; __pyx_result.pred_convolution_lookup = __pyx_state[47]; __pyx_result.pred_dist_deltas = __pyx_state[48]; __pyx_result.pred_dist_lookup = __pyx_state[49]; __pyx_result.pred_dist_offset = __pyx_state[50]; __pyx_result.pred_dist_table = __pyx_state[51]; __pyx_result.pred_dist_weights = __pyx_state[52]; __pyx_result.sentence_accuracy = __pyx_state[53]; __pyx_result.sentence_lookup = __pyx_state[54]; __pyx_result.skips = __pyx_state[55]; __pyx_result.target_convolution_lookup = __pyx_state[56]; __pyx_result.target_dist_deltas = __pyx_state[57]; __pyx_result.target_dist_lookup = __pyx_state[58]; __pyx_result.target_dist_offset = __pyx_state[59]; __pyx_result.target_dist_table = __pyx_state[60]; __pyx_result.target_dist_weights = __pyx_state[61]; __pyx_result.trans_gradients = __pyx_state[62]; __pyx_result.transitions = __pyx_state[63]; __pyx_result.use_learning_rate_decay = __pyx_state[64]; __pyx_result.validation_arguments = __pyx_state[65]; __pyx_result.validation_heads = __pyx_state[66]; __pyx_result.validation_predicates = __pyx_state[67]; __pyx_result.validation_sentences = __pyx_state[68]; __pyx_result.validation_tags = __pyx_state[69]; __pyx_result.word_window_size = __pyx_state[70]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 71 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[71])
*/
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.__pyx_base.accuracy = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.__pyx_base.answer_score = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.convolution_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.convolution_lookup);
  __pyx_v___pyx_result->__pyx_base.convolution_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.__pyx_base.decay_factor = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->dependency_weights);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->dependency_weights);
  __pyx_v___pyx_result->dependency_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.__pyx_base.error = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.__pyx_base.feature_tables);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.__pyx_base.feature_tables);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.feature_tables = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.__pyx_base.features_per_token = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.__pyx_base.float_errors = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.half_window = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden2_before_activation);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden2_before_activation);
  __pyx_v___pyx_result->__pyx_base.hidden2_before_activation = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden2_bias);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden2_bias);
  __pyx_v___pyx_result->__pyx_base.hidden2_bias = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden2_gradients);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden2_gradients);
  __pyx_v___pyx_result->__pyx_base.hidden2_gradients = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.hidden2_size = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 14, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden2_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden2_values);
  __pyx_v___pyx_result->__pyx_base.hidden2_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 15, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden2_weights);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden2_weights);
  __pyx_v___pyx_result->__pyx_base.hidden2_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 16, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden_before_activation);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden_before_activation);
  __pyx_v___pyx_result->__pyx_base.hidden_before_activation = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 17, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.hidden_bias);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.hidden_bias);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.hidden_bias = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 18, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden_gradients);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.hidden_gradients);
  __pyx_v___pyx_result->__pyx_base.hidden_gradients = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 19, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.hidden_sent_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.hidden_sent_values);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.hidden_sent_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 20, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.__pyx_base.hidden_size = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 21, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.hidden_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.hidden_values);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.hidden_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 22, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.hidden_weights);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.hidden_weights);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.hidden_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 23, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.input_deltas);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.input_deltas);
  __pyx_v___pyx_result->__pyx_base.input_deltas = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 24, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.input_sent_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.input_sent_values);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.input_sent_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 25, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.__pyx_base.input_size = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 26, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.input_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.input_values);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.input_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 27, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.layer2_sent_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.layer2_sent_values);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.layer2_sent_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 28, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.layer2_values);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.layer2_values);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.layer2_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 29, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.__pyx_base.learning_rate = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 30, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.__pyx_base.learning_rate_features = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 31, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.__pyx_base.learning_rate_trans = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 32, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.max_indices);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.max_indices);
  __pyx_v___pyx_result->__pyx_base.max_indices = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 33, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.net_gradients);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.net_gradients);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.net_gradients = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 34, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.__pyx_base.network_filename);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.__pyx_base.network_filename);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.network_filename = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 35, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.__pyx_base.network_text_filename);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.__pyx_base.network_text_filename);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.network_text_filename = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 36, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.num_sentences = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 37, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.num_targets = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 38, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.__pyx_base.num_tokens = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 39, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.only_classify);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.only_classify);
  __pyx_v___pyx_result->__pyx_base.only_classify = ((PyLongObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 40, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.output_bias);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.output_bias);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.output_bias = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 41, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.__pyx_base.output_size = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 42, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.output_weights);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.output_weights);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.output_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 43, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.padding_left);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.padding_left);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.padding_left = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 44, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.padding_right);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.padding_right);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.padding_right = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 45, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.pos_padding);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.pos_padding);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.pos_padding = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 46, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.pre_padding);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.pre_padding);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.pre_padding = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 47, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.pred_convolution_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.pred_convolution_lookup);
  __pyx_v___pyx_result->__pyx_base.pred_convolution_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 48, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.pred_dist_deltas);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.pred_dist_deltas);
  __pyx_v___pyx_result->__pyx_base.pred_dist_deltas = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 49, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.pred_dist_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.pred_dist_lookup);
  __pyx_v___pyx_result->__pyx_base.pred_dist_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 50, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.pred_dist_offset = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 51, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.pred_dist_table);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.pred_dist_table);
  __pyx_v___pyx_result->__pyx_base.pred_dist_table = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 52, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.pred_dist_weights);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.pred_dist_weights);
  __pyx_v___pyx_result->__pyx_base.pred_dist_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 53, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.__pyx_base.sentence_accuracy = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 54, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.sentence_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.sentence_lookup);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.sentence_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 55, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.__pyx_base.skips = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 56, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.target_convolution_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.target_convolution_lookup);
  __pyx_v___pyx_result->__pyx_base.target_convolution_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 57, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.target_dist_deltas);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.target_dist_deltas);
  __pyx_v___pyx_result->__pyx_base.target_dist_deltas = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 58, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.target_dist_lookup);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.target_dist_lookup);
  __pyx_v___pyx_result->__pyx_base.target_dist_lookup = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 59, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.target_dist_offset = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 60, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.target_dist_table);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.target_dist_table);
  __pyx_v___pyx_result->__pyx_base.target_dist_table = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 61, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.target_dist_weights);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.target_dist_weights);
  __pyx_v___pyx_result->__pyx_base.target_dist_weights = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 62, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.trans_gradients);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.trans_gradients);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.trans_gradients = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 63, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.transitions);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.transitions);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.transitions = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 64, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool))))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.use_learning_rate_decay);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.__pyx_base.use_learning_rate_decay);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.use_learning_rate_decay = ((PyLongObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 65, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.validation_arguments);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.validation_arguments);
  __pyx_v___pyx_result->__pyx_base.validation_arguments = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 66, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->validation_heads);
  __Pyx_DECREF(__pyx_v___pyx_result->validation_heads);
  __pyx_v___pyx_result->validation_heads = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 67, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.validation_predicates);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.validation_predicates);
  __pyx_v___pyx_result->__pyx_base.validation_predicates = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 68, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.__pyx_base.validation_sentences);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.__pyx_base.validation_sentences);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.validation_sentences = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 69, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.__pyx_base.validation_tags);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.__pyx_base.validation_tags);
  __pyx_v___pyx_result->__pyx_base.__pyx_base.validation_tags = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 70, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.__pyx_base.word_window_size = __pyx_t_3;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(ConvolutionalDependencyNetwork __pyx_result, tuple __pyx_state):
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.convolution_lookup = __pyx_state[2]; __pyx_result.decay_factor = __pyx_state[3]; __pyx_result.dependency_weights = __pyx_state[4]; __pyx_result.error = __pyx_state[5]; __pyx_result.feature_tables = __pyx_state[6]; __pyx_result.features_per_token = __pyx_state[7]; __pyx_result.float_errors = __pyx_state[8]; __pyx_result.half_window = __pyx_state[9]; __pyx_result.hidden2_before_activation = __pyx_state[10]; __pyx_result.hidden2_bias = __pyx_state[11]; __pyx_result.hidden2_gradients = __pyx_state[12]; __pyx_result.hidden2_size = __pyx_state[13]; __pyx_result.hidden2_values = __pyx_state[14]; __pyx_result.hidden2_weights = __pyx_state[15]; __pyx_result.hidden_before_activation = __pyx_state[16]; __pyx_result.hidden_bias = __pyx_state[17]; __pyx_result.hidden_gradients = __pyx_state[18]; __pyx_result.hidden_sent_values = __pyx_state[19]; __pyx_result.hidden_size = __pyx_state[20]; __pyx_result.hidden_values = __pyx_state[21]; __pyx_result.hidden_weights = __pyx_state[22]; __pyx_result.input_deltas = __pyx_state[23]; __pyx_result.input_sent_values = __pyx_state[24]; __pyx_result.input_size = __pyx_state[25]; __pyx_result.input_values = __pyx_state[26]; __pyx_result.layer2_sent_values = __pyx_state[27]; __pyx_result.layer2_values = __pyx_state[28]; __pyx_result.learning_rate = __pyx_state[29]; __pyx_result.learning_rate_features = __pyx_state[30]; __pyx_result.learning_rate_trans = __pyx_state[31]; __pyx_result.max_indices = __pyx_state[32]; __pyx_result.net_gradients = __pyx_state[33]; __pyx_result.network_filename = __pyx_state[34]; __pyx_result.network_text_filename = __pyx_state[35]; __pyx_result.num_sentences = __pyx_state[36]; __pyx_result.num_targets = __pyx_state[37]; __pyx_result.num_tokens = __pyx_state[38]; __pyx_result.only_classify = __pyx_state[39]; __pyx_result.output_bias = __pyx_state[40]; __pyx_result.output_size = __pyx_state[41]; __pyx_result.output_weights = __pyx_state[42]; __pyx_result.padding_left = __pyx_state[43]; __pyx_result.padding_right = __pyx_state[44]; __pyx_result.pos_padding = __pyx_state[45]; __pyx_result.pre_padding = __pyx_state[46]; __pyx_result.pred_convolution_lookup = __pyx_state[47]; __pyx_result.pred_dist_deltas = __pyx_state[48]; __pyx_result.pred_dist_lookup = __pyx_state[49]; __pyx_result.pred_dist_offset = __pyx_state[50]; __pyx_result.pred_dist_table = __pyx_state[51]; __pyx_result.pred_dist_weights = __pyx_state[52]; __pyx_result.sentence_accuracy = __pyx_state[53]; __pyx_result.sentence_lookup = __pyx_state[54]; __pyx_result.skips = __pyx_state[55]; __pyx_result.target_convolution_lookup = __pyx_state[56]; __pyx_result.target_dist_deltas = __pyx_state[57]; __pyx_result.target_dist_lookup = __pyx_state[58]; __pyx_result.target_dist_offset = __pyx_state[59]; __pyx_result.target_dist_table = __pyx_state[60]; __pyx_result.target_dist_weights = __pyx_state[61]; __pyx_result.trans_gradients = __pyx_state[62]; __pyx_result.transitions = __pyx_state[63]; __pyx_result.use_learning_rate_decay = __pyx_state[64]; __pyx_result.validation_arguments = __pyx_state[65]; __pyx_result.validation_heads = __pyx_state[66]; __pyx_result.validation_predicates = __pyx_state[67]; __pyx_result.validation_sentences = __pyx_state[68]; __pyx_result.validation_tags = __pyx_state[69]; __pyx_result.word_window_size = __pyx_state[70]
 *     if len(__pyx_state) > 71 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[71])
*/
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(4, 13, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(4, 13, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_5 > 71);
  if (__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_mstate_global->__pyx_n_u_dict); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(4, 13, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_4) {

    /* "(tree fragment)":14
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.convolution_lookup = __pyx_state[2]; __pyx_result.decay_factor = __pyx_state[3]; __pyx_result.dependency_weights = __pyx_state[4]; __pyx_result.error = __pyx_state[5]; __pyx_result.feature_tables = __pyx_state[6]; __pyx_result.features_per_token = __pyx_state[7]; __pyx_result.float_errors = __pyx_state[8]; __pyx_result.half_window = __pyx_state[9]; __pyx_result.hidden2_before_activation = __pyx_state[10]; __pyx_result.hidden2_bias = __pyx_state[11]; __pyx_result.hidden2_gradients = __pyx_state[12]; __pyx_result.hidden2_size = __pyx_state[13]; __pyx_result.hidden2_values = __pyx_state[14]; __pyx_result.hidden2_weights = __pyx_state[15]; __pyx_result.hidden_before_activation = __pyx_state[16]; __pyx_result.hidden_bias = __pyx_state[17]; __pyx_result.hidden_gradients = __pyx_state[18]; __pyx_result.hidden_sent_values = __pyx_state[19]; __pyx_result.hidden_size = __pyx_state[20]; __pyx_result.hidden_values = __pyx_state[21]; __pyx_result.hidden_weights = __pyx_state[22]; __pyx_result.input_deltas = __pyx_state[23]; __pyx_result.input_sent_values = __pyx_state[24]; __pyx_result.input_size = __pyx_state[25]; __pyx_result.input_values = __pyx_state[26]; __pyx_result.layer2_sent_values = __pyx_state[27]; __pyx_result.layer2_values = __pyx_state[28]; __pyx_result.learning_rate = __pyx_state[29]; __pyx_result.learning_rate_features = __pyx_state[30]; __pyx_result.learning_rate_trans = __pyx_state[31]; __pyx_result.max_indices = __pyx_state[32]; __pyx_result.net_gradients = __pyx_state[33]; __pyx_result.network_filename = __pyx_state[34]; __pyx_result.network_text_filename = __pyx_state[35]; __pyx_result.num_sentences = __pyx_state[36]; __pyx_result.num_targets = __pyx_state[37]; __pyx_result.num_tokens = __pyx_state[38]; __pyx_result.only_classify = __pyx_state[39]; __pyx_result.output_bias = __pyx_state[40]; __pyx_result.output_size = __pyx_state[41]; __pyx_result.output_weights = __pyx_state[42]; __pyx_result.padding_left = __pyx_state[43]; __pyx_result.padding_right = __pyx_state[44]; __pyx_result.pos_padding = __pyx_state[45]; __pyx_result.pre_padding = __pyx_state[46]; __pyx_result.pred_convolution_lookup = __pyx_state[47]; __pyx_result.pred_dist_deltas = __pyx_state[48]; __pyx_result.pred_dist_lookup = __pyx_state[49]; __pyx_result.pred_dist_offset = __pyx_state[50]; __pyx_result.pred_dist_table = __pyx_state[51]; __pyx_result.pred_dist_weights = __pyx_state[52]; __pyx_result.sentence_accuracy = __pyx_state[53]; __pyx_result.sentence_lookup = __pyx_state[54]; __pyx_result.skips = __pyx_state[55]; __pyx_result.target_convolution_lookup = __pyx_state[56]; __pyx_result.target_dist_deltas = __pyx_state[57]; __pyx_result.target_dist_lookup = __pyx_state[58]; __pyx_result.target_dist_offset = __pyx_state[59]; __pyx_result.target_dist_table = __pyx_state[60]; __pyx_result.target_dist_weights = __pyx_state[61]; __pyx_result.trans_gradients = __pyx_state[62]; __pyx_result.transitions = __pyx_state[63]; __pyx_result.use_learning_rate_decay = __pyx_state[64]; __pyx_result.validation_arguments = __pyx_state[65]; __pyx_result.validation_heads = __pyx_state[66]; __pyx_result.validation_predicates = __pyx_state[67]; __pyx_result.validation_sentences = __pyx_state[68]; __pyx_result.validation_tags = __pyx_state[69]; __pyx_result.word_window_size = __pyx_state[70]
 *     if len(__pyx_state) > 71 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[71])             # <<<<<<<<<<<<<<
*/
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_mstate_global->__pyx_n_u_dict); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = __pyx_t_8;
    __Pyx_INCREF(__pyx_t_7);
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(4, 14, __pyx_L1_error)
    }
    __pyx_t_9 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 71, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_9};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_update, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 14, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(ConvolutionalDependencyNetwork __pyx_result, tuple __pyx_state):
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.convolution_lookup = __pyx_state[2]; __pyx_result.decay_factor = __pyx_state[3]; __pyx_result.dependency_weights = __pyx_state[4]; __pyx_result.error = __pyx_state[5]; __pyx_result.feature_tables = __pyx_state[6]; __pyx_result.features_per_token = __pyx_state[7]; __pyx_result.float_errors = __pyx_state[8]; __pyx_result.half_window = __pyx_state[9]; __pyx_result.hidden2_before_activation = __pyx_state[10]; __pyx_result.hidden2_bias = __pyx_state[11]; __pyx_result.hidden2_gradients = __pyx_state[12]; __pyx_result.hidden2_size = __pyx_state[13]; __pyx_result.hidden2_values = __pyx_state[14]; __pyx_result.hidden2_weights = __pyx_state[15]; __pyx_result.hidden_before_activation = __pyx_state[16]; __pyx_result.hidden_bias = __pyx_state[17]; __pyx_result.hidden_gradients = __pyx_state[18]; __pyx_result.hidden_sent_values = __pyx_state[19]; __pyx_result.hidden_size = __pyx_state[20]; __pyx_result.hidden_values = __pyx_state[21]; __pyx_result.hidden_weights = __pyx_state[22]; __pyx_result.input_deltas = __pyx_state[23]; __pyx_result.input_sent_values = __pyx_state[24]; __pyx_result.input_size = __pyx_state[25]; __pyx_result.input_values = __pyx_state[26]; __pyx_result.layer2_sent_values = __pyx_state[27]; __pyx_result.layer2_values = __pyx_state[28]; __pyx_result.learning_rate = __pyx_state[29]; __pyx_result.learning_rate_features = __pyx_state[30]; __pyx_result.learning_rate_trans = __pyx_state[31]; __pyx_result.max_indices = __pyx_state[32]; __pyx_result.net_gradients = __pyx_state[33]; __pyx_result.network_filename = __pyx_state[34]; __pyx_result.network_text_filename = __pyx_state[35]; __pyx_result.num_sentences = __pyx_state[36]; __pyx_result.num_targets = __pyx_state[37]; __pyx_result.num_tokens = __pyx_state[38]; __pyx_result.only_classify = __pyx_state[39]; __pyx_result.output_bias = __pyx_state[40]; __pyx_result.output_size = __pyx_state[41]; __pyx_result.output_weights = __pyx_state[42]; __pyx_result.padding_left = __pyx_state[43]; __pyx_result.padding_right = __pyx_state[44]; __pyx_result.pos_padding = __pyx_state[45]; __pyx_result.pre_padding = __pyx_state[46]; __pyx_result.pred_convolution_lookup = __pyx_state[47]; __pyx_result.pred_dist_deltas = __pyx_state[48]; __pyx_result.pred_dist_lookup = __pyx_state[49]; __pyx_result.pred_dist_offset = __pyx_state[50]; __pyx_result.pred_dist_table = __pyx_state[51]; __pyx_result.pred_dist_weights = __pyx_state[52]; __pyx_result.sentence_accuracy = __pyx_state[53]; __pyx_result.sentence_lookup = __pyx_state[54]; __pyx_result.skips = __pyx_state[55]; __pyx_result.target_convolution_lookup = __pyx_state[56]; __pyx_result.target_dist_deltas = __pyx_state[57]; __pyx_result.target_dist_lookup = __pyx_state[58]; __pyx_result.target_dist_offset = __pyx_state[59]; __pyx_result.target_dist_table = __pyx_state[60]; __pyx_result.target_dist_weights = __pyx_state[61]; __pyx_result.trans_gradients = __pyx_state[62]; __pyx_result.transitions = __pyx_state[63]; __pyx_result.use_learning_rate_decay = __pyx_state[64]; __pyx_result.validation_arguments = __pyx_state[65]; __pyx_result.validation_heads = __pyx_state[66]; __pyx_result.validation_predicates = __pyx_state[67]; __pyx_result.validation_sentences = __pyx_state[68]; __pyx_result.validation_tags = __pyx_state[69]; __pyx_result.word_window_size = __pyx_state[70]
 *     if len(__pyx_state) > 71 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[71])
*/
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(<ConvolutionalDependencyNetwork> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(ConvolutionalDependencyNetwork __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.convolution_lookup = __pyx_state[2]; __pyx_result.decay_factor = __pyx_state[3]; __pyx_result.dependency_weights = __pyx_state[4]; __pyx_result.error = __pyx_state[5]; __pyx_result.feature_tables = __pyx_state[6]; __pyx_result.features_per_token = __pyx_state[7]; __pyx_result.float_errors = __pyx_state[8]; __pyx_result.half_window = __pyx_state[9]; __pyx_result.hidden2_before_activation = __pyx_state[10]; __pyx_result.hidden2_bias = __pyx_state[11]; __pyx_result.hidden2_gradients = __pyx_state[12]; __pyx_result.hidden2_size = __pyx_state[13]; __pyx_result.hidden2_values = __pyx_state[14]; __pyx_result.hidden2_weights = __pyx_state[15]; __pyx_result.hidden_before_activation = __pyx_state[16]; __pyx_result.hidden_bias = __pyx_state[17]; __pyx_result.hidden_gradients = __pyx_state[18]; __pyx_result.hidden_sent_values = __pyx_state[19]; __pyx_result.hidden_size = __pyx_state[20]; __pyx_result.hidden_values = __pyx_state[21]; __pyx_result.hidden_weights = __pyx_state[22]; __pyx_result.input_deltas = __pyx_state[23]; __pyx_result.input_sent_values = __pyx_state[24]; __pyx_result.input_size = __pyx_state[25]; __pyx_result.input_values = __pyx_state[26]; __pyx_result.layer2_sent_values = __pyx_state[27]; __pyx_result.layer2_values = __pyx_state[28]; __pyx_result.learning_rate = __pyx_state[29]; __pyx_result.learning_rate_features = __pyx_state[30]; __pyx_result.learning_rate_trans = __pyx_state[31]; __pyx_result.max_indices = __pyx_state[32]; __pyx_result.net_gradients = __pyx_state[33]; __pyx_result.network_filename = __pyx_state[34]; __pyx_result.network_text_filename = __pyx_state[35]; __pyx_result.num_sentences = __pyx_state[36]; __pyx_result.num_targets = __pyx_state[37]; __pyx_result.num_tokens = __pyx_state[38]; __pyx_result.only_classify = __pyx_state[39]; __pyx_result.output_bias = __pyx_state[40]; __pyx_result.output_size = __pyx_state[41]; __pyx_result.output_weights = __pyx_state[42]; __pyx_result.padding_left = __pyx_state[43]; __pyx_result.padding_right = __pyx_state[44]; __pyx_result.pos_padding = __pyx_state[45]; __pyx_result.pre_padding = __pyx_state[46]; __pyx_result.pred_convolution_lookup = __pyx_state[47]; __pyx_result.pred_dist_deltas = __pyx_state[48]; __pyx_result.pred_dist_lookup = __pyx_state[49]; __pyx_result.pred_dist_offset = __pyx_state[50]; __pyx_result.pred_dist_table = __pyx_state[51]; __pyx_result.pred_dist_weights = __pyx_state[52]; __pyx_result.sentence_accuracy = __pyx_state[53]; __pyx_result.sentence_lookup = __pyx_state[54]; __pyx_result.skips = __pyx_state[55]; __pyx_result.target_convolution_lookup = __pyx_state[56]; __pyx_result.target_dist_deltas = __pyx_state[57]; __pyx_result.target_dist_lookup = __pyx_state[58]; __pyx_result.target_dist_offset = __pyx_state[59]; __pyx_result.target_dist_table = __pyx_state[60]; __pyx_result.target_dist_weights = __pyx_state[61]; __pyx_result.trans_gradients = __pyx_state[62]; __pyx_result.transitions = __pyx_state[63]; __pyx_result.use_learning_rate_decay = __pyx_state[64]; __pyx_result.validation_arguments = __pyx_state[65]; __pyx_result.validation_heads = __pyx_state[66]; __pyx_result.validation_predicates = __pyx_state[67]; __pyx_result.validation_sentences = __pyx_state[68]; __pyx_result.validation_tags = __pyx_state[69]; __pyx_result.word_window_size = __pyx_state[70]
 *     if len(__pyx_state) > 71 and hasattr(__pyx_result, '__dict__'):
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(4, 11, __pyx_L1_error));
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  #if CYTHON_USE_SYS_MONITORING
  __Pyx_TraceExceptionUnwind(0, 0);
  #else
  __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(4, 11, __pyx_L1_error));
  #endif
  __Pyx_AddTraceback("nltkor.tag.libs.network.__pyx_unpickle_ConvolutionalDependencyNetwork__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_PyMonitoring_ExitScope(0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* #### Code section: module_exttypes ### */

static PyObject *__pyx_tp_new_6nltkor_3tag_4libs_7network_Network(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)o);
  p->use_learning_rate_decay = ((PyLongObject *)Py_None); Py_INCREF(Py_None);
  p->sentence_lookup = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->padding_left = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->padding_right = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->pre_padding = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->pos_padding = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->hidden_weights = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->output_weights = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->hidden_bias = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->output_bias = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->input_values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->hidden_values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->layer2_values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->feature_tables = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->transitions = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->net_gradients = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->trans_gradients = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->input_sent_values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->hidden_sent_values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->layer2_sent_values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->network_filename = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->network_text_filename = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->validation_sentences = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->validation_tags = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6nltkor_3tag_4libs_7network_Network(PyObject *o) {
  struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6nltkor_3tag_4libs_7network_Network) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->use_learning_rate_decay);
  Py_CLEAR(p->sentence_lookup);
  Py_CLEAR(p->padding_left);
  Py_CLEAR(p->padding_right);
  Py_CLEAR(p->pre_padding);
  Py_CLEAR(p->pos_padding);
  Py_CLEAR(p->hidden_weights);
  Py_CLEAR(p->output_weights);
  Py_CLEAR(p->hidden_bias);
  Py_CLEAR(p->output_bias);
  Py_CLEAR(p->input_values);
  Py_CLEAR(p->hidden_values);
  Py_CLEAR(p->layer2_values);
  Py_CLEAR(p->feature_tables);
  Py_CLEAR(p->transitions);
  Py_CLEAR(p->net_gradients);
  Py_CLEAR(p->trans_gradients);
  Py_CLEAR(p->input_sent_values);
  Py_CLEAR(p->hidden_sent_values);
  Py_CLEAR(p->layer2_sent_values);
  Py_CLEAR(p->network_filename);
  Py_CLEAR(p->network_text_filename);
  Py_CLEAR(p->validation_sentences);
  Py_CLEAR(p->validation_tags);
  #if CYTHON_USE_TYPE_SLOTS
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static int __pyx_tp_traverse_6nltkor_3tag_4libs_7network_Network(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->use_learning_rate_decay) {
    e = (*v)(((PyObject *)p->use_learning_rate_decay), a); if (e) return e;
  }
  if (p->sentence_lookup) {
    e = (*v)(((PyObject *)p->sentence_lookup), a); if (e) return e;
  }
  if (p->padding_left) {
    e = (*v)(((PyObject *)p->padding_left), a); if (e) return e;
  }
  if (p->padding_right) {
    e = (*v)(((PyObject *)p->padding_right), a); if (e) return e;
  }
  if (p->pre_padding) {
    e = (*v)(((PyObject *)p->pre_padding), a); if (e) return e;
  }
  if (p->pos_padding) {
    e = (*v)(((PyObject *)p->pos_padding), a); if (e) return e;
  }
  if (p->hidden_weights) {
    e = (*v)(((PyObject *)p->hidden_weights), a); if (e) return e;
  }
  if (p->output_weights) {
    e = (*v)(((PyObject *)p->output_weights), a); if (e) return e;
  }
  if (p->hidden_bias) {
    e = (*v)(((PyObject *)p->hidden_bias), a); if (e) return e;
  }
  if (p->output_bias) {
    e = (*v)(((PyObject *)p->output_bias), a); if (e) return e;
  }
  if (p->input_values) {
    e = (*v)(((PyObject *)p->input_values), a); if (e) return e;
  }
  if (p->hidden_values) {
    e = (*v)(((PyObject *)p->hidden_values), a); if (e) return e;
  }
  if (p->layer2_values) {
    e = (*v)(((PyObject *)p->layer2_values), a); if (e) return e;
  }
  if (p->feature_tables) {
    e = (*v)(p->feature_tables, a); if (e) return e;
  }
  if (p->transitions) {
    e = (*v)(((PyObject *)p->transitions), a); if (e) return e;
  }
  if (p->net_gradients) {
    e = (*v)(((PyObject *)p->net_gradients), a); if (e) return e;
  }
  if (p->trans_gradients) {
    e = (*v)(((PyObject *)p->trans_gradients), a); if (e) return e;
  }
  if (p->input_sent_values) {
    e = (*v)(((PyObject *)p->input_sent_values), a); if (e) return e;
  }
  if (p->hidden_sent_values) {
    e = (*v)(((PyObject *)p->hidden_sent_values), a); if (e) return e;
  }
  if (p->layer2_sent_values) {
    e = (*v)(((PyObject *)p->layer2_sent_values), a); if (e) return e;
  }
  if (p->validation_sentences) {
    e = (*v)(p->validation_sentences, a); if (e) return e;
  }
  if (p->validation_tags) {
    e = (*v)(p->validation_tags, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6nltkor_3tag_4libs_7network_Network(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network_Network *)o;
  tmp = ((PyObject*)p->use_learning_rate_decay);
  p->use_learning_rate_decay = ((PyLongObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->sentence_lookup);
  p->sentence_lookup = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->padding_left);
  p->padding_left = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->padding_right);
  p->padding_right = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pre_padding);
  p->pre_padding = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pos_padding);
  p->pos_padding = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->hidden_weights);
  p->hidden_weights = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->output_weights);
  p->output_weights = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->hidden_bias);
  p->hidden_bias = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->output_bias);
  p->output_bias = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->input_values);
  p->input_values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->hidden_values);
  p->hidden_values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->layer2_values);
  p->layer2_values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->feature_tables);
  p->feature_tables = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->transitions);
  p->transitions = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->net_gradients);
  p->net_gradients = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->trans_gradients);
  p->trans_gradients = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->input_sent_values);
  p->input_sent_values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->hidden_sent_values);
  p->hidden_sent_values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->layer2_sent_values);
  p->layer2_sent_values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->validation_sentences);
  p->validation_sentences = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->validation_tags);
  p->validation_tags = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_padding_left(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_12padding_left_1__get__(o);
}

static int __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_padding_left(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_12padding_left_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_padding_right(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_13padding_right_1__get__(o);
}

static int __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_padding_right(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_13padding_right_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_word_window_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_16word_window_size_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_input_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_10input_size_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_hidden_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11hidden_size_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_output_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11output_size_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_learning_rate(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_13learning_rate_1__get__(o);
}

static int __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_learning_rate(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_13learning_rate_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_learning_rate_features(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_22learning_rate_features_1__get__(o);
}

static int __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_learning_rate_features(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_22learning_rate_features_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_decay_factor(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_12decay_factor_1__get__(o);
}

static int __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_decay_factor(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_12decay_factor_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_use_learning_rate_decay(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay_1__get__(o);
}

static int __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_use_learning_rate_decay(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay_3__set__(o, v);
  }
  else {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_23use_learning_rate_decay_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_features_per_token(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_18features_per_token_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_pre_padding(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pre_padding_1__get__(o);
}

static int __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_pre_padding(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pre_padding_3__set__(o, v);
  }
  else {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pre_padding_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_pos_padding(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pos_padding_1__get__(o);
}

static int __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_pos_padding(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pos_padding_3__set__(o, v);
  }
  else {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11pos_padding_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_hidden_weights(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_14hidden_weights_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_output_weights(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_14output_weights_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_hidden_bias(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11hidden_bias_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_output_bias(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11output_bias_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_input_values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_12input_values_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_hidden_values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_13hidden_values_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_layer2_values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_13layer2_values_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_feature_tables(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_14feature_tables_1__get__(o);
}

static int __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_feature_tables(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_14feature_tables_3__set__(o, v);
  }
  else {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_14feature_tables_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_learning_rate_trans(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_19learning_rate_trans_1__get__(o);
}

static int __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_learning_rate_trans(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_19learning_rate_trans_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_transitions(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11transitions_1__get__(o);
}

static int __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_transitions(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11transitions_3__set__(o, v);
  }
  else {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_11transitions_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_answer_score(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_12answer_score_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_net_gradients(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_13net_gradients_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_trans_gradients(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_15trans_gradients_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_input_sent_values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_17input_sent_values_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_hidden_sent_values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_18hidden_sent_values_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_layer2_sent_values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_18layer2_sent_values_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_network_filename(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_16network_filename_1__get__(o);
}

static int __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_network_filename(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_16network_filename_3__set__(o, v);
  }
  else {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_16network_filename_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_7Network_network_text_filename(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_21network_text_filename_1__get__(o);
}

static int __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_network_text_filename(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_21network_text_filename_3__set__(o, v);
  }
  else {
    return __pyx_pw_6nltkor_3tag_4libs_7network_7Network_21network_text_filename_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_6nltkor_3tag_4libs_7network_Network[] = {
  {"create_new", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_1create_new, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_create_new},
  {"description", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_5description, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_4description},
  {"_create_sentence_lookup", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_7_create_sentence_lookup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_6_create_sentence_lookup},
  {"tag_sentence", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_9tag_sentence, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_8tag_sentence},
  {"_tag_sentence", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_11_tag_sentence, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_10_tag_sentence},
  {"_calculate_delta", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_13_calculate_delta, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_12_calculate_delta},
  {"_calculate_gradients_sll", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_15_calculate_gradients_sll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_14_calculate_gradients_sll},
  {"_calculate_gradients_wll", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_17_calculate_gradients_wll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_16_calculate_gradients_wll},
  {"_viterbi", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_19_viterbi, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_18_viterbi},
  {"set_validation_data", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_21set_validation_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_20set_validation_data},
  {"set_learning_rate_decay", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_23set_learning_rate_decay, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_22set_learning_rate_decay},
  {"decrease_learning_rates", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_25decrease_learning_rates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_24decrease_learning_rates},
  {"train", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_27train, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_26train},
  {"_print_epoch_report", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_29_print_epoch_report, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_28_print_epoch_report},
  {"_train_epoch", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_31_train_epoch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_30_train_epoch},
  {"_validate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_33_validate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_32_validate},
  {"_backpropagate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_35_backpropagate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_34_backpropagate},
  {"_load_parameters", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_37_load_parameters, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_36_load_parameters},
  {"save", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_39save, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_38save},
  {"load_from_file", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_41load_from_file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_40load_from_file},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_43__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_42__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_45__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_7Network_44__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6nltkor_3tag_4libs_7network_Network[] = {
  {"padding_left", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_padding_left, __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_padding_left, PyDoc_STR("\n        The padding element filling the \"void\" before the beginning\n        of the sentence.\n        "), 0},
  {"padding_right", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_padding_right, __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_padding_right, PyDoc_STR("\n        The padding element filling the \"void\" after the end\n        of the sentence.\n        "), 0},
  {"word_window_size", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_word_window_size, 0, 0, 0},
  {"input_size", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_input_size, 0, 0, 0},
  {"hidden_size", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_hidden_size, 0, 0, 0},
  {"output_size", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_output_size, 0, 0, 0},
  {"learning_rate", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_learning_rate, __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_learning_rate, PyDoc_STR("learning_rate: 'float'"), 0},
  {"learning_rate_features", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_learning_rate_features, __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_learning_rate_features, PyDoc_STR("learning_rate_features: 'float'"), 0},
  {"decay_factor", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_decay_factor, __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_decay_factor, PyDoc_STR("decay_factor: 'float'"), 0},
  {"use_learning_rate_decay", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_use_learning_rate_decay, __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_use_learning_rate_decay, PyDoc_STR("use_learning_rate_decay: __builtin__.bool"), 0},
  {"features_per_token", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_features_per_token, 0, 0, 0},
  {"pre_padding", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_pre_padding, __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_pre_padding, PyDoc_STR("pre_padding: numpy.ndarray"), 0},
  {"pos_padding", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_pos_padding, __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_pos_padding, PyDoc_STR("pos_padding: numpy.ndarray"), 0},
  {"hidden_weights", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_hidden_weights, 0, 0, 0},
  {"output_weights", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_output_weights, 0, 0, 0},
  {"hidden_bias", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_hidden_bias, 0, 0, 0},
  {"output_bias", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_output_bias, 0, 0, 0},
  {"input_values", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_input_values, 0, 0, 0},
  {"hidden_values", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_hidden_values, 0, 0, 0},
  {"layer2_values", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_layer2_values, 0, 0, 0},
  {"feature_tables", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_feature_tables, __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_feature_tables, PyDoc_STR("feature_tables: list"), 0},
  {"learning_rate_trans", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_learning_rate_trans, __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_learning_rate_trans, PyDoc_STR("learning_rate_trans: 'float'"), 0},
  {"transitions", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_transitions, __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_transitions, PyDoc_STR("transitions: numpy.ndarray"), 0},
  {"answer_score", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_answer_score, 0, 0, 0},
  {"net_gradients", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_net_gradients, 0, 0, 0},
  {"trans_gradients", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_trans_gradients, 0, 0, 0},
  {"input_sent_values", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_input_sent_values, 0, 0, 0},
  {"hidden_sent_values", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_hidden_sent_values, 0, 0, 0},
  {"layer2_sent_values", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_layer2_sent_values, 0, 0, 0},
  {"network_filename", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_network_filename, __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_network_filename, PyDoc_STR("network_filename: str"), 0},
  {"network_text_filename", __pyx_getprop_6nltkor_3tag_4libs_7network_7Network_network_text_filename, __pyx_setprop_6nltkor_3tag_4libs_7network_7Network_network_text_filename, PyDoc_STR("network_text_filename: str"), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6nltkor_3tag_4libs_7network_Network_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6nltkor_3tag_4libs_7network_Network},
  {Py_tp_doc, (void *)PyDoc_STR("Network(word_window, input_size, hidden_size, output_size, hidden_weights, hidden_bias, output_weights, output_bias, transitions=None)")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6nltkor_3tag_4libs_7network_Network},
  {Py_tp_clear, (void *)__pyx_tp_clear_6nltkor_3tag_4libs_7network_Network},
  {Py_tp_methods, (void *)__pyx_methods_6nltkor_3tag_4libs_7network_Network},
  {Py_tp_getset, (void *)__pyx_getsets_6nltkor_3tag_4libs_7network_Network},
  {Py_tp_init, (void *)__pyx_pw_6nltkor_3tag_4libs_7network_7Network_3__init__},
  {Py_tp_new, (void *)__pyx_tp_new_6nltkor_3tag_4libs_7network_Network},
  {0, 0},
};
static PyType_Spec __pyx_type_6nltkor_3tag_4libs_7network_Network_spec = {
  "nltkor.tag.libs.network.Network",
  sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_6nltkor_3tag_4libs_7network_Network_slots,
};
#else

static PyTypeObject __pyx_type_6nltkor_3tag_4libs_7network_Network = {
  PyVarObject_HEAD_INIT(0, 0)
  "nltkor.tag.libs.network.""Network", /*tp_name*/
  sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network_Network), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6nltkor_3tag_4libs_7network_Network, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("Network(word_window, input_size, hidden_size, output_size, hidden_weights, hidden_bias, output_weights, output_bias, transitions=None)"), /*tp_doc*/
  __pyx_tp_traverse_6nltkor_3tag_4libs_7network_Network, /*tp_traverse*/
  __pyx_tp_clear_6nltkor_3tag_4libs_7network_Network, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6nltkor_3tag_4libs_7network_Network, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6nltkor_3tag_4libs_7network_Network, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_6nltkor_3tag_4libs_7network_7Network_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6nltkor_3tag_4libs_7network_Network, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_6nltkor_3tag_4libs_7network_ConvolutionalNetwork __pyx_vtable_6nltkor_3tag_4libs_7network_ConvolutionalNetwork;

static PyObject *__pyx_tp_new_6nltkor_3tag_4libs_7network_ConvolutionalNetwork(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *p;
  PyObject *o = __pyx_tp_new_6nltkor_3tag_4libs_7network_Network(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)o);
  p->__pyx_vtab = __pyx_vtabptr_6nltkor_3tag_4libs_7network_ConvolutionalNetwork;
  p->target_dist_table = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->pred_dist_table = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->target_dist_weights = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->pred_dist_weights = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->target_dist_lookup = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->pred_dist_lookup = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->target_convolution_lookup = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->pred_convolution_lookup = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->target_dist_deltas = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->pred_dist_deltas = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->hidden2_weights = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->hidden2_bias = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->hidden2_values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->hidden2_before_activation = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->hidden_before_activation = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->convolution_lookup = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->max_indices = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->only_classify = ((PyLongObject *)Py_None); Py_INCREF(Py_None);
  p->hidden_gradients = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->hidden2_gradients = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->input_deltas = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->validation_predicates = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->validation_arguments = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6nltkor_3tag_4libs_7network_ConvolutionalNetwork(PyObject *o) {
  struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6nltkor_3tag_4libs_7network_ConvolutionalNetwork) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->target_dist_table);
  Py_CLEAR(p->pred_dist_table);
  Py_CLEAR(p->target_dist_weights);
  Py_CLEAR(p->pred_dist_weights);
  Py_CLEAR(p->target_dist_lookup);
  Py_CLEAR(p->pred_dist_lookup);
  Py_CLEAR(p->target_convolution_lookup);
  Py_CLEAR(p->pred_convolution_lookup);
  Py_CLEAR(p->target_dist_deltas);
  Py_CLEAR(p->pred_dist_deltas);
  Py_CLEAR(p->hidden2_weights);
  Py_CLEAR(p->hidden2_bias);
  Py_CLEAR(p->hidden2_values);
  Py_CLEAR(p->hidden2_before_activation);
  Py_CLEAR(p->hidden_before_activation);
  Py_CLEAR(p->convolution_lookup);
  Py_CLEAR(p->max_indices);
  Py_CLEAR(p->only_classify);
  Py_CLEAR(p->hidden_gradients);
  Py_CLEAR(p->hidden2_gradients);
  Py_CLEAR(p->input_deltas);
  Py_CLEAR(p->validation_predicates);
  Py_CLEAR(p->validation_arguments);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_6nltkor_3tag_4libs_7network_Network(o);
}

static int __pyx_tp_traverse_6nltkor_3tag_4libs_7network_ConvolutionalNetwork(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)o;
  e = __pyx_tp_traverse_6nltkor_3tag_4libs_7network_Network(o, v, a); if (e) return e;
  if (p->target_dist_table) {
    e = (*v)(((PyObject *)p->target_dist_table), a); if (e) return e;
  }
  if (p->pred_dist_table) {
    e = (*v)(((PyObject *)p->pred_dist_table), a); if (e) return e;
  }
  if (p->target_dist_weights) {
    e = (*v)(((PyObject *)p->target_dist_weights), a); if (e) return e;
  }
  if (p->pred_dist_weights) {
    e = (*v)(((PyObject *)p->pred_dist_weights), a); if (e) return e;
  }
  if (p->target_dist_lookup) {
    e = (*v)(((PyObject *)p->target_dist_lookup), a); if (e) return e;
  }
  if (p->pred_dist_lookup) {
    e = (*v)(((PyObject *)p->pred_dist_lookup), a); if (e) return e;
  }
  if (p->target_convolution_lookup) {
    e = (*v)(((PyObject *)p->target_convolution_lookup), a); if (e) return e;
  }
  if (p->pred_convolution_lookup) {
    e = (*v)(((PyObject *)p->pred_convolution_lookup), a); if (e) return e;
  }
  if (p->target_dist_deltas) {
    e = (*v)(((PyObject *)p->target_dist_deltas), a); if (e) return e;
  }
  if (p->pred_dist_deltas) {
    e = (*v)(((PyObject *)p->pred_dist_deltas), a); if (e) return e;
  }
  if (p->hidden2_weights) {
    e = (*v)(((PyObject *)p->hidden2_weights), a); if (e) return e;
  }
  if (p->hidden2_bias) {
    e = (*v)(((PyObject *)p->hidden2_bias), a); if (e) return e;
  }
  if (p->hidden2_values) {
    e = (*v)(((PyObject *)p->hidden2_values), a); if (e) return e;
  }
  if (p->hidden2_before_activation) {
    e = (*v)(((PyObject *)p->hidden2_before_activation), a); if (e) return e;
  }
  if (p->hidden_before_activation) {
    e = (*v)(((PyObject *)p->hidden_before_activation), a); if (e) return e;
  }
  if (p->convolution_lookup) {
    e = (*v)(((PyObject *)p->convolution_lookup), a); if (e) return e;
  }
  if (p->max_indices) {
    e = (*v)(((PyObject *)p->max_indices), a); if (e) return e;
  }
  if (p->only_classify) {
    e = (*v)(((PyObject *)p->only_classify), a); if (e) return e;
  }
  if (p->hidden_gradients) {
    e = (*v)(((PyObject *)p->hidden_gradients), a); if (e) return e;
  }
  if (p->hidden2_gradients) {
    e = (*v)(((PyObject *)p->hidden2_gradients), a); if (e) return e;
  }
  if (p->input_deltas) {
    e = (*v)(((PyObject *)p->input_deltas), a); if (e) return e;
  }
  if (p->validation_predicates) {
    e = (*v)(p->validation_predicates, a); if (e) return e;
  }
  if (p->validation_arguments) {
    e = (*v)(p->validation_arguments, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6nltkor_3tag_4libs_7network_ConvolutionalNetwork(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *)o;
  __pyx_tp_clear_6nltkor_3tag_4libs_7network_Network(o);
  tmp = ((PyObject*)p->target_dist_table);
  p->target_dist_table = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pred_dist_table);
  p->pred_dist_table = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->target_dist_weights);
  p->target_dist_weights = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pred_dist_weights);
  p->pred_dist_weights = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->target_dist_lookup);
  p->target_dist_lookup = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pred_dist_lookup);
  p->pred_dist_lookup = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->target_convolution_lookup);
  p->target_convolution_lookup = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pred_convolution_lookup);
  p->pred_convolution_lookup = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->target_dist_deltas);
  p->target_dist_deltas = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pred_dist_deltas);
  p->pred_dist_deltas = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->hidden2_weights);
  p->hidden2_weights = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->hidden2_bias);
  p->hidden2_bias = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->hidden2_values);
  p->hidden2_values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->hidden2_before_activation);
  p->hidden2_before_activation = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->hidden_before_activation);
  p->hidden_before_activation = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->convolution_lookup);
  p->convolution_lookup = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->max_indices);
  p->max_indices = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->only_classify);
  p->only_classify = ((PyLongObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->hidden_gradients);
  p->hidden_gradients = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->hidden2_gradients);
  p->hidden2_gradients = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->input_deltas);
  p->input_deltas = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->validation_predicates);
  p->validation_predicates = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->validation_arguments);
  p->validation_arguments = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_target_dist_table(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table_1__get__(o);
}

static int __pyx_setprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_target_dist_table(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table_3__set__(o, v);
  }
  else {
    return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17target_dist_table_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_pred_dist_table(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table_1__get__(o);
}

static int __pyx_setprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_pred_dist_table(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table_3__set__(o, v);
  }
  else {
    return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15pred_dist_table_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_target_dist_weights(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_19target_dist_weights_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_pred_dist_weights(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17pred_dist_weights_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_target_dist_offset(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_offset_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_pred_dist_offset(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_offset_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_target_dist_lookup(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_lookup_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_pred_dist_lookup(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_lookup_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_target_convolution_lookup(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25target_convolution_lookup_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_pred_convolution_lookup(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_23pred_convolution_lookup_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_target_dist_deltas(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18target_dist_deltas_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_pred_dist_deltas(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16pred_dist_deltas_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_hidden2_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12hidden2_size_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_hidden2_weights(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15hidden2_weights_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_hidden2_bias(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12hidden2_bias_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_hidden2_values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_14hidden2_values_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_hidden2_before_activation(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25hidden2_before_activation_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_hidden_before_activation(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_24hidden_before_activation_1__get__(o);
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_max_indices(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_11max_indices_1__get__(o);
}

static PyMethodDef __pyx_methods_6nltkor_3tag_4libs_7network_ConvolutionalNetwork[] = {
  {"create_new", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_1create_new, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_create_new},
  {"description", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_3description, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_2description},
  {"_generate_save_dict", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_7_generate_save_dict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_6_generate_save_dict},
  {"save", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_9save, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_8save},
  {"_load_from_file", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_11_load_from_file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_10_load_from_file},
  {"load_from_file", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_13load_from_file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_12load_from_file},
  {"_load_parameters", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15_load_parameters, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_14_load_parameters},
  {"set_validation_data", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17set_validation_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_16set_validation_data},
  {"train", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_19train, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_18train},
  {"_reset_counters", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_21_reset_counters, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_20_reset_counters},
  {"_shuffle_data", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_23_shuffle_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_22_shuffle_data},
  {"_train_epoch", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25_train_epoch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_24_train_epoch},
  {"tag_sentence", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_27tag_sentence, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_26tag_sentence},
  {"_sentence_convolution", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_29_sentence_convolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_28_sentence_convolution},
  {"_pre_tagging_setup", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_31_pre_tagging_setup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_30_pre_tagging_setup},
  {"_tag_sentence", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_33_tag_sentence, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_32_tag_sentence},
  {"_validate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_35_validate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_34_validate},
  {"_calculate_gradients", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_37_calculate_gradients, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_36_calculate_gradients},
  {"_calculate_gradients_classify", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_39_calculate_gradients_classify, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_38_calculate_gradients_classify},
  {"_backpropagate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_41_backpropagate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_40_backpropagate},
  {"_adjust_weights", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_43_adjust_weights, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_42_adjust_weights},
  {"_calculate_input_deltas", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_45_calculate_input_deltas, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_44_calculate_input_deltas},
  {"_adjust_features", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_47_adjust_features, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_46_adjust_features},
  {"_viterbi", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_49_viterbi, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_48_viterbi},
  {"_create_target_lookup", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_51_create_target_lookup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_50_create_target_lookup},
  {"_create_pred_lookup", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_53_create_pred_lookup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_52_create_pred_lookup},
  {"_create_convolution_lookup", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_55_create_convolution_lookup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_54_create_convolution_lookup},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_57__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_56__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_59__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_58__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6nltkor_3tag_4libs_7network_ConvolutionalNetwork[] = {
  {"target_dist_table", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_target_dist_table, __pyx_setprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_target_dist_table, PyDoc_STR("target_dist_table: numpy.ndarray"), 0},
  {"pred_dist_table", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_pred_dist_table, __pyx_setprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_pred_dist_table, PyDoc_STR("pred_dist_table: numpy.ndarray"), 0},
  {"target_dist_weights", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_target_dist_weights, 0, 0, 0},
  {"pred_dist_weights", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_pred_dist_weights, 0, 0, 0},
  {"target_dist_offset", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_target_dist_offset, 0, 0, 0},
  {"pred_dist_offset", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_pred_dist_offset, 0, 0, 0},
  {"target_dist_lookup", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_target_dist_lookup, 0, 0, 0},
  {"pred_dist_lookup", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_pred_dist_lookup, 0, 0, 0},
  {"target_convolution_lookup", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_target_convolution_lookup, 0, 0, 0},
  {"pred_convolution_lookup", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_pred_convolution_lookup, 0, 0, 0},
  {"target_dist_deltas", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_target_dist_deltas, 0, 0, 0},
  {"pred_dist_deltas", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_pred_dist_deltas, 0, 0, 0},
  {"hidden2_size", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_hidden2_size, 0, 0, 0},
  {"hidden2_weights", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_hidden2_weights, 0, 0, 0},
  {"hidden2_bias", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_hidden2_bias, 0, 0, 0},
  {"hidden2_values", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_hidden2_values, 0, 0, 0},
  {"hidden2_before_activation", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_hidden2_before_activation, 0, 0, 0},
  {"hidden_before_activation", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_hidden_before_activation, 0, 0, 0},
  {"max_indices", __pyx_getprop_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_max_indices, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalNetwork_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6nltkor_3tag_4libs_7network_ConvolutionalNetwork},
  {Py_tp_doc, (void *)PyDoc_STR("ConvolutionalNetwork(word_window, input_size, hidden1_size, hidden2_size, output_size, hidden1_weights, hidden1_bias, target_dist_weights, pred_dist_weights, hidden2_weights, hidden2_bias, output_weights, output_bias)")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6nltkor_3tag_4libs_7network_ConvolutionalNetwork},
  {Py_tp_clear, (void *)__pyx_tp_clear_6nltkor_3tag_4libs_7network_ConvolutionalNetwork},
  {Py_tp_methods, (void *)__pyx_methods_6nltkor_3tag_4libs_7network_ConvolutionalNetwork},
  {Py_tp_getset, (void *)__pyx_getsets_6nltkor_3tag_4libs_7network_ConvolutionalNetwork},
  {Py_tp_init, (void *)__pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_5__init__},
  {Py_tp_new, (void *)__pyx_tp_new_6nltkor_3tag_4libs_7network_ConvolutionalNetwork},
  {0, 0},
};
static PyType_Spec __pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalNetwork_spec = {
  "nltkor.tag.libs.network.ConvolutionalNetwork",
  sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalNetwork_slots,
};
#else

static PyTypeObject __pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalNetwork = {
  PyVarObject_HEAD_INIT(0, 0)
  "nltkor.tag.libs.network.""ConvolutionalNetwork", /*tp_name*/
  sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("ConvolutionalNetwork(word_window, input_size, hidden1_size, hidden2_size, output_size, hidden1_weights, hidden1_bias, target_dist_weights, pred_dist_weights, hidden2_weights, hidden2_bias, output_weights, output_bias)"), /*tp_doc*/
  __pyx_tp_traverse_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, /*tp_traverse*/
  __pyx_tp_clear_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_5__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork __pyx_vtable_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork;

static PyObject *__pyx_tp_new_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *p;
  PyObject *o = __pyx_tp_new_6nltkor_3tag_4libs_7network_ConvolutionalNetwork(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6nltkor_3tag_4libs_7network_ConvolutionalNetwork*)__pyx_vtabptr_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork;
  p->dependency_weights = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->validation_heads = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork(PyObject *o) {
  struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->dependency_weights);
  Py_CLEAR(p->validation_heads);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_6nltkor_3tag_4libs_7network_ConvolutionalNetwork(o);
}

static int __pyx_tp_traverse_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)o;
  e = __pyx_tp_traverse_6nltkor_3tag_4libs_7network_ConvolutionalNetwork(o, v, a); if (e) return e;
  if (p->dependency_weights) {
    e = (*v)(((PyObject *)p->dependency_weights), a); if (e) return e;
  }
  if (p->validation_heads) {
    e = (*v)(p->validation_heads, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork *)o;
  __pyx_tp_clear_6nltkor_3tag_4libs_7network_ConvolutionalNetwork(o);
  tmp = ((PyObject*)p->dependency_weights);
  p->dependency_weights = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->validation_heads);
  p->validation_heads = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_dependency_weights(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_18dependency_weights_1__get__(o);
}

static PyMethodDef __pyx_methods_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork[] = {
  {"save", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_1save, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_save},
  {"load_from_file", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_3load_from_file, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_2load_from_file},
  {"train", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_5train, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_4train},
  {"set_validation_data", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_7set_validation_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_6set_validation_data},
  {"_tag_sentence", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_9_tag_sentence, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_8_tag_sentence},
  {"_tag_sentence_unlabeled_dependency", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_11_tag_sentence_unlabeled_dependency, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_10_tag_sentence_unlabeled_dependency},
  {"_tag_sentence_labeled_dependency", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_13_tag_sentence_labeled_dependency, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_12_tag_sentence_labeled_dependency},
  {"_calculate_gradients", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_15_calculate_gradients, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_14_calculate_gradients},
  {"_validate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_17_validate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_16_validate},
  {"_average_error", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_19_average_error, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_18_average_error},
  {"_print_epoch_report", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_21_print_epoch_report, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_20_print_epoch_report},
  {"tag_sentence", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_23tag_sentence, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_22tag_sentence},
  {"_find_cycles", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_25_find_cycles, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_24_find_cycles},
  {"_find_cycle_recursive", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_27_find_cycle_recursive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_26_find_cycle_recursive},
  {"_contract_cycle", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_29_contract_cycle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_28_contract_cycle},
  {"_find_maximum_spanning_tree", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_31_find_maximum_spanning_tree, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_30_find_maximum_spanning_tree},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_33__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_32__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_35__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_34__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork[] = {
  {"dependency_weights", __pyx_getprop_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_dependency_weights, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork},
  {Py_tp_clear, (void *)__pyx_tp_clear_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork},
  {Py_tp_methods, (void *)__pyx_methods_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork},
  {Py_tp_getset, (void *)__pyx_getsets_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork},
  {Py_tp_new, (void *)__pyx_tp_new_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork},
  {0, 0},
};
static PyType_Spec __pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork_spec = {
  "nltkor.tag.libs.network.ConvolutionalDependencyNetwork",
  sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork_slots,
};
#else

static PyTypeObject __pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork = {
  PyVarObject_HEAD_INIT(0, 0)
  "nltkor.tag.libs.network.""ConvolutionalDependencyNetwork", /*tp_name*/
  sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, /*tp_traverse*/
  __pyx_tp_clear_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_5__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr)))) {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr[--__pyx_mstate_global->__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr(PyObject *o) {
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_table);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_mstate_global->__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr)))) {
    __pyx_mstate_global->__pyx_freelist_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr[__pyx_mstate_global->__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr++] = ((struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_table) {
    e = (*v)(p->__pyx_v_table, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr_spec = {
  "nltkor.tag.libs.network.__pyx_scope_struct__genexpr",
  sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr_slots,
};
#else

static PyTypeObject __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "nltkor.tag.libs.network.""__pyx_scope_struct__genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr)))) {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr[--__pyx_mstate_global->__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr(PyObject *o) {
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_sent);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_mstate_global->__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr)))) {
    __pyx_mstate_global->__pyx_freelist_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr[__pyx_mstate_global->__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_sent) {
    e = (*v)(p->__pyx_v_sent, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr_spec = {
  "nltkor.tag.libs.network.__pyx_scope_struct_1_genexpr",
  sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "nltkor.tag.libs.network.""__pyx_scope_struct_1_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr)))) {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr[--__pyx_mstate_global->__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr(PyObject *o) {
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_sent);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_mstate_global->__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr)))) {
    __pyx_mstate_global->__pyx_freelist_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr[__pyx_mstate_global->__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_sent) {
    e = (*v)(p->__pyx_v_sent, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr_spec = {
  "nltkor.tag.libs.network.__pyx_scope_struct_2_genexpr",
  sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "nltkor.tag.libs.network.""__pyx_scope_struct_2_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr)))) {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr[--__pyx_mstate_global->__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr(PyObject *o) {
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_table);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_mstate_global->__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr)))) {
    __pyx_mstate_global->__pyx_freelist_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr[__pyx_mstate_global->__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_table) {
    e = (*v)(p->__pyx_v_table, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr_spec = {
  "nltkor.tag.libs.network.__pyx_scope_struct_3_genexpr",
  sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "nltkor.tag.libs.network.""__pyx_scope_struct_3_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr)))) {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr[--__pyx_mstate_global->__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr(PyObject *o) {
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_sent);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_mstate_global->__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr)))) {
    __pyx_mstate_global->__pyx_freelist_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr[__pyx_mstate_global->__pyx_freecount_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr++] = ((struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_sent) {
    e = (*v)(p->__pyx_v_sent, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr_spec = {
  "nltkor.tag.libs.network.__pyx_scope_struct_4_genexpr",
  sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "nltkor.tag.libs.network.""__pyx_scope_struct_4_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};
/* #### Code section: initfunc_declarations ### */
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/
/* #### Code section: init_module ### */

static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_Network = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6nltkor_3tag_4libs_7network_Network_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_Network)) __PYX_ERR(0, 79, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6nltkor_3tag_4libs_7network_Network_spec, __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_Network) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_Network = &__pyx_type_6nltkor_3tag_4libs_7network_Network;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_Network) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_Network->tp_dictoffset && __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_Network->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_Network->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_Network, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 79, __pyx_L1_error)
    if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
      __pyx_wrapperbase_6nltkor_3tag_4libs_7network_7Network_2__init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_6nltkor_3tag_4libs_7network_7Network_2__init__.doc = __pyx_doc_6nltkor_3tag_4libs_7network_7Network_2__init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6nltkor_3tag_4libs_7network_7Network_2__init__;
    }
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Network, (PyObject *) __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_Network) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_Network) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
  __pyx_vtabptr_6nltkor_3tag_4libs_7network_ConvolutionalNetwork = &__pyx_vtable_6nltkor_3tag_4libs_7network_ConvolutionalNetwork;
  __pyx_vtable_6nltkor_3tag_4libs_7network_ConvolutionalNetwork.argument_distances = (PyArrayObject *(*)(struct __pyx_obj_6nltkor_3tag_4libs_7network_ConvolutionalNetwork *, PyObject *, PyObject *))__pyx_f_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_argument_distances;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalNetwork_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork)) __PYX_ERR(1, 11, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalNetwork_spec, __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork) < 0) __PYX_ERR(1, 11, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork = &__pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalNetwork;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork->tp_base = __pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork) < 0) __PYX_ERR(1, 11, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork->tp_dictoffset && __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_vtabptr_6nltkor_3tag_4libs_7network_ConvolutionalNetwork) < 0) __PYX_ERR(1, 11, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork) < 0) __PYX_ERR(1, 11, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ConvolutionalNetwork, (PyObject *) __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork) < 0) __PYX_ERR(1, 11, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork) < 0) __PYX_ERR(1, 11, __pyx_L1_error)
  __pyx_vtabptr_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork = &__pyx_vtable_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork;
  __pyx_vtable_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork.__pyx_base = *__pyx_vtabptr_6nltkor_3tag_4libs_7network_ConvolutionalNetwork;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork)) __PYX_ERR(5, 11, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork_spec, __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork) < 0) __PYX_ERR(5, 11, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork = &__pyx_type_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork->tp_base = __pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork) < 0) __PYX_ERR(5, 11, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork->tp_dictoffset && __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_vtabptr_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork) < 0) __PYX_ERR(5, 11, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork) < 0) __PYX_ERR(5, 11, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ConvolutionalDependencyNetwork, (PyObject *) __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork) < 0) __PYX_ERR(5, 11, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork) < 0) __PYX_ERR(5, 11, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr)) __PYX_ERR(0, 133, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr_spec, __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 133, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr = &__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 133, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct__genexpr->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr)) __PYX_ERR(0, 617, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr_spec, __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 617, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr = &__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 617, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_1_genexpr->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr)) __PYX_ERR(0, 702, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr_spec, __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 702, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr = &__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 702, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_2_genexpr->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr)) __PYX_ERR(1, 56, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr_spec, __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(1, 56, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr = &__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(1, 56, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_3_genexpr->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr)) __PYX_ERR(1, 288, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr_spec, __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(1, 288, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr = &__pyx_type_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(1, 288, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_6nltkor_3tag_4libs_7network___pyx_scope_struct_4_genexpr->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_1_1(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyTypeObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  0, 0,
  #else
  sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyHeapTypeObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_1_1); if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(6, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType_3_1_1(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyLongObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyLongObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  0, 0,
  #else
  sizeof(PyLongObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyLongObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_1_1); if (!__pyx_mstate->__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(7, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType_3_1_1(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyComplexObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  0, 0,
  #else
  sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyComplexObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_1_1); if (!__pyx_mstate->__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(8, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_1_1(__pyx_t_1, "numpy", "dtype",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyArray_Descr),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyArray_Descr),
  #else
  sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyArray_Descr),
  #endif
  __Pyx_ImportType_CheckSize_Ignore_3_1_1); if (!__pyx_mstate->__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 202, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_1_1(__pyx_t_1, "numpy", "flatiter",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyArrayIterObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyArrayIterObject),
  #else
  sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyArrayIterObject),
  #endif
  __Pyx_ImportType_CheckSize_Ignore_3_1_1); if (!__pyx_mstate->__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 225, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_1_1(__pyx_t_1, "numpy", "broadcast",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyArrayMultiIterObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyArrayMultiIterObject),
  #else
  sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyArrayMultiIterObject),
  #endif
  __Pyx_ImportType_CheckSize_Ignore_3_1_1); if (!__pyx_mstate->__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 229, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_1_1(__pyx_t_1, "numpy", "ndarray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyArrayObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyArrayObject),
  #else
  sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyArrayObject),
  #endif
  __Pyx_ImportType_CheckSize_Ignore_3_1_1); if (!__pyx_mstate->__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 238, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_generic = __Pyx_ImportType_3_1_1(__pyx_t_1, "numpy", "generic",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_1_1); if (!__pyx_mstate->__pyx_ptype_5numpy_generic) __PYX_ERR(2, 809, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_number = __Pyx_ImportType_3_1_1(__pyx_t_1, "numpy", "number",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_1_1); if (!__pyx_mstate->__pyx_ptype_5numpy_number) __PYX_ERR(2, 811, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_integer = __Pyx_ImportType_3_1_1(__pyx_t_1, "numpy", "integer",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_1_1); if (!__pyx_mstate->__pyx_ptype_5numpy_integer) __PYX_ERR(2, 813, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_1_1(__pyx_t_1, "numpy", "signedinteger",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_1_1); if (!__pyx_mstate->__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 815, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_1_1(__pyx_t_1, "numpy", "unsignedinteger",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_1_1); if (!__pyx_mstate->__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 817, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_1_1(__pyx_t_1, "numpy", "inexact",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_1_1); if (!__pyx_mstate->__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 819, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_floating = __Pyx_ImportType_3_1_1(__pyx_t_1, "numpy", "floating",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_1_1); if (!__pyx_mstate->__pyx_ptype_5numpy_floating) __PYX_ERR(2, 821, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_1_1(__pyx_t_1, "numpy", "complexfloating",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_1_1); if (!__pyx_mstate->__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 823, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_1_1(__pyx_t_1, "numpy", "flexible",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_1_1); if (!__pyx_mstate->__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 825, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_character = __Pyx_ImportType_3_1_1(__pyx_t_1, "numpy", "character",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyObject),
  #else
  sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_1_1); if (!__pyx_mstate->__pyx_ptype_5numpy_character) __PYX_ERR(2, 827, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_1_1(__pyx_t_1, "numpy", "ufunc",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyUFuncObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyUFuncObject),
  #else
  sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_1(PyUFuncObject),
  #endif
  __Pyx_ImportType_CheckSize_Ignore_3_1_1); if (!__pyx_mstate->__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 866, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec_network(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_network},
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  {Py_mod_gil, Py_MOD_GIL_USED},
  #endif
  #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE
  {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
  #endif
  {0, NULL}
};
#endif

#ifdef __cplusplus
namespace {
  struct PyModuleDef __pyx_moduledef =
  #else
  static struct PyModuleDef __pyx_moduledef =
  #endif
  {
      PyModuleDef_HEAD_INIT,
      "network",
      __pyx_k_A_neural_network_for_NLP_taggin, /* m_doc */
    #if CYTHON_USE_MODULE_STATE
      sizeof(__pyx_mstatetype), /* m_size */
    #else
      (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */
    #endif
      __pyx_methods /* m_methods */,
    #if CYTHON_PEP489_MULTI_PHASE_INIT
      __pyx_moduledef_slots, /* m_slots */
    #else
      NULL, /* m_reload */
    #endif
    #if CYTHON_USE_MODULE_STATE
      __pyx_m_traverse, /* m_traverse */
      __pyx_m_clear, /* m_clear */
      NULL /* m_free */
    #else
      NULL, /* m_traverse */
      NULL, /* m_clear */
      NULL /* m_free */
    #endif
  };
  #ifdef __cplusplus
} /* anonymous namespace */
#endif

/* PyModInitFuncType */
#ifndef CYTHON_NO_PYINIT_EXPORT
  #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#else
  #ifdef __cplusplus
  #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
  #else
  #define __Pyx_PyMODINIT_FUNC PyObject *
  #endif
#endif

__Pyx_PyMODINIT_FUNC PyInit_network(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_network(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
/* ModuleCreationPEP489 */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000
static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) {
    {
        PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think
        if (!module) {
            PyErr_Clear(); // just try the 3.8-3.12 version
            module = PyImport_ImportModule("_xxsubinterpreters");
            if (!module) goto bad;
        }
        PyObject *current = PyObject_CallMethod(module, "get_current", NULL);
        Py_DECREF(module);
        if (!current) goto bad;
        if (PyTuple_Check(current)) {
            PyObject *new_current = PySequence_GetItem(current, 0);
            Py_DECREF(current);
            current = new_current;
            if (!new_current) goto bad;
        }
        long long as_c_int = PyLong_AsLongLong(current);
        Py_DECREF(current);
        return as_c_int;
    }
  bad:
    PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
    return -1;
}
#endif
#if !CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    static PY_INT64_T main_interpreter_id = -1;
#if CYTHON_COMPILING_IN_GRAAL
    PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x03090000
    PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get());
#elif CYTHON_COMPILING_IN_LIMITED_API
    PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId();
#else
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
#endif
    if (unlikely(current_id == -1)) {
        return -1;
    }
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return 0;
    } else if (unlikely(main_interpreter_id != current_id)) {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
#endif
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
{
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
            result = PyDict_SetItemString(moddict, to_name, value);
        }
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    CYTHON_UNUSED_VAR(def);
    #if !CYTHON_USE_MODULE_STATE
    if (__Pyx_check_single_interpreter())
        return NULL;
    #endif
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static CYTHON_SMALL_CODE int __pyx_pymod_exec_network(PyObject *__pyx_pyinit_module)
#endif
{
  int stringtab_initialized = 0;
  #if CYTHON_USE_MODULE_STATE
  int pystate_addmodule_run = 0;
  #endif
  __pyx_mstatetype *__pyx_mstate = NULL;
  __Pyx_TraceDeclarationsFunc
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module 'network' has already been imported. Re-initialisation is not supported.");
    return -1;
  }
  #else
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_t_1 = __pyx_pyinit_module;
  Py_INCREF(__pyx_t_1);
  #else
  __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #if CYTHON_USE_MODULE_STATE
  {
    int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef);
    __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "network" pseudovariable */
    if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    pystate_addmodule_run = 1;
  }
  #else
  __pyx_m = __pyx_t_1;
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED);
  #endif
  __pyx_mstate = __pyx_mstate_global;
  CYTHON_UNUSED_VAR(__pyx_t_1);
  __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_mstate->__pyx_d);
  __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /* ImportRefnannyAPI */
  #if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
if (!__Pyx_RefNanny) {
  PyErr_Clear();
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  if (!__Pyx_RefNanny)
      Py_FatalError("failed to import 'refnanny' module");
}
#endif

__Pyx_RefNannySetupContext("PyInit_network", 0);
  if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pxy_PyFrame_Initialize_Offsets
  __Pxy_PyFrame_Initialize_Offsets();
  #endif
  __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  stringtab_initialized = 1;
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__pyx_module_is_main_nltkor__tag__libs__network) {
    if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "nltkor.tag.libs.network")) {
      if (unlikely((PyDict_SetItemString(modules, "nltkor.tag.libs.network", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_CreateCodeObjects(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code(__pyx_mstate);
  (void)__Pyx_modinit_variable_export_code(__pyx_mstate);
  (void)__Pyx_modinit_function_export_code(__pyx_mstate);
  if (unlikely((__Pyx_modinit_type_init_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  (void)__Pyx_modinit_variable_import_code(__pyx_mstate);
  (void)__Pyx_modinit_function_import_code(__pyx_mstate);
  /*--- Execution code ---*/
  __Pyx_TraceStartFunc("PyInit_network", __pyx_f[0], 1, 2, 0, 0, __PYX_ERR(0, 1, __pyx_L1_error));

  /* "nltkor/tag/libs/network.pyx":11
 * """
 * 
 * import numpy as np             # <<<<<<<<<<<<<<
 * cimport numpy as np
 * cimport cython
*/
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_numpy, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_np, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":17
 * 
 * #from itertools import izip
 * import logging             # <<<<<<<<<<<<<<
 * 
 * #ctypedef float FLOAT_t
*/
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_logging, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_logging, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":126
 *     cdef list validation_tags
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def create_new(cls, feature_tables, int word_window, int hidden_size,
 *                  int output_size):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_1create_new, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Network_create_new, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_mstate_global->__pyx_n_u_create_new, __pyx_t_2) < 0) __PYX_ERR(0, 126, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject*)__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_mstate_global->__pyx_n_u_create_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_mstate_global->__pyx_n_u_create_new, __pyx_t_3) < 0) __PYX_ERR(0, 126, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":200
 *         self.use_learning_rate_decay = False
 * 
 *     def description(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a textual description of the network.
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_5description, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Network_description, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_mstate_global->__pyx_n_u_description, __pyx_t_3) < 0) __PYX_ERR(0, 200, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":217
 *         return desc
 * 
 *     def _create_sentence_lookup(self, np.ndarray sentence):             # <<<<<<<<<<<<<<
 *         """
 *         Create a lookup matrix with the embeddings values for all tokens in a sentence.
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_7_create_sentence_lookup, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Network__create_sentence_lookup, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_mstate_global->__pyx_n_u_create_sentence_lookup, __pyx_t_3) < 0) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":267
 *             self.pos_padding = np.array((self.word_window_size // 2) * [padding_right])
 * 
 *     def tag_sentence(self, np.ndarray sentence):             # <<<<<<<<<<<<<<
 *         """
 *         Runs the network for each element in the sentence and returns
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_9tag_sentence, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Network_tag_sentence, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_mstate_global->__pyx_n_u_tag_sentence_2, __pyx_t_3) < 0) __PYX_ERR(0, 267, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":278
 *         return self._viterbi(scores)
 * 
 *     def _tag_sentence(self, np.ndarray sentence, tags=None):             # <<<<<<<<<<<<<<
 *         """
 *         Runs the network for each element in the sentence and returns
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_11_tag_sentence, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Network__tag_sentence, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[5]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_mstate_global->__pyx_n_u_tag_sentence, __pyx_t_3) < 0) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":323
 *         return scores
 * 
 *     def _calculate_delta(self, scores):             # <<<<<<<<<<<<<<
 *         """
 *         Calculates a matrix with the scores for all possible paths at all given
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_13_calculate_delta, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Network__calculate_delta, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_mstate_global->__pyx_n_u_calculate_delta, __pyx_t_3) < 0) __PYX_ERR(0, 323, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":352
 *         return delta
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     def _calculate_gradients_sll(self, tags, scores):
 *         """
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_15_calculate_gradients_sll, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Network__calculate_gradients_sll, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_mstate_global->__pyx_n_u_calculate_gradients_sll, __pyx_t_3) < 0) __PYX_ERR(0, 352, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":471
 *         return True
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     def _calculate_gradients_wll(self, tags, scores):
 *         """
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_17_calculate_gradients_wll, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Network__calculate_gradients_wll, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_mstate_global->__pyx_n_u_calculate_gradients_wll, __pyx_t_3) < 0) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":507
 *         return True
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     def _viterbi(self, np.ndarray[FLOAT_t, ndim=2] scores):
 *         """
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_19_viterbi, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Network__viterbi, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[17])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_mstate_global->__pyx_n_u_viterbi, __pyx_t_3) < 0) __PYX_ERR(0, 507, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":555
 *         return answer
 * 
 *     def set_validation_data(self, list validation_sentences=None,             # <<<<<<<<<<<<<<
 *                             list validation_tags=None):
 *         """
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_21set_validation_data, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Network_set_validation_data, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[18])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[6]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_mstate_global->__pyx_n_u_set_validation_data, __pyx_t_3) < 0) __PYX_ERR(0, 555, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":567
 *         self.validation_tags = validation_tags
 * 
 *     def set_learning_rate_decay(self, float decay_factor=1.0):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the network to use learning rate decay.
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_23set_learning_rate_decay, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Network_set_learning_rate_decay, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[19])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[7]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_mstate_global->__pyx_n_u_set_learning_rate_decay, __pyx_t_3) < 0) __PYX_ERR(0, 567, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":579
 *         self.decay_factor = decay_factor
 * 
 *     def decrease_learning_rates(self, epoch):             # <<<<<<<<<<<<<<
 *         """
 *         Apply the learning rate decay, if the network was configured to use it.
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_25decrease_learning_rates, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Network_decrease_learning_rates, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[20])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_mstate_global->__pyx_n_u_decrease_learning_rates, __pyx_t_3) < 0) __PYX_ERR(0, 579, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":595
 *             self.learning_rate_trans *= factor
 * 
 *     def train(self, list sentences, list tags,             # <<<<<<<<<<<<<<
 *               int epochs, int epochs_between_reports=0,
 *               float desired_accuracy=0):
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_27train, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Network_train, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[22])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[8]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_mstate_global->__pyx_n_u_train, __pyx_t_3) < 0) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":656
 *         self.num_tokens = 0
 * 
 *     def _print_epoch_report(self, int num):             # <<<<<<<<<<<<<<
 *         """
 *         Reports the status of the network in the given training
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_29_print_epoch_report, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Network__print_epoch_report, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[23])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_mstate_global->__pyx_n_u_print_epoch_report, __pyx_t_3) < 0) __PYX_ERR(0, 656, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":670
 *                                    self.learning_rate))
 * 
 *     def _train_epoch(self, list sentences, list tags):             # <<<<<<<<<<<<<<
 *         """
 *         Trains for one epoch with all examples.
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_31_train_epoch, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Network__train_epoch, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[24])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_mstate_global->__pyx_n_u_train_epoch, __pyx_t_3) < 0) __PYX_ERR(0, 670, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":693
 *                 self.float_errors += 1
 * 
 *     def _validate(self):             # <<<<<<<<<<<<<<
 *         """Perform validation on validation data and estimate accuracy"""
 *         hits = 0
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_33_validate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Network__validate, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[26])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_mstate_global->__pyx_n_u_validate, __pyx_t_3) < 0) __PYX_ERR(0, 693, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":705
 *         self.accuracy = float(hits) / num_tokens
 * 
 *     def _backpropagate(self, sentence):             # <<<<<<<<<<<<<<
 *         """
 *         Backpropagate the gradients of the cost.
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_35_backpropagate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Network__backpropagate, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[27])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_mstate_global->__pyx_n_u_backpropagate, __pyx_t_3) < 0) __PYX_ERR(0, 705, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":804
 *             self.transitions += self.trans_gradients * self.learning_rate_trans
 * 
 *     def _load_parameters(self):             # <<<<<<<<<<<<<<
 *         """
 *         Loads weights, feature tables and transition tables previously saved.
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_37_load_parameters, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Network__load_parameters, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[28])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_mstate_global->__pyx_n_u_load_parameters, __pyx_t_3) < 0) __PYX_ERR(0, 804, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":821
 *             self.transitions = None
 * 
 *     def save(self):             # <<<<<<<<<<<<<<
 *         """
 *         Saves the neural network to a file.
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_39save, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Network_save, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[29])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_mstate_global->__pyx_n_u_save, __pyx_t_3) < 0) __PYX_ERR(0, 821, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/network.pyx":837
 * 
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def load_from_file(cls, filename):
 *         """
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_41load_from_file, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Network_load_from_file, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[30])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_mstate_global->__pyx_n_u_load_from_file_2, __pyx_t_3) < 0) __PYX_ERR(0, 837, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GetNameInClass(__pyx_t_3, (PyObject*)__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_mstate_global->__pyx_n_u_load_from_file_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_mstate_global->__pyx_n_u_load_from_file_2, __pyx_t_2) < 0) __PYX_ERR(0, 837, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_43__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Network___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[78])); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Network, (type(self), 0x72479d4, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Network__set_state(self, __pyx_state)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_7Network_45__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Network___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[79])); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_Network, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(4, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":8
 * """
 * 
 * import numpy as np             # <<<<<<<<<<<<<<
 * cimport numpy as np
 * 
*/
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_numpy, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_np, __pyx_t_2) < 0) __PYX_ERR(1, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":51
 *     cdef list validation_predicates, validation_arguments
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def create_new(cls, feature_tables, target_dist_table, pred_dist_table,
 *                    int word_window, int hidden1_size, int hidden2_size, int output_size):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_1create_new, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalNetwork_create_new, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[81])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_create_new, __pyx_t_2) < 0) __PYX_ERR(1, 51, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject*)__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_create_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_create_new, __pyx_t_3) < 0) __PYX_ERR(1, 51, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":100
 *         return net
 * 
 *     def description(self):             # <<<<<<<<<<<<<<
 *         """Returns a textual description of the network."""
 *         hidden2_size = 0 if self.hidden2_weights is None else self.hidden2_size
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_3description, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalNetwork_description, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[82])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_description, __pyx_t_3) < 0) __PYX_ERR(1, 100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":148
 *         self.use_learning_rate_decay = False
 * 
 *     def _generate_save_dict(self):             # <<<<<<<<<<<<<<
 *         """
 *         Generates a dictionary with all parameters saved by the model.
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_7_generate_save_dict, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalNetwork__generate_s, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[84])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_generate_save_dict, __pyx_t_3) < 0) __PYX_ERR(1, 148, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":169
 *         return d
 * 
 *     def save(self):             # <<<<<<<<<<<<<<
 *         """
 *         Saves the neural network to a file.
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_9save, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalNetwork_save, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[85])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_save, __pyx_t_3) < 0) __PYX_ERR(1, 169, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":178
 *         np.savez(self.network_filename, **data)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def _load_from_file(cls, data, filename):
 *         """
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_11_load_from_file, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalNetwork__load_from, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[86])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_load_from_file, __pyx_t_3) < 0) __PYX_ERR(1, 178, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GetNameInClass(__pyx_t_3, (PyObject*)__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_load_from_file); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_load_from_file, __pyx_t_2) < 0) __PYX_ERR(1, 178, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":224
 *         return nn
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def load_from_file(cls, filename):
 *         """
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_13load_from_file, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalNetwork_load_from_f, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[87])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_load_from_file_2, __pyx_t_2) < 0) __PYX_ERR(1, 224, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject*)__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_load_from_file_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_load_from_file_2, __pyx_t_3) < 0) __PYX_ERR(1, 224, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":234
 *         return cls._load_from_file(data, filename)
 * 
 *     def _load_parameters(self):             # <<<<<<<<<<<<<<
 *         """
 *         Loads weights, feature tables, distance tables and
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_15_load_parameters, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalNetwork__load_param, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[88])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_load_parameters, __pyx_t_3) < 0) __PYX_ERR(1, 234, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":261
 *             self.hidden2_weights = None
 * 
 *     def set_validation_data(self, list validation_sentences,             # <<<<<<<<<<<<<<
 *                             list validation_predicates,
 *                             list validation_tags,
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_17set_validation_data, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalNetwork_set_validat, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[89])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[5]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_set_validation_data, __pyx_t_3) < 0) __PYX_ERR(1, 261, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":275
 *         self.validation_arguments = validation_arguments
 * 
 *     def train(self, list sentences, list predicates, list tags,             # <<<<<<<<<<<<<<
 *               int epochs, int epochs_between_reports=0,
 *               float desired_accuracy=0, list arguments=None):
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_19train, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalNetwork_train, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[91])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[9]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_train, __pyx_t_3) < 0) __PYX_ERR(1, 275, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":334
 *         self._reset_counters()
 * 
 *     def _reset_counters(self):             # <<<<<<<<<<<<<<
 *         """
 *         Reset the performance statistics counters. They are updated during
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_21_reset_counters, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalNetwork__reset_coun, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[92])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_reset_counters, __pyx_t_3) < 0) __PYX_ERR(1, 334, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":343
 *         self.float_errors = 0
 * 
 *     def _shuffle_data(self, sentences, predicates, tags, arguments=None):             # <<<<<<<<<<<<<<
 *         """
 *         Shuffle the given training data in place.
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_23_shuffle_data, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalNetwork__shuffle_da, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[93])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[5]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_shuffle_data, __pyx_t_3) < 0) __PYX_ERR(1, 343, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":360
 * 
 * 
 *     def _train_epoch(self, sentences, predicates, tags, arguments):             # <<<<<<<<<<<<<<
 *         """Trains for one epoch with all examples."""
 * 
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_25_train_epoch, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalNetwork__train_epoc, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[94])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_train_epoch, __pyx_t_3) < 0) __PYX_ERR(1, 360, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":381
 *                 self.float_errors += 1
 * 
 *     def tag_sentence(self, np.ndarray sentence, np.ndarray predicates,             # <<<<<<<<<<<<<<
 *                      list arguments=None, bool logprob=False,
 *                      bool allow_repeats=True):
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_27tag_sentence, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalNetwork_tag_sentenc, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[95])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[10]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_tag_sentence_2, __pyx_t_3) < 0) __PYX_ERR(1, 381, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":421
 * 
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _sentence_convolution(self, sentence, predicate, argument_blocks=None,
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_29_sentence_convolution, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalNetwork__sentence_c, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[97])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[11]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_sentence_convolution, __pyx_t_3) < 0) __PYX_ERR(1, 421, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":509
 *         return scores
 * 
 *     def _pre_tagging_setup(self, np.ndarray sentence, bool training):             # <<<<<<<<<<<<<<
 *         """
 *         Perform some initialization actions before the actual tagging.
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_31_pre_tagging_setup, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalNetwork__pre_taggin, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[98])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_pre_tagging_setup, __pyx_t_3) < 0) __PYX_ERR(1, 509, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":525
 * 
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _tag_sentence(self, np.ndarray sentence, np.ndarray predicates,
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_33_tag_sentence, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalNetwork__tag_senten, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[99])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[12]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_tag_sentence, __pyx_t_3) < 0) __PYX_ERR(1, 525, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":576
 *         return answer
 * 
 *     def _validate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Evaluates the network performance, updating its hits count.
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_35_validate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalNetwork__validate, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[100])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_validate, __pyx_t_3) < 0) __PYX_ERR(1, 576, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":609
 *         self.error /= num_items
 * 
 *     def _calculate_gradients(self, tags, scores):             # <<<<<<<<<<<<<<
 *         """Delegates the call to the appropriate function."""
 *         if self.only_classify:
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_37_calculate_gradients, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalNetwork__calculate, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[101])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_calculate_gradients, __pyx_t_3) < 0) __PYX_ERR(1, 609, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":616
 *             return self._calculate_gradients_sll(tags, scores)
 * 
 *     def _calculate_gradients_classify(self, tags, scores):             # <<<<<<<<<<<<<<
 *         """
 *         Calculates the output deltas for each target in a network that only
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_39_calculate_gradients_classify, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalNetwork__calculate_2, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[102])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_calculate_gradients_classify, __pyx_t_3) < 0) __PYX_ERR(1, 616, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":653
 *         return correction
 * 
 *     def _backpropagate(self):             # <<<<<<<<<<<<<<
 *         """Backpropagates the error gradient."""
 * 
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_41_backpropagate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalNetwork__backpropag, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[103])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_backpropagate, __pyx_t_3) < 0) __PYX_ERR(1, 653, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":675
 *             self.hidden_gradients = dCd_tanh * hardtanhd(self.hidden_before_activation)
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _adjust_weights(self, predicate, arguments=None):
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_43_adjust_weights, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalNetwork__adjust_wei, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[104])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[5]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_adjust_weights, __pyx_t_3) < 0) __PYX_ERR(1, 675, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":742
 *             self.transitions += self.trans_gradients * self.learning_rate_trans
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _calculate_input_deltas(self, np.ndarray sentence, int predicate,
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_45_calculate_input_deltas, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalNetwork__calculate_3, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[105])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[5]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_calculate_input_deltas, __pyx_t_3) < 0) __PYX_ERR(1, 742, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":797
 * 
 * 
 *     def _adjust_features(self, sentence, predicate):             # <<<<<<<<<<<<<<
 *         """Adjusts the features in all feature tables."""
 *         # compute each token in the window separately and
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_47_adjust_features, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalNetwork__adjust_fea, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[106])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_adjust_features, __pyx_t_3) < 0) __PYX_ERR(1, 797, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":849
 *         self._create_pred_lookup()
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     def _viterbi(self, np.ndarray[FLOAT_t, ndim=2] scores, bool allow_repeats=True):
 *         """
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_49_viterbi, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalNetwork__viterbi, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[107])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[13]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_viterbi, __pyx_t_3) < 0) __PYX_ERR(1, 849, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":923
 *         return answer
 * 
 *     def _create_target_lookup(self):             # <<<<<<<<<<<<<<
 *         """
 *         Creates a lookup table with the window value for each different distance
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_51_create_target_lookup, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalNetwork__create_tar, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[108])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_create_target_lookup, __pyx_t_3) < 0) __PYX_ERR(1, 923, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":952
 * 
 * 
 *     def _create_pred_lookup(self):             # <<<<<<<<<<<<<<
 *         """
 *         Creates a lookup table with the window value for each different distance
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_53_create_pred_lookup, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalNetwork__create_pre, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[109])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_create_pred_lookup, __pyx_t_3) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkconv.pyx":980
 *         self.pred_convolution_lookup = self.pred_dist_lookup.dot(self.pred_dist_weights)
 * 
 *     def _create_convolution_lookup(self, sentence, training):             # <<<<<<<<<<<<<<
 *         """
 *         Creates a lookup table storing the values found by each
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_55_create_convolution_lookup, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalNetwork__create_con, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[110])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_create_convolution_lookup, __pyx_t_3) < 0) __PYX_ERR(1, 980, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_57__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalNetwork___reduce_cy, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[134])); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ConvolutionalNetwork, (type(self), 0x2f64fba, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ConvolutionalNetwork__set_state(self, __pyx_state)
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_20ConvolutionalNetwork_59__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalNetwork___setstate, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[135])); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalNetwork, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(4, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":8
 * """
 * 
 * import numpy as np             # <<<<<<<<<<<<<<
 * cimport numpy as np
 * 
*/
  __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_numpy, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_np, __pyx_t_3) < 0) __PYX_ERR(5, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":19
 *     cdef validation_heads
 * 
 *     def save(self):             # <<<<<<<<<<<<<<
 *         """
 *         Saves the neural network to a file.
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_1save, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalDependencyNetwork_s, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[136])); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_mstate_global->__pyx_n_u_save, __pyx_t_3) < 0) __PYX_ERR(5, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":29
 *         np.savez(self.network_filename, **data)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def load_from_file(cls, filename):
 *         """
*/
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_3load_from_file, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalDependencyNetwork_l, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[137])); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_mstate_global->__pyx_n_u_load_from_file_2, __pyx_t_3) < 0) __PYX_ERR(5, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GetNameInClass(__pyx_t_3, (PyObject*)__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_mstate_global->__pyx_n_u_load_from_file_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_mstate_global->__pyx_n_u_load_from_file_2, __pyx_t_2) < 0) __PYX_ERR(5, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":41
 *         return nn
 * 
 *     def train(self, list sentences, list heads, int epochs,             # <<<<<<<<<<<<<<
 *               int epochs_between_reports=0, float desired_accuracy=0,
 *               list labels=None):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_5train, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalDependencyNetwork_t, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[138])); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[9]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_mstate_global->__pyx_n_u_train, __pyx_t_2) < 0) __PYX_ERR(5, 41, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":65
 *                                                           labels)
 * 
 *     def set_validation_data(self, list sentences, list heads, list labels=None):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the data to be used in validation during training. If this function
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_7set_validation_data, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalDependencyNetwork_s_2, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[139])); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[5]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_mstate_global->__pyx_n_u_set_validation_data, __pyx_t_2) < 0) __PYX_ERR(5, 65, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":77
 *         self.validation_heads = heads
 * 
 *     def _tag_sentence(self, sentence, predicates=None, heads=None, labels=None):             # <<<<<<<<<<<<<<
 *         """
 *         This function is just an interface to the _tag_sentence signature
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_9_tag_sentence, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalDependencyNetwork_2, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[140])); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[14]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_mstate_global->__pyx_n_u_tag_sentence, __pyx_t_2) < 0) __PYX_ERR(5, 77, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":87
 *             self._tag_sentence_labeled_dependency(sentence, heads, labels)
 * 
 *     def _tag_sentence_unlabeled_dependency(self, np.ndarray sentence, np.ndarray heads=None):             # <<<<<<<<<<<<<<
 *         """
 *         Run the network for the unlabeled dependency task.
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_11_tag_sentence_unlabeled_dependency, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalDependencyNetwork_3, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[141])); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[5]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_mstate_global->__pyx_n_u_tag_sentence_unlabeled_dependen, __pyx_t_2) < 0) __PYX_ERR(5, 87, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":134
 *         return answer
 * 
 *     def _tag_sentence_labeled_dependency(self, np.ndarray sentence, np.ndarray heads,             # <<<<<<<<<<<<<<
 *                                          np.ndarray labels=None):
 *         """
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_13_tag_sentence_labeled_dependency, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalDependencyNetwork_4, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[142])); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[5]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_mstate_global->__pyx_n_u_tag_sentence_labeled_dependency, __pyx_t_2) < 0) __PYX_ERR(5, 134, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":172
 *         return answer
 * 
 *     def _calculate_gradients(self, gold_head, scores):             # <<<<<<<<<<<<<<
 *         """
 *         Calculate the gradients to be applied in the backpropagation. Gradients
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_15_calculate_gradients, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalDependencyNetwork_5, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[143])); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_mstate_global->__pyx_n_u_calculate_gradients, __pyx_t_2) < 0) __PYX_ERR(5, 172, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":212
 *         return True
 * 
 *     def _validate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Evaluate the network performance by token hit and whole sentence hit.
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_17_validate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalDependencyNetwork_6, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[144])); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_mstate_global->__pyx_n_u_validate, __pyx_t_2) < 0) __PYX_ERR(5, 212, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":251
 * 
 * 
 *     def _average_error(self):             # <<<<<<<<<<<<<<
 *         """
 *         Average the network error over tokens.
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_19_average_error, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalDependencyNetwork_7, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[145])); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_mstate_global->__pyx_n_u_average_error, __pyx_t_2) < 0) __PYX_ERR(5, 251, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":257
 *         self.error = self.error / self.num_tokens
 * 
 *     def _print_epoch_report(self, int num):             # <<<<<<<<<<<<<<
 *         """
 *         Reports the status of the network in the given training
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_21_print_epoch_report, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalDependencyNetwork_8, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[146])); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_mstate_global->__pyx_n_u_print_epoch_report, __pyx_t_2) < 0) __PYX_ERR(5, 257, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":273
 *                                             self.learning_rate))
 * 
 *     def tag_sentence(self, np.ndarray sentence, np.ndarray heads=None):             # <<<<<<<<<<<<<<
 *         """
 *         If heads is not given, compute the dependency edges in the sentence.
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_23tag_sentence, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalDependencyNetwork_t_2, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[147])); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[5]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_mstate_global->__pyx_n_u_tag_sentence_2, __pyx_t_2) < 0) __PYX_ERR(5, 273, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":287
 *             return self._tag_sentence_labeled_dependency(sentence, heads)
 * 
 *     def _find_cycles(self, np.ndarray graph):             # <<<<<<<<<<<<<<
 *         """
 *         Check if the given graph has cycles and returns the first one
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_25_find_cycles, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalDependencyNetwork_9, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[148])); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_mstate_global->__pyx_n_u_find_cycles, __pyx_t_2) < 0) __PYX_ERR(5, 287, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":318
 *         return cycles
 * 
 *     def _find_cycle_recursive(self, np.ndarray graph, int vertex, set visited,             # <<<<<<<<<<<<<<
 *                               set reachable, set unreachable):
 *         """
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_27_find_cycle_recursive, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalDependencyNetwork_10, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[149])); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_mstate_global->__pyx_n_u_find_cycle_recursive, __pyx_t_2) < 0) __PYX_ERR(5, 318, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":358
 *         return cycle
 * 
 *     def _contract_cycle(self, heads, cycle):             # <<<<<<<<<<<<<<
 *         """
 *         Contract the given cycle in the dependency graph.
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_29_contract_cycle, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalDependencyNetwork_11, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[150])); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_mstate_global->__pyx_n_u_contract_cycle, __pyx_t_2) < 0) __PYX_ERR(5, 358, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/networkdependencyconv.pyx":433
 *         self.dependency_weights[cycle_inds, outside] = incoming_weights
 * 
 *     def _find_maximum_spanning_tree(self):             # <<<<<<<<<<<<<<
 *         """
 *         Run the Chu-Liu / Edmond's algorithm in order to find the highest
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_31_find_maximum_spanning_tree, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalDependencyNetwork_12, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[151])); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_mstate_global->__pyx_n_u_find_maximum_spanning_tree, __pyx_t_2) < 0) __PYX_ERR(5, 433, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_33__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalDependencyNetwork_13, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[153])); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ConvolutionalDependencyNetwork, (type(self), 0xca52c1e, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ConvolutionalDependencyNetwork__set_state(self, __pyx_state)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_30ConvolutionalDependencyNetwork_35__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConvolutionalDependencyNetwork_14, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[154])); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6nltkor_3tag_4libs_7network_ConvolutionalDependencyNetwork, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(4, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_Network(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_1__pyx_unpickle_Network, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Network, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[155])); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Network, __pyx_t_2) < 0) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":11
 *         __pyx_unpickle_Network__set_state(<Network> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Network__set_state(Network __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.accuracy = __pyx_state[0]; __pyx_result.answer_score = __pyx_state[1]; __pyx_result.decay_factor = __pyx_state[2]; __pyx_result.error = __pyx_state[3]; __pyx_result.feature_tables = __pyx_state[4]; __pyx_result.features_per_token = __pyx_state[5]; __pyx_result.float_errors = __pyx_state[6]; __pyx_result.hidden_bias = __pyx_state[7]; __pyx_result.hidden_sent_values = __pyx_state[8]; __pyx_result.hidden_size = __pyx_state[9]; __pyx_result.hidden_values = __pyx_state[10]; __pyx_result.hidden_weights = __pyx_state[11]; __pyx_result.input_sent_values = __pyx_state[12]; __pyx_result.input_size = __pyx_state[13]; __pyx_result.input_values = __pyx_state[14]; __pyx_result.layer2_sent_values = __pyx_state[15]; __pyx_result.layer2_values = __pyx_state[16]; __pyx_result.learning_rate = __pyx_state[17]; __pyx_result.learning_rate_features = __pyx_state[18]; __pyx_result.learning_rate_trans = __pyx_state[19]; __pyx_result.net_gradients = __pyx_state[20]; __pyx_result.network_filename = __pyx_state[21]; __pyx_result.network_text_filename = __pyx_state[22]; __pyx_result.num_tokens = __pyx_state[23]; __pyx_result.output_bias = __pyx_state[24]; __pyx_result.output_size = __pyx_state[25]; __pyx_result.output_weights = __pyx_state[26]; __pyx_result.padding_left = __pyx_state[27]; __pyx_result.padding_right = __pyx_state[28]; __pyx_result.pos_padding = __pyx_state[29]; __pyx_result.pre_padding = __pyx_state[30]; __pyx_result.sentence_accuracy = __pyx_state[31]; __pyx_result.sentence_lookup = __pyx_state[32]; __pyx_result.skips = __pyx_state[33]; __pyx_result.trans_gradients = __pyx_state[34]; __pyx_result.transitions = __pyx_state[35]; __pyx_result.use_learning_rate_decay = __pyx_state[36]; __pyx_result.validation_sentences = __pyx_state[37]; __pyx_result.validation_tags = __pyx_state[38]; __pyx_result.word_window_size = __pyx_state[39]
 *     if len(__pyx_state) > 40 and hasattr(__pyx_result, '__dict__'):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_3__pyx_unpickle_ConvolutionalNetwork, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ConvolutionalNetw, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[157])); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ConvolutionalNetw, __pyx_t_2) < 0) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_ConvolutionalDependencyNetwork(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6nltkor_3tag_4libs_7network_5__pyx_unpickle_ConvolutionalDependencyNetwork, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ConvolutionalDepe, NULL, __pyx_mstate_global->__pyx_n_u_nltkor_tag_libs_network, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[159])); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ConvolutionalDepe, __pyx_t_2) < 0) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "nltkor/tag/libs/network.pyx":1
 * # -*- coding: utf-8 -*-             # <<<<<<<<<<<<<<
 * #cython: embedsignature=True
 * #cython: profile=True
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_TraceReturnValue(Py_None, 2, 0, __PYX_ERR(0, 1, __pyx_L1_error));
  __Pyx_PyMonitoring_ExitScope(0);

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_TraceException(__pyx_lineno, 0, 0);
  __Pyx_TraceExceptionUnwind(2, 0);
  if (__pyx_m) {
    if (__pyx_mstate->__pyx_d && stringtab_initialized) {
      __Pyx_AddTraceback("init nltkor.tag.libs.network", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    #if !CYTHON_USE_MODULE_STATE
    Py_CLEAR(__pyx_m);
    #else
    Py_DECREF(__pyx_m);
    if (pystate_addmodule_run) {
      PyObject *tp, *value, *tb;
      PyErr_Fetch(&tp, &value, &tb);
      PyState_RemoveModule(&__pyx_moduledef);
      PyErr_Restore(tp, value, tb);
    }
    #endif
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init nltkor.tag.libs.network");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #else
  return __pyx_m;
  #endif
}
/* #### Code section: pystring_table ### */

typedef struct {
    const char *s;
#if 1280 <= 65535
    const unsigned short n;
#elif 1280 / 2 < INT_MAX
    const unsigned int n;
#elif 1280 / 2 < LONG_MAX
    const unsigned long n;
#else
    const Py_ssize_t n;
#endif
#if 1 <= 31
    const unsigned int encoding : 5;
#elif 1 <= 255
    const unsigned char encoding;
#elif 1 <= 65535
    const unsigned short encoding;
#else
    const Py_ssize_t encoding;
#endif
    const unsigned int is_unicode : 1;
    const unsigned int intern : 1;
} __Pyx_StringTabEntry;
static const char * const __pyx_string_tab_encodings[] = { 0 };
static const __Pyx_StringTabEntry __pyx_string_tab[] = {
  {__pyx_k_, sizeof(__pyx_k_), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ */
  {__pyx_k_Accuracy, sizeof(__pyx_k_Accuracy), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Accuracy */
  {__pyx_k_Confidence_measure_not_implement, sizeof(__pyx_k_Confidence_measure_not_implement), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Confidence_measure_not_implement */
  {__pyx_k_Convolution_layer_size, sizeof(__pyx_k_Convolution_layer_size), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Convolution_layer_size */
  {__pyx_k_ConvolutionalDependencyNetwork, sizeof(__pyx_k_ConvolutionalDependencyNetwork), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalDependencyNetwork */
  {__pyx_k_ConvolutionalDependencyNetwork_10, sizeof(__pyx_k_ConvolutionalDependencyNetwork_10), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalDependencyNetwork_10 */
  {__pyx_k_ConvolutionalDependencyNetwork_11, sizeof(__pyx_k_ConvolutionalDependencyNetwork_11), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalDependencyNetwork_11 */
  {__pyx_k_ConvolutionalDependencyNetwork_12, sizeof(__pyx_k_ConvolutionalDependencyNetwork_12), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalDependencyNetwork_12 */
  {__pyx_k_ConvolutionalDependencyNetwork_13, sizeof(__pyx_k_ConvolutionalDependencyNetwork_13), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalDependencyNetwork_13 */
  {__pyx_k_ConvolutionalDependencyNetwork_14, sizeof(__pyx_k_ConvolutionalDependencyNetwork_14), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalDependencyNetwork_14 */
  {__pyx_k_ConvolutionalDependencyNetwork_2, sizeof(__pyx_k_ConvolutionalDependencyNetwork_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalDependencyNetwork_2 */
  {__pyx_k_ConvolutionalDependencyNetwork_3, sizeof(__pyx_k_ConvolutionalDependencyNetwork_3), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalDependencyNetwork_3 */
  {__pyx_k_ConvolutionalDependencyNetwork_4, sizeof(__pyx_k_ConvolutionalDependencyNetwork_4), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalDependencyNetwork_4 */
  {__pyx_k_ConvolutionalDependencyNetwork_5, sizeof(__pyx_k_ConvolutionalDependencyNetwork_5), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalDependencyNetwork_5 */
  {__pyx_k_ConvolutionalDependencyNetwork_6, sizeof(__pyx_k_ConvolutionalDependencyNetwork_6), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalDependencyNetwork_6 */
  {__pyx_k_ConvolutionalDependencyNetwork_7, sizeof(__pyx_k_ConvolutionalDependencyNetwork_7), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalDependencyNetwork_7 */
  {__pyx_k_ConvolutionalDependencyNetwork_8, sizeof(__pyx_k_ConvolutionalDependencyNetwork_8), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalDependencyNetwork_8 */
  {__pyx_k_ConvolutionalDependencyNetwork_9, sizeof(__pyx_k_ConvolutionalDependencyNetwork_9), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalDependencyNetwork_9 */
  {__pyx_k_ConvolutionalDependencyNetwork_l, sizeof(__pyx_k_ConvolutionalDependencyNetwork_l), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalDependencyNetwork_l */
  {__pyx_k_ConvolutionalDependencyNetwork_s, sizeof(__pyx_k_ConvolutionalDependencyNetwork_s), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalDependencyNetwork_s */
  {__pyx_k_ConvolutionalDependencyNetwork_s_2, sizeof(__pyx_k_ConvolutionalDependencyNetwork_s_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalDependencyNetwork_s_2 */
  {__pyx_k_ConvolutionalDependencyNetwork_t, sizeof(__pyx_k_ConvolutionalDependencyNetwork_t), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalDependencyNetwork_t */
  {__pyx_k_ConvolutionalDependencyNetwork_t_2, sizeof(__pyx_k_ConvolutionalDependencyNetwork_t_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalDependencyNetwork_t_2 */
  {__pyx_k_ConvolutionalNetwork, sizeof(__pyx_k_ConvolutionalNetwork), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalNetwork */
  {__pyx_k_ConvolutionalNetwork___reduce_cy, sizeof(__pyx_k_ConvolutionalNetwork___reduce_cy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalNetwork___reduce_cy */
  {__pyx_k_ConvolutionalNetwork___setstate, sizeof(__pyx_k_ConvolutionalNetwork___setstate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalNetwork___setstate */
  {__pyx_k_ConvolutionalNetwork__adjust_fea, sizeof(__pyx_k_ConvolutionalNetwork__adjust_fea), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalNetwork__adjust_fea */
  {__pyx_k_ConvolutionalNetwork__adjust_wei, sizeof(__pyx_k_ConvolutionalNetwork__adjust_wei), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalNetwork__adjust_wei */
  {__pyx_k_ConvolutionalNetwork__backpropag, sizeof(__pyx_k_ConvolutionalNetwork__backpropag), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalNetwork__backpropag */
  {__pyx_k_ConvolutionalNetwork__calculate, sizeof(__pyx_k_ConvolutionalNetwork__calculate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalNetwork__calculate */
  {__pyx_k_ConvolutionalNetwork__calculate_2, sizeof(__pyx_k_ConvolutionalNetwork__calculate_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalNetwork__calculate_2 */
  {__pyx_k_ConvolutionalNetwork__calculate_3, sizeof(__pyx_k_ConvolutionalNetwork__calculate_3), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalNetwork__calculate_3 */
  {__pyx_k_ConvolutionalNetwork__create_con, sizeof(__pyx_k_ConvolutionalNetwork__create_con), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalNetwork__create_con */
  {__pyx_k_ConvolutionalNetwork__create_pre, sizeof(__pyx_k_ConvolutionalNetwork__create_pre), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalNetwork__create_pre */
  {__pyx_k_ConvolutionalNetwork__create_tar, sizeof(__pyx_k_ConvolutionalNetwork__create_tar), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalNetwork__create_tar */
  {__pyx_k_ConvolutionalNetwork__generate_s, sizeof(__pyx_k_ConvolutionalNetwork__generate_s), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalNetwork__generate_s */
  {__pyx_k_ConvolutionalNetwork__load_from, sizeof(__pyx_k_ConvolutionalNetwork__load_from), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalNetwork__load_from */
  {__pyx_k_ConvolutionalNetwork__load_param, sizeof(__pyx_k_ConvolutionalNetwork__load_param), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalNetwork__load_param */
  {__pyx_k_ConvolutionalNetwork__pre_taggin, sizeof(__pyx_k_ConvolutionalNetwork__pre_taggin), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalNetwork__pre_taggin */
  {__pyx_k_ConvolutionalNetwork__reset_coun, sizeof(__pyx_k_ConvolutionalNetwork__reset_coun), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalNetwork__reset_coun */
  {__pyx_k_ConvolutionalNetwork__sentence_c, sizeof(__pyx_k_ConvolutionalNetwork__sentence_c), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalNetwork__sentence_c */
  {__pyx_k_ConvolutionalNetwork__shuffle_da, sizeof(__pyx_k_ConvolutionalNetwork__shuffle_da), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalNetwork__shuffle_da */
  {__pyx_k_ConvolutionalNetwork__tag_senten, sizeof(__pyx_k_ConvolutionalNetwork__tag_senten), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalNetwork__tag_senten */
  {__pyx_k_ConvolutionalNetwork__train_epoc, sizeof(__pyx_k_ConvolutionalNetwork__train_epoc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalNetwork__train_epoc */
  {__pyx_k_ConvolutionalNetwork__validate, sizeof(__pyx_k_ConvolutionalNetwork__validate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalNetwork__validate */
  {__pyx_k_ConvolutionalNetwork__viterbi, sizeof(__pyx_k_ConvolutionalNetwork__viterbi), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalNetwork__viterbi */
  {__pyx_k_ConvolutionalNetwork_create_new, sizeof(__pyx_k_ConvolutionalNetwork_create_new), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalNetwork_create_new */
  {__pyx_k_ConvolutionalNetwork_description, sizeof(__pyx_k_ConvolutionalNetwork_description), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalNetwork_description */
  {__pyx_k_ConvolutionalNetwork_load_from_f, sizeof(__pyx_k_ConvolutionalNetwork_load_from_f), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalNetwork_load_from_f */
  {__pyx_k_ConvolutionalNetwork_save, sizeof(__pyx_k_ConvolutionalNetwork_save), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalNetwork_save */
  {__pyx_k_ConvolutionalNetwork_set_validat, sizeof(__pyx_k_ConvolutionalNetwork_set_validat), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalNetwork_set_validat */
  {__pyx_k_ConvolutionalNetwork_tag_sentenc, sizeof(__pyx_k_ConvolutionalNetwork_tag_sentenc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalNetwork_tag_sentenc */
  {__pyx_k_ConvolutionalNetwork_train, sizeof(__pyx_k_ConvolutionalNetwork_train), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ConvolutionalNetwork_train */
  {__pyx_k_Distance_table_sizes_target_and, sizeof(__pyx_k_Distance_table_sizes_target_and), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Distance_table_sizes_target_and */
  {__pyx_k_Feature_table_sizes, sizeof(__pyx_k_Feature_table_sizes), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Feature_table_sizes */
  {__pyx_k_FloatingPointError, sizeof(__pyx_k_FloatingPointError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FloatingPointError */
  {__pyx_k_Hidden_layer_size, sizeof(__pyx_k_Hidden_layer_size), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Hidden_layer_size */
  {__pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ImportError */
  {__pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Incompatible_checksums_0x_x_vs_0 */
  {__pyx_k_Incompatible_checksums_0x_x_vs_0_2, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Incompatible_checksums_0x_x_vs_0_2 */
  {__pyx_k_Incompatible_checksums_0x_x_vs_0_3, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0_3), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Incompatible_checksums_0x_x_vs_0_3 */
  {__pyx_k_Infinity, sizeof(__pyx_k_Infinity), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Infinity */
  {__pyx_k_Input_layer_size, sizeof(__pyx_k_Input_layer_size), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Input_layer_size */
  {__pyx_k_Logger, sizeof(__pyx_k_Logger), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Logger */
  {__pyx_k_Network, sizeof(__pyx_k_Network), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Network */
  {__pyx_k_Network___reduce_cython, sizeof(__pyx_k_Network___reduce_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Network___reduce_cython */
  {__pyx_k_Network___setstate_cython, sizeof(__pyx_k_Network___setstate_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Network___setstate_cython */
  {__pyx_k_Network__backpropagate, sizeof(__pyx_k_Network__backpropagate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Network__backpropagate */
  {__pyx_k_Network__calculate_delta, sizeof(__pyx_k_Network__calculate_delta), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Network__calculate_delta */
  {__pyx_k_Network__calculate_gradients_sll, sizeof(__pyx_k_Network__calculate_gradients_sll), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Network__calculate_gradients_sll */
  {__pyx_k_Network__calculate_gradients_wll, sizeof(__pyx_k_Network__calculate_gradients_wll), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Network__calculate_gradients_wll */
  {__pyx_k_Network__create_sentence_lookup, sizeof(__pyx_k_Network__create_sentence_lookup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Network__create_sentence_lookup */
  {__pyx_k_Network__load_parameters, sizeof(__pyx_k_Network__load_parameters), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Network__load_parameters */
  {__pyx_k_Network__print_epoch_report, sizeof(__pyx_k_Network__print_epoch_report), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Network__print_epoch_report */
  {__pyx_k_Network__tag_sentence, sizeof(__pyx_k_Network__tag_sentence), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Network__tag_sentence */
  {__pyx_k_Network__train_epoch, sizeof(__pyx_k_Network__train_epoch), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Network__train_epoch */
  {__pyx_k_Network__validate, sizeof(__pyx_k_Network__validate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Network__validate */
  {__pyx_k_Network__viterbi, sizeof(__pyx_k_Network__viterbi), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Network__viterbi */
  {__pyx_k_Network_create_new, sizeof(__pyx_k_Network_create_new), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Network_create_new */
  {__pyx_k_Network_decrease_learning_rates, sizeof(__pyx_k_Network_decrease_learning_rates), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Network_decrease_learning_rates */
  {__pyx_k_Network_description, sizeof(__pyx_k_Network_description), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Network_description */
  {__pyx_k_Network_load_from_file, sizeof(__pyx_k_Network_load_from_file), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Network_load_from_file */
  {__pyx_k_Network_save, sizeof(__pyx_k_Network_save), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Network_save */
  {__pyx_k_Network_set_learning_rate_decay, sizeof(__pyx_k_Network_set_learning_rate_decay), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Network_set_learning_rate_decay */
  {__pyx_k_Network_set_validation_data, sizeof(__pyx_k_Network_set_validation_data), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Network_set_validation_data */
  {__pyx_k_Network_tag_sentence, sizeof(__pyx_k_Network_tag_sentence), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Network_tag_sentence */
  {__pyx_k_Network_train, sizeof(__pyx_k_Network_train), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Network_train */
  {__pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NotImplementedError */
  {__pyx_k_Note_that_Cython_is_deliberately, sizeof(__pyx_k_Note_that_Cython_is_deliberately), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Note_that_Cython_is_deliberately */
  {__pyx_k_Output_size, sizeof(__pyx_k_Output_size), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Output_size */
  {__pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_PickleError */
  {__pyx_k_Saved_model, sizeof(__pyx_k_Saved_model), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Saved_model */
  {__pyx_k_Second_hidden_layer_size, sizeof(__pyx_k_Second_hidden_layer_size), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Second_hidden_layer_size */
  {__pyx_k_Sentence_accuracy, sizeof(__pyx_k_Sentence_accuracy), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Sentence_accuracy */
  {__pyx_k_T, sizeof(__pyx_k_T), 0, 1, 1}, /* PyObject cname: __pyx_n_u_T */
  {__pyx_k_Token_accuracy, sizeof(__pyx_k_Token_accuracy), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Token_accuracy */
  {__pyx_k_Training_for_up_to_d_epochs, sizeof(__pyx_k_Training_for_up_to_d_epochs), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Training_for_up_to_d_epochs */
  {__pyx_k_Word_window_size, sizeof(__pyx_k_Word_window_size), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Word_window_size */
  {__pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__2 */
  {__pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__3 */
  {__pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__4 */
  {__pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__5 */
  {__pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__6 */
  {__pyx_k_a, sizeof(__pyx_k_a), 0, 1, 1}, /* PyObject cname: __pyx_n_u_a */
  {__pyx_k_add, sizeof(__pyx_k_add), 0, 1, 1}, /* PyObject cname: __pyx_n_u_add */
  {__pyx_k_add_note, sizeof(__pyx_k_add_note), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_add_note */
  {__pyx_k_adjust_features, sizeof(__pyx_k_adjust_features), 0, 1, 1}, /* PyObject cname: __pyx_n_u_adjust_features */
  {__pyx_k_adjust_weights, sizeof(__pyx_k_adjust_weights), 0, 1, 1}, /* PyObject cname: __pyx_n_u_adjust_weights */
  {__pyx_k_all_scores, sizeof(__pyx_k_all_scores), 0, 1, 1}, /* PyObject cname: __pyx_n_u_all_scores */
  {__pyx_k_allow_pickle, sizeof(__pyx_k_allow_pickle), 0, 1, 1}, /* PyObject cname: __pyx_n_u_allow_pickle */
  {__pyx_k_allow_repeats, sizeof(__pyx_k_allow_repeats), 0, 1, 1}, /* PyObject cname: __pyx_n_u_allow_repeats */
  {__pyx_k_answer, sizeof(__pyx_k_answer), 0, 1, 1}, /* PyObject cname: __pyx_n_u_answer */
  {__pyx_k_arange, sizeof(__pyx_k_arange), 0, 1, 1}, /* PyObject cname: __pyx_n_u_arange */
  {__pyx_k_argmax, sizeof(__pyx_k_argmax), 0, 1, 1}, /* PyObject cname: __pyx_n_u_argmax */
  {__pyx_k_args, sizeof(__pyx_k_args), 0, 1, 1}, /* PyObject cname: __pyx_n_u_args */
  {__pyx_k_argument, sizeof(__pyx_k_argument), 0, 1, 1}, /* PyObject cname: __pyx_n_u_argument */
  {__pyx_k_argument_blocks, sizeof(__pyx_k_argument_blocks), 0, 1, 1}, /* PyObject cname: __pyx_n_u_argument_blocks */
  {__pyx_k_argument_distances, sizeof(__pyx_k_argument_distances), 0, 1, 1}, /* PyObject cname: __pyx_n_u_argument_distances */
  {__pyx_k_arguments, sizeof(__pyx_k_arguments), 0, 1, 1}, /* PyObject cname: __pyx_n_u_arguments */
  {__pyx_k_array, sizeof(__pyx_k_array), 0, 1, 1}, /* PyObject cname: __pyx_n_u_array */
  {__pyx_k_astype, sizeof(__pyx_k_astype), 0, 1, 1}, /* PyObject cname: __pyx_n_u_astype */
  {__pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 1, 1}, /* PyObject cname: __pyx_n_u_asyncio_coroutines */
  {__pyx_k_average_error, sizeof(__pyx_k_average_error), 0, 1, 1}, /* PyObject cname: __pyx_n_u_average_error */
  {__pyx_k_axis, sizeof(__pyx_k_axis), 0, 1, 1}, /* PyObject cname: __pyx_n_u_axis */
  {__pyx_k_backpropagate, sizeof(__pyx_k_backpropagate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_backpropagate */
  {__pyx_k_best_scores, sizeof(__pyx_k_best_scores), 0, 1, 1}, /* PyObject cname: __pyx_n_u_best_scores */
  {__pyx_k_bincount, sizeof(__pyx_k_bincount), 0, 1, 1}, /* PyObject cname: __pyx_n_u_bincount */
  {__pyx_k_calculate_all_scores, sizeof(__pyx_k_calculate_all_scores), 0, 1, 1}, /* PyObject cname: __pyx_n_u_calculate_all_scores */
  {__pyx_k_calculate_delta, sizeof(__pyx_k_calculate_delta), 0, 1, 1}, /* PyObject cname: __pyx_n_u_calculate_delta */
  {__pyx_k_calculate_gradients, sizeof(__pyx_k_calculate_gradients), 0, 1, 1}, /* PyObject cname: __pyx_n_u_calculate_gradients */
  {__pyx_k_calculate_gradients_classify, sizeof(__pyx_k_calculate_gradients_classify), 0, 1, 1}, /* PyObject cname: __pyx_n_u_calculate_gradients_classify */
  {__pyx_k_calculate_gradients_sll, sizeof(__pyx_k_calculate_gradients_sll), 0, 1, 1}, /* PyObject cname: __pyx_n_u_calculate_gradients_sll */
  {__pyx_k_calculate_gradients_wll, sizeof(__pyx_k_calculate_gradients_wll), 0, 1, 1}, /* PyObject cname: __pyx_n_u_calculate_gradients_wll */
  {__pyx_k_calculate_input_deltas, sizeof(__pyx_k_calculate_input_deltas), 0, 1, 1}, /* PyObject cname: __pyx_n_u_calculate_input_deltas */
  {__pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 1, 1}, /* PyObject cname: __pyx_n_u_class_getitem */
  {__pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cline_in_traceback */
  {__pyx_k_clip, sizeof(__pyx_k_clip), 0, 1, 1}, /* PyObject cname: __pyx_n_u_clip */
  {__pyx_k_close, sizeof(__pyx_k_close), 0, 1, 1}, /* PyObject cname: __pyx_n_u_close */
  {__pyx_k_cls, sizeof(__pyx_k_cls), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cls */
  {__pyx_k_column_numbers, sizeof(__pyx_k_column_numbers), 0, 1, 1}, /* PyObject cname: __pyx_n_u_column_numbers */
  {__pyx_k_concatenate, sizeof(__pyx_k_concatenate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_concatenate */
  {__pyx_k_confidence, sizeof(__pyx_k_confidence), 0, 1, 1}, /* PyObject cname: __pyx_n_u_confidence */
  {__pyx_k_conflicting_probs, sizeof(__pyx_k_conflicting_probs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_conflicting_probs */
  {__pyx_k_conflicting_tag, sizeof(__pyx_k_conflicting_tag), 0, 1, 1}, /* PyObject cname: __pyx_n_u_conflicting_tag */
  {__pyx_k_contract_cycle, sizeof(__pyx_k_contract_cycle), 0, 1, 1}, /* PyObject cname: __pyx_n_u_contract_cycle */
  {__pyx_k_convolution_lookup, sizeof(__pyx_k_convolution_lookup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_convolution_lookup */
  {__pyx_k_convolution_max, sizeof(__pyx_k_convolution_max), 0, 1, 1}, /* PyObject cname: __pyx_n_u_convolution_max */
  {__pyx_k_convolution_values, sizeof(__pyx_k_convolution_values), 0, 1, 1}, /* PyObject cname: __pyx_n_u_convolution_values */
  {__pyx_k_copy, sizeof(__pyx_k_copy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_copy */
  {__pyx_k_correct_path_score, sizeof(__pyx_k_correct_path_score), 0, 1, 1}, /* PyObject cname: __pyx_n_u_correct_path_score */
  {__pyx_k_correction, sizeof(__pyx_k_correction), 0, 1, 1}, /* PyObject cname: __pyx_n_u_correction */
  {__pyx_k_corrections_skipped_Learning_ra, sizeof(__pyx_k_corrections_skipped_Learning_ra), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_corrections_skipped_Learning_ra */
  {__pyx_k_corrections_skipped_learning_ra, sizeof(__pyx_k_corrections_skipped_learning_ra), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_corrections_skipped_learning_ra */
  {__pyx_k_count_nonzero, sizeof(__pyx_k_count_nonzero), 0, 1, 1}, /* PyObject cname: __pyx_n_u_count_nonzero */
  {__pyx_k_counts, sizeof(__pyx_k_counts), 0, 1, 1}, /* PyObject cname: __pyx_n_u_counts */
  {__pyx_k_create_convolution_lookup, sizeof(__pyx_k_create_convolution_lookup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_create_convolution_lookup */
  {__pyx_k_create_new, sizeof(__pyx_k_create_new), 0, 1, 1}, /* PyObject cname: __pyx_n_u_create_new */
  {__pyx_k_create_new_locals_genexpr, sizeof(__pyx_k_create_new_locals_genexpr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_create_new_locals_genexpr */
  {__pyx_k_create_pred_lookup, sizeof(__pyx_k_create_pred_lookup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_create_pred_lookup */
  {__pyx_k_create_sentence_lookup, sizeof(__pyx_k_create_sentence_lookup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_create_sentence_lookup */
  {__pyx_k_create_target_lookup, sizeof(__pyx_k_create_target_lookup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_create_target_lookup */
  {__pyx_k_cycle, sizeof(__pyx_k_cycle), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cycle */
  {__pyx_k_cycle_inds, sizeof(__pyx_k_cycle_inds), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cycle_inds */
  {__pyx_k_cycle_score, sizeof(__pyx_k_cycle_score), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cycle_score */
  {__pyx_k_cycles, sizeof(__pyx_k_cycles), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cycles */
  {__pyx_k_d, sizeof(__pyx_k_d), 0, 1, 1}, /* PyObject cname: __pyx_n_u_d */
  {__pyx_k_dCd_hidden2, sizeof(__pyx_k_dCd_hidden2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dCd_hidden2 */
  {__pyx_k_dCd_tanh, sizeof(__pyx_k_dCd_tanh), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dCd_tanh */
  {__pyx_k_dCdf_2, sizeof(__pyx_k_dCdf_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dCdf_2 */
  {__pyx_k_dCdf_3, sizeof(__pyx_k_dCdf_3), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dCdf_3 */
  {__pyx_k_data, sizeof(__pyx_k_data), 0, 1, 1}, /* PyObject cname: __pyx_n_u_data */
  {__pyx_k_debug, sizeof(__pyx_k_debug), 0, 1, 1}, /* PyObject cname: __pyx_n_u_debug */
  {__pyx_k_decay_factor, sizeof(__pyx_k_decay_factor), 0, 1, 1}, /* PyObject cname: __pyx_n_u_decay_factor */
  {__pyx_k_decrease_learning_rates, sizeof(__pyx_k_decrease_learning_rates), 0, 1, 1}, /* PyObject cname: __pyx_n_u_decrease_learning_rates */
  {__pyx_k_del, sizeof(__pyx_k_del), 0, 1, 1}, /* PyObject cname: __pyx_n_u_del */
  {__pyx_k_delta, sizeof(__pyx_k_delta), 0, 1, 1}, /* PyObject cname: __pyx_n_u_delta */
  {__pyx_k_delta_softmax, sizeof(__pyx_k_delta_softmax), 0, 1, 1}, /* PyObject cname: __pyx_n_u_delta_softmax */
  {__pyx_k_deltas, sizeof(__pyx_k_deltas), 0, 1, 1}, /* PyObject cname: __pyx_n_u_deltas */
  {__pyx_k_desc, sizeof(__pyx_k_desc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_desc */
  {__pyx_k_description, sizeof(__pyx_k_description), 0, 1, 1}, /* PyObject cname: __pyx_n_u_description */
  {__pyx_k_desired_accuracy, sizeof(__pyx_k_desired_accuracy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_desired_accuracy */
  {__pyx_k_diagonal, sizeof(__pyx_k_diagonal), 0, 1, 1}, /* PyObject cname: __pyx_n_u_diagonal */
  {__pyx_k_dict, sizeof(__pyx_k_dict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dict */
  {__pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dict_2 */
  {__pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_disable */
  {__pyx_k_dist_deltas, sizeof(__pyx_k_dist_deltas), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dist_deltas */
  {__pyx_k_dist_features, sizeof(__pyx_k_dist_features), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dist_features */
  {__pyx_k_dist_features_per_token, sizeof(__pyx_k_dist_features_per_token), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dist_features_per_token */
  {__pyx_k_dist_pred_from, sizeof(__pyx_k_dist_pred_from), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dist_pred_from */
  {__pyx_k_dist_table_dims, sizeof(__pyx_k_dist_table_dims), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dist_table_dims */
  {__pyx_k_dist_target_from, sizeof(__pyx_k_dist_target_from), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dist_target_from */
  {__pyx_k_dot, sizeof(__pyx_k_dot), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dot */
  {__pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dtype */
  {__pyx_k_element, sizeof(__pyx_k_element), 0, 1, 1}, /* PyObject cname: __pyx_n_u_element */
  {__pyx_k_embeddings, sizeof(__pyx_k_embeddings), 0, 1, 1}, /* PyObject cname: __pyx_n_u_embeddings */
  {__pyx_k_empty, sizeof(__pyx_k_empty), 0, 1, 1}, /* PyObject cname: __pyx_n_u_empty */
  {__pyx_k_empty_like, sizeof(__pyx_k_empty_like), 0, 1, 1}, /* PyObject cname: __pyx_n_u_empty_like */
  {__pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_enable */
  {__pyx_k_end, sizeof(__pyx_k_end), 0, 1, 1}, /* PyObject cname: __pyx_n_u_end */
  {__pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_enumerate */
  {__pyx_k_epoch, sizeof(__pyx_k_epoch), 0, 1, 1}, /* PyObject cname: __pyx_n_u_epoch */
  {__pyx_k_epochs, sizeof(__pyx_k_epochs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_epochs */
  {__pyx_k_epochs_Error, sizeof(__pyx_k_epochs_Error), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_epochs_Error */
  {__pyx_k_epochs_between_reports, sizeof(__pyx_k_epochs_between_reports), 0, 1, 1}, /* PyObject cname: __pyx_n_u_epochs_between_reports */
  {__pyx_k_error, sizeof(__pyx_k_error), 0, 1, 1}, /* PyObject cname: __pyx_n_u_error */
  {__pyx_k_exp, sizeof(__pyx_k_exp), 0, 1, 1}, /* PyObject cname: __pyx_n_u_exp */
  {__pyx_k_exp_scores, sizeof(__pyx_k_exp_scores), 0, 1, 1}, /* PyObject cname: __pyx_n_u_exp_scores */
  {__pyx_k_exp_sum, sizeof(__pyx_k_exp_sum), 0, 1, 1}, /* PyObject cname: __pyx_n_u_exp_sum */
  {__pyx_k_exponentials, sizeof(__pyx_k_exponentials), 0, 1, 1}, /* PyObject cname: __pyx_n_u_exponentials */
  {__pyx_k_f, sizeof(__pyx_k_f), 0, 1, 1}, /* PyObject cname: __pyx_n_u_f */
  {__pyx_k_factor, sizeof(__pyx_k_factor), 0, 1, 1}, /* PyObject cname: __pyx_n_u_factor */
  {__pyx_k_feature_tables, sizeof(__pyx_k_feature_tables), 0, 1, 1}, /* PyObject cname: __pyx_n_u_feature_tables */
  {__pyx_k_features, sizeof(__pyx_k_features), 0, 1, 1}, /* PyObject cname: __pyx_n_u_features */
  {__pyx_k_filename, sizeof(__pyx_k_filename), 0, 1, 1}, /* PyObject cname: __pyx_n_u_filename */
  {__pyx_k_fill_diagonal, sizeof(__pyx_k_fill_diagonal), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fill_diagonal */
  {__pyx_k_find_cycle_recursive, sizeof(__pyx_k_find_cycle_recursive), 0, 1, 1}, /* PyObject cname: __pyx_n_u_find_cycle_recursive */
  {__pyx_k_find_cycles, sizeof(__pyx_k_find_cycles), 0, 1, 1}, /* PyObject cname: __pyx_n_u_find_cycles */
  {__pyx_k_find_maximum_spanning_tree, sizeof(__pyx_k_find_maximum_spanning_tree), 0, 1, 1}, /* PyObject cname: __pyx_n_u_find_maximum_spanning_tree */
  {__pyx_k_flatten, sizeof(__pyx_k_flatten), 0, 1, 1}, /* PyObject cname: __pyx_n_u_flatten */
  {__pyx_k_float64, sizeof(__pyx_k_float64), 0, 1, 1}, /* PyObject cname: __pyx_n_u_float64 */
  {__pyx_k_func, sizeof(__pyx_k_func), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func */
  {__pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_gc */
  {__pyx_k_generate_save_dict, sizeof(__pyx_k_generate_save_dict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_generate_save_dict */
  {__pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_genexpr */
  {__pyx_k_get, sizeof(__pyx_k_get), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get */
  {__pyx_k_getLogger, sizeof(__pyx_k_getLogger), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getLogger */
  {__pyx_k_get_state, sizeof(__pyx_k_get_state), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get_state */
  {__pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getstate */
  {__pyx_k_gold_head, sizeof(__pyx_k_gold_head), 0, 1, 1}, /* PyObject cname: __pyx_n_u_gold_head */
  {__pyx_k_gold_tag, sizeof(__pyx_k_gold_tag), 0, 1, 1}, /* PyObject cname: __pyx_n_u_gold_tag */
  {__pyx_k_gold_tags, sizeof(__pyx_k_gold_tags), 0, 1, 1}, /* PyObject cname: __pyx_n_u_gold_tags */
  {__pyx_k_grad_matrix, sizeof(__pyx_k_grad_matrix), 0, 1, 1}, /* PyObject cname: __pyx_n_u_grad_matrix */
  {__pyx_k_grad_times_softmax, sizeof(__pyx_k_grad_times_softmax), 0, 1, 1}, /* PyObject cname: __pyx_n_u_grad_times_softmax */
  {__pyx_k_gradients, sizeof(__pyx_k_gradients), 0, 1, 1}, /* PyObject cname: __pyx_n_u_gradients */
  {__pyx_k_gradients_t, sizeof(__pyx_k_gradients_t), 0, 1, 1}, /* PyObject cname: __pyx_n_u_gradients_t */
  {__pyx_k_graph, sizeof(__pyx_k_graph), 0, 1, 1}, /* PyObject cname: __pyx_n_u_graph */
  {__pyx_k_greater, sizeof(__pyx_k_greater), 0, 1, 1}, /* PyObject cname: __pyx_n_u_greater */
  {__pyx_k_half_window, sizeof(__pyx_k_half_window), 0, 1, 1}, /* PyObject cname: __pyx_n_u_half_window */
  {__pyx_k_hardtanh, sizeof(__pyx_k_hardtanh), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hardtanh */
  {__pyx_k_hardtanhd, sizeof(__pyx_k_hardtanhd), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hardtanhd */
  {__pyx_k_head, sizeof(__pyx_k_head), 0, 1, 1}, /* PyObject cname: __pyx_n_u_head */
  {__pyx_k_head_to_v, sizeof(__pyx_k_head_to_v), 0, 1, 1}, /* PyObject cname: __pyx_n_u_head_to_v */
  {__pyx_k_heads, sizeof(__pyx_k_heads), 0, 1, 1}, /* PyObject cname: __pyx_n_u_heads */
  {__pyx_k_hidden1_bias, sizeof(__pyx_k_hidden1_bias), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hidden1_bias */
  {__pyx_k_hidden1_size, sizeof(__pyx_k_hidden1_size), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hidden1_size */
  {__pyx_k_hidden1_weights, sizeof(__pyx_k_hidden1_weights), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hidden1_weights */
  {__pyx_k_hidden2_before_activation, sizeof(__pyx_k_hidden2_before_activation), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hidden2_before_activation */
  {__pyx_k_hidden2_bias, sizeof(__pyx_k_hidden2_bias), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hidden2_bias */
  {__pyx_k_hidden2_gradients, sizeof(__pyx_k_hidden2_gradients), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hidden2_gradients */
  {__pyx_k_hidden2_size, sizeof(__pyx_k_hidden2_size), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hidden2_size */
  {__pyx_k_hidden2_values, sizeof(__pyx_k_hidden2_values), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hidden2_values */
  {__pyx_k_hidden2_weights, sizeof(__pyx_k_hidden2_weights), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hidden2_weights */
  {__pyx_k_hidden_before_activation, sizeof(__pyx_k_hidden_before_activation), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hidden_before_activation */
  {__pyx_k_hidden_bias, sizeof(__pyx_k_hidden_bias), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hidden_bias */
  {__pyx_k_hidden_bias_deltas, sizeof(__pyx_k_hidden_bias_deltas), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hidden_bias_deltas */
  {__pyx_k_hidden_deltas, sizeof(__pyx_k_hidden_deltas), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hidden_deltas */
  {__pyx_k_hidden_gradients, sizeof(__pyx_k_hidden_gradients), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hidden_gradients */
  {__pyx_k_hidden_size, sizeof(__pyx_k_hidden_size), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hidden_size */
  {__pyx_k_hidden_weights, sizeof(__pyx_k_hidden_weights), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hidden_weights */
  {__pyx_k_high, sizeof(__pyx_k_high), 0, 1, 1}, /* PyObject cname: __pyx_n_u_high */
  {__pyx_k_highest_prob_arg, sizeof(__pyx_k_highest_prob_arg), 0, 1, 1}, /* PyObject cname: __pyx_n_u_highest_prob_arg */
  {__pyx_k_hits, sizeof(__pyx_k_hits), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hits */
  {__pyx_k_i, sizeof(__pyx_k_i), 0, 1, 1}, /* PyObject cname: __pyx_n_u_i */
  {__pyx_k_i_args, sizeof(__pyx_k_i_args), 0, 1, 1}, /* PyObject cname: __pyx_n_u_i_args */
  {__pyx_k_incoming_weights, sizeof(__pyx_k_incoming_weights), 0, 1, 1}, /* PyObject cname: __pyx_n_u_incoming_weights */
  {__pyx_k_ind_from, sizeof(__pyx_k_ind_from), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ind_from */
  {__pyx_k_ind_to, sizeof(__pyx_k_ind_to), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ind_to */
  {__pyx_k_index, sizeof(__pyx_k_index), 0, 1, 1}, /* PyObject cname: __pyx_n_u_index */
  {__pyx_k_inds, sizeof(__pyx_k_inds), 0, 1, 1}, /* PyObject cname: __pyx_n_u_inds */
  {__pyx_k_info, sizeof(__pyx_k_info), 0, 1, 1}, /* PyObject cname: __pyx_n_u_info */
  {__pyx_k_init, sizeof(__pyx_k_init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_init */
  {__pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_initializing */
  {__pyx_k_inplace, sizeof(__pyx_k_inplace), 0, 1, 1}, /* PyObject cname: __pyx_n_u_inplace */
  {__pyx_k_input_and_pred_dist_values, sizeof(__pyx_k_input_and_pred_dist_values), 0, 1, 1}, /* PyObject cname: __pyx_n_u_input_and_pred_dist_values */
  {__pyx_k_input_data, sizeof(__pyx_k_input_data), 0, 1, 1}, /* PyObject cname: __pyx_n_u_input_data */
  {__pyx_k_input_deltas, sizeof(__pyx_k_input_deltas), 0, 1, 1}, /* PyObject cname: __pyx_n_u_input_deltas */
  {__pyx_k_input_gradients, sizeof(__pyx_k_input_gradients), 0, 1, 1}, /* PyObject cname: __pyx_n_u_input_gradients */
  {__pyx_k_input_size, sizeof(__pyx_k_input_size), 0, 1, 1}, /* PyObject cname: __pyx_n_u_input_size */
  {__pyx_k_input_size_with_distance, sizeof(__pyx_k_input_size_with_distance), 0, 1, 1}, /* PyObject cname: __pyx_n_u_input_size_with_distance */
  {__pyx_k_input_values, sizeof(__pyx_k_input_values), 0, 1, 1}, /* PyObject cname: __pyx_n_u_input_values */
  {__pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_coroutine */
  {__pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_isenabled */
  {__pyx_k_j, sizeof(__pyx_k_j), 0, 1, 1}, /* PyObject cname: __pyx_n_u_j */
  {__pyx_k_label, sizeof(__pyx_k_label), 0, 1, 1}, /* PyObject cname: __pyx_n_u_label */
  {__pyx_k_labels, sizeof(__pyx_k_labels), 0, 1, 1}, /* PyObject cname: __pyx_n_u_labels */
  {__pyx_k_last_accuracy, sizeof(__pyx_k_last_accuracy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_last_accuracy */
  {__pyx_k_last_error, sizeof(__pyx_k_last_error), 0, 1, 1}, /* PyObject cname: __pyx_n_u_last_error */
  {__pyx_k_last_tag, sizeof(__pyx_k_last_tag), 0, 1, 1}, /* PyObject cname: __pyx_n_u_last_tag */
  {__pyx_k_last_token, sizeof(__pyx_k_last_token), 0, 1, 1}, /* PyObject cname: __pyx_n_u_last_token */
  {__pyx_k_last_values, sizeof(__pyx_k_last_values), 0, 1, 1}, /* PyObject cname: __pyx_n_u_last_values */
  {__pyx_k_less, sizeof(__pyx_k_less), 0, 1, 1}, /* PyObject cname: __pyx_n_u_less */
  {__pyx_k_load, sizeof(__pyx_k_load), 0, 1, 1}, /* PyObject cname: __pyx_n_u_load */
  {__pyx_k_load_from_file, sizeof(__pyx_k_load_from_file), 0, 1, 1}, /* PyObject cname: __pyx_n_u_load_from_file */
  {__pyx_k_load_from_file_2, sizeof(__pyx_k_load_from_file_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_load_from_file_2 */
  {__pyx_k_load_parameters, sizeof(__pyx_k_load_parameters), 0, 1, 1}, /* PyObject cname: __pyx_n_u_load_parameters */
  {__pyx_k_log, sizeof(__pyx_k_log), 0, 1, 1}, /* PyObject cname: __pyx_n_u_log */
  {__pyx_k_log_sum_scores, sizeof(__pyx_k_log_sum_scores), 0, 1, 1}, /* PyObject cname: __pyx_n_u_log_sum_scores */
  {__pyx_k_logadd, sizeof(__pyx_k_logadd), 0, 1, 1}, /* PyObject cname: __pyx_n_u_logadd */
  {__pyx_k_logger, sizeof(__pyx_k_logger), 0, 1, 1}, /* PyObject cname: __pyx_n_u_logger */
  {__pyx_k_logging, sizeof(__pyx_k_logging), 0, 1, 1}, /* PyObject cname: __pyx_n_u_logging */
  {__pyx_k_logical_and, sizeof(__pyx_k_logical_and), 0, 1, 1}, /* PyObject cname: __pyx_n_u_logical_and */
  {__pyx_k_logical_not, sizeof(__pyx_k_logical_not), 0, 1, 1}, /* PyObject cname: __pyx_n_u_logical_not */
  {__pyx_k_logprob, sizeof(__pyx_k_logprob), 0, 1, 1}, /* PyObject cname: __pyx_n_u_logprob */
  {__pyx_k_logprobs, sizeof(__pyx_k_logprobs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_logprobs */
  {__pyx_k_logsumexp, sizeof(__pyx_k_logsumexp), 0, 1, 1}, /* PyObject cname: __pyx_n_u_logsumexp */
  {__pyx_k_main, sizeof(__pyx_k_main), 0, 1, 1}, /* PyObject cname: __pyx_n_u_main */
  {__pyx_k_max, sizeof(__pyx_k_max), 0, 1, 1}, /* PyObject cname: __pyx_n_u_max */
  {__pyx_k_max_incoming_inds, sizeof(__pyx_k_max_incoming_inds), 0, 1, 1}, /* PyObject cname: __pyx_n_u_max_incoming_inds */
  {__pyx_k_max_incoming_weights, sizeof(__pyx_k_max_incoming_weights), 0, 1, 1}, /* PyObject cname: __pyx_n_u_max_incoming_weights */
  {__pyx_k_max_indices, sizeof(__pyx_k_max_indices), 0, 1, 1}, /* PyObject cname: __pyx_n_u_max_indices */
  {__pyx_k_max_outgoing_inds, sizeof(__pyx_k_max_outgoing_inds), 0, 1, 1}, /* PyObject cname: __pyx_n_u_max_outgoing_inds */
  {__pyx_k_max_outgoing_weights, sizeof(__pyx_k_max_outgoing_weights), 0, 1, 1}, /* PyObject cname: __pyx_n_u_max_outgoing_weights */
  {__pyx_k_mode, sizeof(__pyx_k_mode), 0, 1, 1}, /* PyObject cname: __pyx_n_u_mode */
  {__pyx_k_module, sizeof(__pyx_k_module), 0, 1, 1}, /* PyObject cname: __pyx_n_u_module */
  {__pyx_k_name, sizeof(__pyx_k_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_name */
  {__pyx_k_net, sizeof(__pyx_k_net), 0, 1, 1}, /* PyObject cname: __pyx_n_u_net */
  {__pyx_k_net_scores, sizeof(__pyx_k_net_scores), 0, 1, 1}, /* PyObject cname: __pyx_n_u_net_scores */
  {__pyx_k_net_tag, sizeof(__pyx_k_net_tag), 0, 1, 1}, /* PyObject cname: __pyx_n_u_net_tag */
  {__pyx_k_network_filename, sizeof(__pyx_k_network_filename), 0, 1, 1}, /* PyObject cname: __pyx_n_u_network_filename */
  {__pyx_k_neuron_maxes, sizeof(__pyx_k_neuron_maxes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_neuron_maxes */
  {__pyx_k_new, sizeof(__pyx_k_new), 0, 1, 1}, /* PyObject cname: __pyx_n_u_new */
  {__pyx_k_new_data, sizeof(__pyx_k_new_data), 0, 1, 1}, /* PyObject cname: __pyx_n_u_new_data */
  {__pyx_k_new_head, sizeof(__pyx_k_new_head), 0, 1, 1}, /* PyObject cname: __pyx_n_u_new_head */
  {__pyx_k_new_head_ind, sizeof(__pyx_k_new_head_ind), 0, 1, 1}, /* PyObject cname: __pyx_n_u_new_head_ind */
  {__pyx_k_new_shape, sizeof(__pyx_k_new_shape), 0, 1, 1}, /* PyObject cname: __pyx_n_u_new_shape */
  {__pyx_k_next, sizeof(__pyx_k_next), 0, 1, 1}, /* PyObject cname: __pyx_n_u_next */
  {__pyx_k_next_vertex, sizeof(__pyx_k_next_vertex), 0, 1, 1}, /* PyObject cname: __pyx_n_u_next_vertex */
  {__pyx_k_nltkor_tag_libs_network, sizeof(__pyx_k_nltkor_tag_libs_network), 0, 1, 1}, /* PyObject cname: __pyx_n_u_nltkor_tag_libs_network */
  {__pyx_k_nltkor_tag_libs_network_pyx, sizeof(__pyx_k_nltkor_tag_libs_network_pyx), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_nltkor_tag_libs_network_pyx */
  {__pyx_k_nltkor_tag_libs_networkconv_pyx, sizeof(__pyx_k_nltkor_tag_libs_networkconv_pyx), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_nltkor_tag_libs_networkconv_pyx */
  {__pyx_k_nltkor_tag_libs_networkdependenc, sizeof(__pyx_k_nltkor_tag_libs_networkdependenc), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_nltkor_tag_libs_networkdependenc */
  {__pyx_k_nn, sizeof(__pyx_k_nn), 0, 1, 1}, /* PyObject cname: __pyx_n_u_nn */
  {__pyx_k_np, sizeof(__pyx_k_np), 0, 1, 1}, /* PyObject cname: __pyx_n_u_np */
  {__pyx_k_num, sizeof(__pyx_k_num), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num */
  {__pyx_k_num_dims, sizeof(__pyx_k_num_dims), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_dims */
  {__pyx_k_num_dist_features, sizeof(__pyx_k_num_dist_features), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_dist_features */
  {__pyx_k_num_distances, sizeof(__pyx_k_num_distances), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_distances */
  {__pyx_k_num_items, sizeof(__pyx_k_num_items), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_items */
  {__pyx_k_num_sentences, sizeof(__pyx_k_num_sentences), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_sentences */
  {__pyx_k_num_targets, sizeof(__pyx_k_num_targets), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_targets */
  {__pyx_k_num_tokens, sizeof(__pyx_k_num_tokens), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_tokens */
  {__pyx_k_num_vertices, sizeof(__pyx_k_num_vertices), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_vertices */
  {__pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_numpy */
  {__pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_numpy_core_multiarray_failed_to */
  {__pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_numpy_core_umath_failed_to_impor */
  {__pyx_k_old_head, sizeof(__pyx_k_old_head), 0, 1, 1}, /* PyObject cname: __pyx_n_u_old_head */
  {__pyx_k_only_classify, sizeof(__pyx_k_only_classify), 0, 1, 1}, /* PyObject cname: __pyx_n_u_only_classify */
  {__pyx_k_other_args, sizeof(__pyx_k_other_args), 0, 1, 1}, /* PyObject cname: __pyx_n_u_other_args */
  {__pyx_k_outgoing_weights, sizeof(__pyx_k_outgoing_weights), 0, 1, 1}, /* PyObject cname: __pyx_n_u_outgoing_weights */
  {__pyx_k_output, sizeof(__pyx_k_output), 0, 1, 1}, /* PyObject cname: __pyx_n_u_output */
  {__pyx_k_output_bias, sizeof(__pyx_k_output_bias), 0, 1, 1}, /* PyObject cname: __pyx_n_u_output_bias */
  {__pyx_k_output_bias_deltas, sizeof(__pyx_k_output_bias_deltas), 0, 1, 1}, /* PyObject cname: __pyx_n_u_output_bias_deltas */
  {__pyx_k_output_deltas, sizeof(__pyx_k_output_deltas), 0, 1, 1}, /* PyObject cname: __pyx_n_u_output_deltas */
  {__pyx_k_output_dim, sizeof(__pyx_k_output_dim), 0, 1, 1}, /* PyObject cname: __pyx_n_u_output_dim */
  {__pyx_k_output_range, sizeof(__pyx_k_output_range), 0, 1, 1}, /* PyObject cname: __pyx_n_u_output_range */
  {__pyx_k_output_size, sizeof(__pyx_k_output_size), 0, 1, 1}, /* PyObject cname: __pyx_n_u_output_size */
  {__pyx_k_output_weights, sizeof(__pyx_k_output_weights), 0, 1, 1}, /* PyObject cname: __pyx_n_u_output_weights */
  {__pyx_k_outside, sizeof(__pyx_k_outside), 0, 1, 1}, /* PyObject cname: __pyx_n_u_outside */
  {__pyx_k_outside_inds, sizeof(__pyx_k_outside_inds), 0, 1, 1}, /* PyObject cname: __pyx_n_u_outside_inds */
  {__pyx_k_padded_sentence, sizeof(__pyx_k_padded_sentence), 0, 1, 1}, /* PyObject cname: __pyx_n_u_padded_sentence */
  {__pyx_k_padding_left, sizeof(__pyx_k_padding_left), 0, 1, 1}, /* PyObject cname: __pyx_n_u_padding_left */
  {__pyx_k_padding_right, sizeof(__pyx_k_padding_right), 0, 1, 1}, /* PyObject cname: __pyx_n_u_padding_right */
  {__pyx_k_path_backtrack, sizeof(__pyx_k_path_backtrack), 0, 1, 1}, /* PyObject cname: __pyx_n_u_path_backtrack */
  {__pyx_k_path_scores, sizeof(__pyx_k_path_scores), 0, 1, 1}, /* PyObject cname: __pyx_n_u_path_scores */
  {__pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pickle */
  {__pyx_k_pop, sizeof(__pyx_k_pop), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pop */
  {__pyx_k_pos_deltas, sizeof(__pyx_k_pos_deltas), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pos_deltas */
  {__pyx_k_pos_dist, sizeof(__pyx_k_pos_dist), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pos_dist */
  {__pyx_k_pos_padding, sizeof(__pyx_k_pos_padding), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pos_padding */
  {__pyx_k_positions, sizeof(__pyx_k_positions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_positions */
  {__pyx_k_pre_deltas, sizeof(__pyx_k_pre_deltas), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pre_deltas */
  {__pyx_k_pre_dist, sizeof(__pyx_k_pre_dist), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pre_dist */
  {__pyx_k_pre_padding, sizeof(__pyx_k_pre_padding), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pre_padding */
  {__pyx_k_pre_tagging_setup, sizeof(__pyx_k_pre_tagging_setup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pre_tagging_setup */
  {__pyx_k_pred_answer, sizeof(__pyx_k_pred_answer), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pred_answer */
  {__pyx_k_pred_arguments, sizeof(__pyx_k_pred_arguments), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pred_arguments */
  {__pyx_k_pred_convolution_lookup, sizeof(__pyx_k_pred_convolution_lookup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pred_convolution_lookup */
  {__pyx_k_pred_dist_deltas, sizeof(__pyx_k_pred_dist_deltas), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pred_dist_deltas */
  {__pyx_k_pred_dist_gradients, sizeof(__pyx_k_pred_dist_gradients), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pred_dist_gradients */
  {__pyx_k_pred_dist_indices, sizeof(__pyx_k_pred_dist_indices), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pred_dist_indices */
  {__pyx_k_pred_dist_lookup, sizeof(__pyx_k_pred_dist_lookup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pred_dist_lookup */
  {__pyx_k_pred_dist_offset, sizeof(__pyx_k_pred_dist_offset), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pred_dist_offset */
  {__pyx_k_pred_dist_table, sizeof(__pyx_k_pred_dist_table), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pred_dist_table */
  {__pyx_k_pred_dist_values, sizeof(__pyx_k_pred_dist_values), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pred_dist_values */
  {__pyx_k_pred_dist_weights, sizeof(__pyx_k_pred_dist_weights), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pred_dist_weights */
  {__pyx_k_pred_dists, sizeof(__pyx_k_pred_dists), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pred_dists */
  {__pyx_k_pred_tags, sizeof(__pyx_k_pred_tags), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pred_tags */
  {__pyx_k_predicate, sizeof(__pyx_k_predicate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_predicate */
  {__pyx_k_predicate_answer, sizeof(__pyx_k_predicate_answer), 0, 1, 1}, /* PyObject cname: __pyx_n_u_predicate_answer */
  {__pyx_k_predicate_tags, sizeof(__pyx_k_predicate_tags), 0, 1, 1}, /* PyObject cname: __pyx_n_u_predicate_tags */
  {__pyx_k_predicates, sizeof(__pyx_k_predicates), 0, 1, 1}, /* PyObject cname: __pyx_n_u_predicates */
  {__pyx_k_prev_score_and_trans, sizeof(__pyx_k_prev_score_and_trans), 0, 1, 1}, /* PyObject cname: __pyx_n_u_prev_score_and_trans */
  {__pyx_k_previous_tag, sizeof(__pyx_k_previous_tag), 0, 1, 1}, /* PyObject cname: __pyx_n_u_previous_tag */
  {__pyx_k_print_epoch_report, sizeof(__pyx_k_print_epoch_report), 0, 1, 1}, /* PyObject cname: __pyx_n_u_print_epoch_report */
  {__pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyx_PickleError */
  {__pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyx_checksum */
  {__pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyx_result */
  {__pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyx_state */
  {__pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyx_type */
  {__pyx_k_pyx_unpickle_ConvolutionalDepe, sizeof(__pyx_k_pyx_unpickle_ConvolutionalDepe), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyx_unpickle_ConvolutionalDepe */
  {__pyx_k_pyx_unpickle_ConvolutionalDepe_2, sizeof(__pyx_k_pyx_unpickle_ConvolutionalDepe_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyx_unpickle_ConvolutionalDepe_2 */
  {__pyx_k_pyx_unpickle_ConvolutionalNetw, sizeof(__pyx_k_pyx_unpickle_ConvolutionalNetw), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyx_unpickle_ConvolutionalNetw */
  {__pyx_k_pyx_unpickle_ConvolutionalNetw_2, sizeof(__pyx_k_pyx_unpickle_ConvolutionalNetw_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyx_unpickle_ConvolutionalNetw_2 */
  {__pyx_k_pyx_unpickle_Network, sizeof(__pyx_k_pyx_unpickle_Network), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyx_unpickle_Network */
  {__pyx_k_pyx_unpickle_Network__set_stat, sizeof(__pyx_k_pyx_unpickle_Network__set_stat), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyx_unpickle_Network__set_stat */
  {__pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyx_vtable */
  {__pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 1, 1}, /* PyObject cname: __pyx_n_u_qualname */
  {__pyx_k_random, sizeof(__pyx_k_random), 0, 1, 1}, /* PyObject cname: __pyx_n_u_random */
  {__pyx_k_random_state, sizeof(__pyx_k_random_state), 0, 1, 1}, /* PyObject cname: __pyx_n_u_random_state */
  {__pyx_k_range, sizeof(__pyx_k_range), 0, 1, 1}, /* PyObject cname: __pyx_n_u_range */
  {__pyx_k_ravel, sizeof(__pyx_k_ravel), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ravel */
  {__pyx_k_reachable, sizeof(__pyx_k_reachable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reachable */
  {__pyx_k_reachable_vertices, sizeof(__pyx_k_reachable_vertices), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reachable_vertices */
  {__pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reduce */
  {__pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reduce_cython */
  {__pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reduce_ex */
  {__pyx_k_reset_counters, sizeof(__pyx_k_reset_counters), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reset_counters */
  {__pyx_k_reshape, sizeof(__pyx_k_reshape), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reshape */
  {__pyx_k_rollaxis, sizeof(__pyx_k_rollaxis), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rollaxis */
  {__pyx_k_root, sizeof(__pyx_k_root), 0, 1, 1}, /* PyObject cname: __pyx_n_u_root */
  {__pyx_k_save, sizeof(__pyx_k_save), 0, 1, 1}, /* PyObject cname: __pyx_n_u_save */
  {__pyx_k_savez, sizeof(__pyx_k_savez), 0, 1, 1}, /* PyObject cname: __pyx_n_u_savez */
  {__pyx_k_scores, sizeof(__pyx_k_scores), 0, 1, 1}, /* PyObject cname: __pyx_n_u_scores */
  {__pyx_k_self, sizeof(__pyx_k_self), 0, 1, 1}, /* PyObject cname: __pyx_n_u_self */
  {__pyx_k_send, sizeof(__pyx_k_send), 0, 1, 1}, /* PyObject cname: __pyx_n_u_send */
  {__pyx_k_sent, sizeof(__pyx_k_sent), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sent */
  {__pyx_k_sent_args, sizeof(__pyx_k_sent_args), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sent_args */
  {__pyx_k_sent_preds, sizeof(__pyx_k_sent_preds), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sent_preds */
  {__pyx_k_sent_tags, sizeof(__pyx_k_sent_tags), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sent_tags */
  {__pyx_k_sentence, sizeof(__pyx_k_sentence), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sentence */
  {__pyx_k_sentence_convolution, sizeof(__pyx_k_sentence_convolution), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sentence_convolution */
  {__pyx_k_sentence_hit, sizeof(__pyx_k_sentence_hit), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sentence_hit */
  {__pyx_k_sentence_hits, sizeof(__pyx_k_sentence_hits), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sentence_hits */
  {__pyx_k_sentences, sizeof(__pyx_k_sentences), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sentences */
  {__pyx_k_set, sizeof(__pyx_k_set), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set */
  {__pyx_k_set_learning_rate_decay, sizeof(__pyx_k_set_learning_rate_decay), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_learning_rate_decay */
  {__pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_name */
  {__pyx_k_set_state, sizeof(__pyx_k_set_state), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_state */
  {__pyx_k_set_validation_data, sizeof(__pyx_k_set_validation_data), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_validation_data */
  {__pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_setstate */
  {__pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_setstate_cython */
  {__pyx_k_shape, sizeof(__pyx_k_shape), 0, 1, 1}, /* PyObject cname: __pyx_n_u_shape */
  {__pyx_k_shift, sizeof(__pyx_k_shift), 0, 1, 1}, /* PyObject cname: __pyx_n_u_shift */
  {__pyx_k_shuffle, sizeof(__pyx_k_shuffle), 0, 1, 1}, /* PyObject cname: __pyx_n_u_shuffle */
  {__pyx_k_shuffle_data, sizeof(__pyx_k_shuffle_data), 0, 1, 1}, /* PyObject cname: __pyx_n_u_shuffle_data */
  {__pyx_k_spec, sizeof(__pyx_k_spec), 0, 1, 1}, /* PyObject cname: __pyx_n_u_spec */
  {__pyx_k_sqrt, sizeof(__pyx_k_sqrt), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sqrt */
  {__pyx_k_start, sizeof(__pyx_k_start), 0, 1, 1}, /* PyObject cname: __pyx_n_u_start */
  {__pyx_k_start_from, sizeof(__pyx_k_start_from), 0, 1, 1}, /* PyObject cname: __pyx_n_u_start_from */
  {__pyx_k_state, sizeof(__pyx_k_state), 0, 1, 1}, /* PyObject cname: __pyx_n_u_state */
  {__pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_stringsource */
  {__pyx_k_sum, sizeof(__pyx_k_sum), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sum */
  {__pyx_k_sumlogadd, sizeof(__pyx_k_sumlogadd), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sumlogadd */
  {__pyx_k_super, sizeof(__pyx_k_super), 0, 1, 1}, /* PyObject cname: __pyx_n_u_super */
  {__pyx_k_t, sizeof(__pyx_k_t), 0, 1, 1}, /* PyObject cname: __pyx_n_u_t */
  {__pyx_k_table, sizeof(__pyx_k_table), 0, 1, 1}, /* PyObject cname: __pyx_n_u_table */
  {__pyx_k_table_deltas, sizeof(__pyx_k_table_deltas), 0, 1, 1}, /* PyObject cname: __pyx_n_u_table_deltas */
  {__pyx_k_table_dims, sizeof(__pyx_k_table_dims), 0, 1, 1}, /* PyObject cname: __pyx_n_u_table_dims */
  {__pyx_k_tag, sizeof(__pyx_k_tag), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tag */
  {__pyx_k_tag_scores, sizeof(__pyx_k_tag_scores), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tag_scores */
  {__pyx_k_tag_sentence, sizeof(__pyx_k_tag_sentence), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tag_sentence */
  {__pyx_k_tag_sentence_2, sizeof(__pyx_k_tag_sentence_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tag_sentence_2 */
  {__pyx_k_tag_sentence_labeled_dependency, sizeof(__pyx_k_tag_sentence_labeled_dependency), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tag_sentence_labeled_dependency */
  {__pyx_k_tag_sentence_unlabeled_dependen, sizeof(__pyx_k_tag_sentence_unlabeled_dependen), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tag_sentence_unlabeled_dependen */
  {__pyx_k_tags, sizeof(__pyx_k_tags), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tags */
  {__pyx_k_take, sizeof(__pyx_k_take), 0, 1, 1}, /* PyObject cname: __pyx_n_u_take */
  {__pyx_k_target, sizeof(__pyx_k_target), 0, 1, 1}, /* PyObject cname: __pyx_n_u_target */
  {__pyx_k_target_convolution_lookup, sizeof(__pyx_k_target_convolution_lookup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_target_convolution_lookup */
  {__pyx_k_target_dist_deltas, sizeof(__pyx_k_target_dist_deltas), 0, 1, 1}, /* PyObject cname: __pyx_n_u_target_dist_deltas */
  {__pyx_k_target_dist_gradients, sizeof(__pyx_k_target_dist_gradients), 0, 1, 1}, /* PyObject cname: __pyx_n_u_target_dist_gradients */
  {__pyx_k_target_dist_indices, sizeof(__pyx_k_target_dist_indices), 0, 1, 1}, /* PyObject cname: __pyx_n_u_target_dist_indices */
  {__pyx_k_target_dist_lookup, sizeof(__pyx_k_target_dist_lookup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_target_dist_lookup */
  {__pyx_k_target_dist_offset, sizeof(__pyx_k_target_dist_offset), 0, 1, 1}, /* PyObject cname: __pyx_n_u_target_dist_offset */
  {__pyx_k_target_dist_table, sizeof(__pyx_k_target_dist_table), 0, 1, 1}, /* PyObject cname: __pyx_n_u_target_dist_table */
  {__pyx_k_target_dist_values, sizeof(__pyx_k_target_dist_values), 0, 1, 1}, /* PyObject cname: __pyx_n_u_target_dist_values */
  {__pyx_k_target_dist_weights, sizeof(__pyx_k_target_dist_weights), 0, 1, 1}, /* PyObject cname: __pyx_n_u_target_dist_weights */
  {__pyx_k_target_dists, sizeof(__pyx_k_target_dists), 0, 1, 1}, /* PyObject cname: __pyx_n_u_target_dists */
  {__pyx_k_test, sizeof(__pyx_k_test), 0, 1, 1}, /* PyObject cname: __pyx_n_u_test */
  {__pyx_k_throw, sizeof(__pyx_k_throw), 0, 1, 1}, /* PyObject cname: __pyx_n_u_throw */
  {__pyx_k_tile, sizeof(__pyx_k_tile), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tile */
  {__pyx_k_token, sizeof(__pyx_k_token), 0, 1, 1}, /* PyObject cname: __pyx_n_u_token */
  {__pyx_k_token_indices, sizeof(__pyx_k_token_indices), 0, 1, 1}, /* PyObject cname: __pyx_n_u_token_indices */
  {__pyx_k_token_scores, sizeof(__pyx_k_token_scores), 0, 1, 1}, /* PyObject cname: __pyx_n_u_token_scores */
  {__pyx_k_top_accuracy, sizeof(__pyx_k_top_accuracy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_top_accuracy */
  {__pyx_k_train, sizeof(__pyx_k_train), 0, 1, 1}, /* PyObject cname: __pyx_n_u_train */
  {__pyx_k_train_epoch, sizeof(__pyx_k_train_epoch), 0, 1, 1}, /* PyObject cname: __pyx_n_u_train_epoch */
  {__pyx_k_train_locals_genexpr, sizeof(__pyx_k_train_locals_genexpr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_train_locals_genexpr */
  {__pyx_k_training, sizeof(__pyx_k_training), 0, 1, 1}, /* PyObject cname: __pyx_n_u_training */
  {__pyx_k_trans, sizeof(__pyx_k_trans), 0, 1, 1}, /* PyObject cname: __pyx_n_u_trans */
  {__pyx_k_transitions, sizeof(__pyx_k_transitions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_transitions */
  {__pyx_k_transitions_t, sizeof(__pyx_k_transitions_t), 0, 1, 1}, /* PyObject cname: __pyx_n_u_transitions_t */
  {__pyx_k_uniform, sizeof(__pyx_k_uniform), 0, 1, 1}, /* PyObject cname: __pyx_n_u_uniform */
  {__pyx_k_unreachable, sizeof(__pyx_k_unreachable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_unreachable */
  {__pyx_k_update, sizeof(__pyx_k_update), 0, 1, 1}, /* PyObject cname: __pyx_n_u_update */
  {__pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_use_setstate */
  {__pyx_k_validate, sizeof(__pyx_k_validate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_validate */
  {__pyx_k_validate_locals_genexpr, sizeof(__pyx_k_validate_locals_genexpr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_validate_locals_genexpr */
  {__pyx_k_validation_arguments, sizeof(__pyx_k_validation_arguments), 0, 1, 1}, /* PyObject cname: __pyx_n_u_validation_arguments */
  {__pyx_k_validation_predicates, sizeof(__pyx_k_validation_predicates), 0, 1, 1}, /* PyObject cname: __pyx_n_u_validation_predicates */
  {__pyx_k_validation_sentences, sizeof(__pyx_k_validation_sentences), 0, 1, 1}, /* PyObject cname: __pyx_n_u_validation_sentences */
  {__pyx_k_validation_tags, sizeof(__pyx_k_validation_tags), 0, 1, 1}, /* PyObject cname: __pyx_n_u_validation_tags */
  {__pyx_k_value, sizeof(__pyx_k_value), 0, 1, 1}, /* PyObject cname: __pyx_n_u_value */
  {__pyx_k_vertex, sizeof(__pyx_k_vertex), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vertex */
  {__pyx_k_vertex_leaving_cycle, sizeof(__pyx_k_vertex_leaving_cycle), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vertex_leaving_cycle */
  {__pyx_k_vertex_leaving_cycle_ind, sizeof(__pyx_k_vertex_leaving_cycle_ind), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vertex_leaving_cycle_ind */
  {__pyx_k_vertices_in_cycles, sizeof(__pyx_k_vertices_in_cycles), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vertices_in_cycles */
  {__pyx_k_visited, sizeof(__pyx_k_visited), 0, 1, 1}, /* PyObject cname: __pyx_n_u_visited */
  {__pyx_k_viterbi, sizeof(__pyx_k_viterbi), 0, 1, 1}, /* PyObject cname: __pyx_n_u_viterbi */
  {__pyx_k_vstack, sizeof(__pyx_k_vstack), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vstack */
  {__pyx_k_w_deltas, sizeof(__pyx_k_w_deltas), 0, 1, 1}, /* PyObject cname: __pyx_n_u_w_deltas */
  {__pyx_k_weights, sizeof(__pyx_k_weights), 0, 1, 1}, /* PyObject cname: __pyx_n_u_weights */
  {__pyx_k_where, sizeof(__pyx_k_where), 0, 1, 1}, /* PyObject cname: __pyx_n_u_where */
  {__pyx_k_window, sizeof(__pyx_k_window), 0, 1, 1}, /* PyObject cname: __pyx_n_u_window */
  {__pyx_k_window_from, sizeof(__pyx_k_window_from), 0, 1, 1}, /* PyObject cname: __pyx_n_u_window_from */
  {__pyx_k_window_to, sizeof(__pyx_k_window_to), 0, 1, 1}, /* PyObject cname: __pyx_n_u_window_to */
  {__pyx_k_word_window, sizeof(__pyx_k_word_window), 0, 1, 1}, /* PyObject cname: __pyx_n_u_word_window */
  {__pyx_k_word_window_size, sizeof(__pyx_k_word_window_size), 0, 1, 1}, /* PyObject cname: __pyx_n_u_word_window_size */
  {__pyx_k_x, sizeof(__pyx_k_x), 0, 1, 1}, /* PyObject cname: __pyx_n_u_x */
  {__pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 1, 1}, /* PyObject cname: __pyx_n_u_zeros */
  {__pyx_k_zeros_like, sizeof(__pyx_k_zeros_like), 0, 1, 1}, /* PyObject cname: __pyx_n_u_zeros_like */
  {__pyx_k_zip, sizeof(__pyx_k_zip), 0, 1, 1}, /* PyObject cname: __pyx_n_u_zip */
  {0, 0, 0, 0, 0}
};
/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names);

/* #### Code section: cached_builtins ### */

static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 133, __pyx_L1_error)
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 233, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_range); if (!__pyx_builtin_range) __PYX_ERR(0, 303, __pyx_L1_error)
  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_range); if (!__pyx_builtin_xrange) __PYX_ERR(0, 345, __pyx_L1_error)
  __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 370, __pyx_L1_error)
  __pyx_builtin_FloatingPointError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_FloatingPointError); if (!__pyx_builtin_FloatingPointError) __PYX_ERR(0, 689, __pyx_L1_error)
  __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_super); if (!__pyx_builtin_super) __PYX_ERR(1, 126, __pyx_L1_error)
  __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(1, 564, __pyx_L1_error)
  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 984, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cached_constants ### */

static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "nltkor/tag/libs/network.pyx":237
 *             ind_to = ind_from + num_dims
 * 
 *             token_indices = padded_sentence[:, i]             # <<<<<<<<<<<<<<
 *             embeddings = table.take(token_indices, axis=0)
 *             self.sentence_lookup[:, ind_from:ind_to] = embeddings
*/
  __pyx_mstate_global->__pyx_slice[0] = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(0, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);

  /* "nltkor/tag/libs/network.pyx":343
 *         # delta_t(k) = ftheta_k,t + logadd_i(delta_t-1(i) + A_i,k)
 *         #            = ftheta_k,t + log(Sum_i(exp(delta_t-1(i) + A_i,k)))
 *         transitions = self.transitions[:-1].T # A_k,i             # <<<<<<<<<<<<<<
 * 
 *         for token in xrange(1, len(delta)):
*/
  __pyx_mstate_global->__pyx_slice[1] = PySlice_New(Py_None, __pyx_mstate_global->__pyx_int_neg_1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[1])) __PYX_ERR(0, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[1]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[1]);

  /* "nltkor/tag/libs/network.pyx":370
 *         correct_path_score = 0
 *         last_tag = self.output_size
 *         for tag, net_scores in zip(tags[:-2], scores[:-2]):             # <<<<<<<<<<<<<<
 *             #print(tags, last_tag, tag, self.transitions)
 *             trans = 0 if self.transitions is None else self.transitions[last_tag, tag]
*/
  __pyx_mstate_global->__pyx_slice[2] = PySlice_New(Py_None, __pyx_mstate_global->__pyx_int_neg_2, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[2])) __PYX_ERR(0, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[2]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[2]);

  /* "nltkor/tag/libs/network.pyx":450
 *             grad_times_softmax = self.net_gradients[t + 1] * delta_softmax
 *             # dC / dA_i,j
 *             self.trans_gradients[:-1, :] += grad_times_softmax             # <<<<<<<<<<<<<<
 * 
 *             # sum all transition gradients by row to find the network gradients
*/
  __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_slice[1], __pyx_mstate_global->__pyx_slice[0]); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]);

  /* "nltkor/tag/libs/networkconv.pyx":830
 *             pre_deltas = dist_deltas.take(np.arange(pre_dist), 0).sum(0)
 *             pos_deltas = dist_deltas.take(np.arange(-pos_dist, 0), 0).sum(0)
 *             self.target_dist_table[1:-1, :] += dist_deltas[pre_dist : -pos_dist]             # <<<<<<<<<<<<<<
 *             self.target_dist_table[0] += pre_deltas
 *             self.target_dist_table[-1] += pos_deltas
*/
  __pyx_mstate_global->__pyx_slice[3] = PySlice_New(__pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_neg_1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[3])) __PYX_ERR(1, 830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[3]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[3]);
  __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_slice[3], __pyx_mstate_global->__pyx_slice[0]); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(1, 830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);

  /* "nltkor/tag/libs/networkconv.pyx":899
 *         path_scores[0] = scores[0] + self.transitions[-1]
 * 
 *         for i, token in enumerate(scores[1:], 1):             # <<<<<<<<<<<<<<
 * 
 *             # each line contains the score until each tag t plus the transition to each other tag t'
*/
  __pyx_mstate_global->__pyx_slice[4] = PySlice_New(__pyx_mstate_global->__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[4])) __PYX_ERR(1, 899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[4]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[4]);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x72479d4, 0xd248f0d, 0xc0e08fa):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x72479d4, 0xd248f0d, 0xc0e08fa) = (accuracy, answer_score, decay_factor, error, feature_tables, features_per_token, float_errors, hidden_bias, hidden_sent_values, hidden_size, hidden_values, hidden_weights, input_sent_values, input_size, input_values, layer2_sent_values, layer2_values, learning_rate, learning_rate_features, learning_rate_trans, net_gradients, network_filename, network_text_filename, num_tokens, output_bias, output_size, output_weights, padding_left, padding_right, pos_padding, pre_padding, sentence_accuracy, sentence_lookup, skips, trans_gradients, transitions, use_learning_rate_decay, validation_sentences, validation_tags, word_window_size))" % __pyx_checksum
*/
  __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_119830996, __pyx_mstate_global->__pyx_int_220499725, __pyx_mstate_global->__pyx_int_202246394); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]);
  __pyx_mstate_global->__pyx_tuple[3] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_49696698, __pyx_mstate_global->__pyx_int_148123145, __pyx_mstate_global->__pyx_int_149446146); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]);
  __pyx_mstate_global->__pyx_tuple[4] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_212151326, __pyx_mstate_global->__pyx_int_145891266, __pyx_mstate_global->__pyx_int_27816595); if (unlikely(!__pyx_mstate_global->__pyx_tuple[4])) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]);

  /* "nltkor/tag/libs/network.pyx":278
 *         return self._viterbi(scores)
 * 
 *     def _tag_sentence(self, np.ndarray sentence, tags=None):             # <<<<<<<<<<<<<<
 *         """
 *         Runs the network for each element in the sentence and returns
*/
  __pyx_mstate_global->__pyx_tuple[5] = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[5])) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[5]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[5]);

  /* "nltkor/tag/libs/network.pyx":555
 *         return answer
 * 
 *     def set_validation_data(self, list validation_sentences=None,             # <<<<<<<<<<<<<<
 *                             list validation_tags=None):
 *         """
*/
  __pyx_mstate_global->__pyx_tuple[6] = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[6])) __PYX_ERR(0, 555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[6]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[6]);

  /* "nltkor/tag/libs/network.pyx":567
 *         self.validation_tags = validation_tags
 * 
 *     def set_learning_rate_decay(self, float decay_factor=1.0):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the network to use learning rate decay.
*/
  __pyx_mstate_global->__pyx_tuple[7] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_float_1_0); if (unlikely(!__pyx_mstate_global->__pyx_tuple[7])) __PYX_ERR(0, 567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[7]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[7]);

  /* "nltkor/tag/libs/network.pyx":595
 *             self.learning_rate_trans *= factor
 * 
 *     def train(self, list sentences, list tags,             # <<<<<<<<<<<<<<
 *               int epochs, int epochs_between_reports=0,
 *               float desired_accuracy=0):
*/
  __pyx_mstate_global->__pyx_tuple[8] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_float_0_0); if (unlikely(!__pyx_mstate_global->__pyx_tuple[8])) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[8]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[8]);

  /* "nltkor/tag/libs/networkconv.pyx":275
 *         self.validation_arguments = validation_arguments
 * 
 *     def train(self, list sentences, list predicates, list tags,             # <<<<<<<<<<<<<<
 *               int epochs, int epochs_between_reports=0,
 *               float desired_accuracy=0, list arguments=None):
*/
  __pyx_mstate_global->__pyx_tuple[9] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_float_0_0, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[9])) __PYX_ERR(1, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[9]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[9]);

  /* "nltkor/tag/libs/networkconv.pyx":381
 *                 self.float_errors += 1
 * 
 *     def tag_sentence(self, np.ndarray sentence, np.ndarray predicates,             # <<<<<<<<<<<<<<
 *                      list arguments=None, bool logprob=False,
 *                      bool allow_repeats=True):
*/
  __pyx_mstate_global->__pyx_tuple[10] = PyTuple_Pack(3, Py_None, Py_False, Py_True); if (unlikely(!__pyx_mstate_global->__pyx_tuple[10])) __PYX_ERR(1, 381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[10]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[10]);

  /* "nltkor/tag/libs/networkconv.pyx":421
 * 
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _sentence_convolution(self, sentence, predicate, argument_blocks=None,
*/
  __pyx_mstate_global->__pyx_tuple[11] = PyTuple_Pack(2, Py_None, Py_False); if (unlikely(!__pyx_mstate_global->__pyx_tuple[11])) __PYX_ERR(1, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[11]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[11]);

  /* "nltkor/tag/libs/networkconv.pyx":525
 * 
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     @cython.wraparound(False)
 *     def _tag_sentence(self, np.ndarray sentence, np.ndarray predicates,
*/
  __pyx_mstate_global->__pyx_tuple[12] = PyTuple_Pack(4, Py_None, Py_None, Py_True, Py_False); if (unlikely(!__pyx_mstate_global->__pyx_tuple[12])) __PYX_ERR(1, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[12]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[12]);

  /* "nltkor/tag/libs/networkconv.pyx":849
 *         self._create_pred_lookup()
 * 
 *     @cython.boundscheck(False)             # <<<<<<<<<<<<<<
 *     def _viterbi(self, np.ndarray[FLOAT_t, ndim=2] scores, bool allow_repeats=True):
 *         """
*/
  __pyx_mstate_global->__pyx_tuple[13] = PyTuple_Pack(1, Py_True); if (unlikely(!__pyx_mstate_global->__pyx_tuple[13])) __PYX_ERR(1, 849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[13]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[13]);

  /* "nltkor/tag/libs/networkdependencyconv.pyx":77
 *         self.validation_heads = heads
 * 
 *     def _tag_sentence(self, sentence, predicates=None, heads=None, labels=None):             # <<<<<<<<<<<<<<
 *         """
 *         This function is just an interface to the _tag_sentence signature
*/
  __pyx_mstate_global->__pyx_tuple[14] = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[14])) __PYX_ERR(5, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[14]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[14]);
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}
/* #### Code section: init_constants ### */

static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop;
  __pyx_mstate->__pyx_umethod_PySet_Type__update.type = (PyObject*)(&PySet_Type);
  __pyx_mstate->__pyx_umethod_PySet_Type__update.method_name = &__pyx_mstate->__pyx_n_u_update;
  if (__Pyx_InitStrings(__pyx_string_tab, __pyx_mstate->__pyx_string_tab, __pyx_string_tab_encodings) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_mstate->__pyx_float_0_0 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_mstate->__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_mstate->__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_float_0_01 = PyFloat_FromDouble(0.01); if (unlikely(!__pyx_mstate->__pyx_float_0_01)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_float_2_38 = PyFloat_FromDouble(2.38); if (unlikely(!__pyx_mstate->__pyx_float_2_38)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_float_neg_1_0 = PyFloat_FromDouble(-1.0); if (unlikely(!__pyx_mstate->__pyx_float_neg_1_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_0 = PyLong_FromLong(0); if (unlikely(!__pyx_mstate->__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_1 = PyLong_FromLong(1); if (unlikely(!__pyx_mstate->__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_2 = PyLong_FromLong(2); if (unlikely(!__pyx_mstate->__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_27816595 = PyLong_FromLong(27816595L); if (unlikely(!__pyx_mstate->__pyx_int_27816595)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_49696698 = PyLong_FromLong(49696698L); if (unlikely(!__pyx_mstate->__pyx_int_49696698)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_119830996 = PyLong_FromLong(119830996L); if (unlikely(!__pyx_mstate->__pyx_int_119830996)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_145891266 = PyLong_FromLong(145891266L); if (unlikely(!__pyx_mstate->__pyx_int_145891266)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_148123145 = PyLong_FromLong(148123145L); if (unlikely(!__pyx_mstate->__pyx_int_148123145)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_149446146 = PyLong_FromLong(149446146L); if (unlikely(!__pyx_mstate->__pyx_int_149446146)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_202246394 = PyLong_FromLong(202246394L); if (unlikely(!__pyx_mstate->__pyx_int_202246394)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_212151326 = PyLong_FromLong(212151326L); if (unlikely(!__pyx_mstate->__pyx_int_212151326)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_220499725 = PyLong_FromLong(220499725L); if (unlikely(!__pyx_mstate->__pyx_int_220499725)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_neg_1 = PyLong_FromLong(-1); if (unlikely(!__pyx_mstate->__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_neg_2 = PyLong_FromLong(-2); if (unlikely(!__pyx_mstate->__pyx_int_neg_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_neg_1000 = PyLong_FromLong(-1000); if (unlikely(!__pyx_mstate->__pyx_int_neg_1000)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: init_codeobjects ### */
\
        typedef struct {
            unsigned int argcount : 4;
            unsigned int num_posonly_args : 1;
            unsigned int num_kwonly_args : 1;
            unsigned int nlocals : 6;
            unsigned int flags : 10;
            unsigned int first_line : 10;
            unsigned int line_table_length : 15;
        } __Pyx_PyCode_New_function_description;
/* NewCodeObj.proto */
static PyObject* __Pyx_PyCode_New(
        const __Pyx_PyCode_New_function_description descr,
        PyObject * const *varnames,
        PyObject *filename,
        PyObject *funcname,
        const char *line_table,
        PyObject *tuple_dedup_map
);


static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
  PyObject* tuple_dedup_map = PyDict_New();
  if (unlikely(!tuple_dedup_map)) return -1;
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 28, 86};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_a, __pyx_mstate->__pyx_n_u_axis};
    __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_logsumexp, __pyx_k_uCq_AV1_Biq_1_AT_q_2T_D_4q_HE_R, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 53, 71};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_weights, __pyx_mstate->__pyx_n_u_inplace};
    __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_hardtanh, __pyx_k_q_a_b_Qa_82Q_Q_q_q_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 69, 48};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_weights};
    __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_hardtanhd, __pyx_k_Kq_2_s_83a_q_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 133, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_table};
    __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 126, 201};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_feature_tables, __pyx_mstate->__pyx_n_u_word_window, __pyx_mstate->__pyx_n_u_hidden_size, __pyx_mstate->__pyx_n_u_output_size, __pyx_mstate->__pyx_n_u_input_size, __pyx_mstate->__pyx_n_u_high, __pyx_mstate->__pyx_n_u_hidden_weights, __pyx_mstate->__pyx_n_u_hidden_bias, __pyx_mstate->__pyx_n_u_output_weights, __pyx_mstate->__pyx_n_u_output_bias, __pyx_mstate->__pyx_n_u_transitions, __pyx_mstate->__pyx_n_u_net, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr};
    __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_create_new, __pyx_k_A_c_Q_a_uBb_Qa_7_1F_a_b_xq_wa_uB, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {10, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 166, 127};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_word_window, __pyx_mstate->__pyx_n_u_input_size, __pyx_mstate->__pyx_n_u_hidden_size, __pyx_mstate->__pyx_n_u_output_size, __pyx_mstate->__pyx_n_u_hidden_weights, __pyx_mstate->__pyx_n_u_hidden_bias, __pyx_mstate->__pyx_n_u_output_weights, __pyx_mstate->__pyx_n_u_output_bias, __pyx_mstate->__pyx_n_u_transitions};
    __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_k_A_Q_a_N_O1_O1_Rq_O1_a_O1_a_O1_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 200, 75};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_table_dims, __pyx_mstate->__pyx_n_u_desc, __pyx_mstate->__pyx_n_u_t};
    __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_description, __pyx_k_A_Qc_6_d_t1_d_q_q_t_l_m4_TQR_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 217, 146};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sentence, __pyx_mstate->__pyx_n_u_padded_sentence, __pyx_mstate->__pyx_n_u_ind_from, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_table, __pyx_mstate->__pyx_n_u_num_dims, __pyx_mstate->__pyx_n_u_ind_to, __pyx_mstate->__pyx_n_u_token_indices, __pyx_mstate->__pyx_n_u_embeddings};
    __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_create_sentence_lookup, __pyx_k_A_L_a_a_r_r_A_t1_1_Cy_a_uF_1_Yb, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 248, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 251, 34};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_padding_left};
    __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_set, __pyx_k_r_r_s_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 260, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 263, 34};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_padding_right};
    __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_set, __pyx_k_r_r_s_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 267, 26};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sentence, __pyx_mstate->__pyx_n_u_scores};
    __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_tag_sentence_2, __pyx_k_A_1A_t9AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 278, 311};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sentence, __pyx_mstate->__pyx_n_u_tags, __pyx_mstate->__pyx_n_u_answer, __pyx_mstate->__pyx_n_u_input_data, __pyx_mstate->__pyx_n_u_scores, __pyx_mstate->__pyx_n_u_training, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_output};
    __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_tag_sentence, __pyx_k_6a_6_3a_a_5_q_1_RvRs_d_b_b_1Kt1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 323, 95};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_scores, __pyx_mstate->__pyx_n_u_delta, __pyx_mstate->__pyx_n_u_transitions, __pyx_mstate->__pyx_n_u_token, __pyx_mstate->__pyx_n_u_logadd};
    __pyx_mstate_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_calculate_delta, __pyx_k_A_QfD_Ba_d_c_1_IV1Cs_1_YauAV2S_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 18, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 352, 495};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tags, __pyx_mstate->__pyx_n_u_scores, __pyx_mstate->__pyx_n_u_delta, __pyx_mstate->__pyx_n_u_delta_softmax, __pyx_mstate->__pyx_n_u_correct_path_score, __pyx_mstate->__pyx_n_u_last_tag, __pyx_mstate->__pyx_n_u_tag, __pyx_mstate->__pyx_n_u_net_scores, __pyx_mstate->__pyx_n_u_trans, __pyx_mstate->__pyx_n_u_error, __pyx_mstate->__pyx_n_u_sumlogadd, __pyx_mstate->__pyx_n_u_transitions_t, __pyx_mstate->__pyx_n_u_t, __pyx_mstate->__pyx_n_u_path_scores, __pyx_mstate->__pyx_n_u_log_sum_scores, __pyx_mstate->__pyx_n_u_grad_times_softmax, __pyx_mstate->__pyx_n_u_token};
    __pyx_mstate_global->__pyx_codeobj_tab[15] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_calculate_gradients_sll, __pyx_k_A_Q_4q_E_s_4s_fCq_E_Zt_q_RS_AQ_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 471, 126};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tags, __pyx_mstate->__pyx_n_u_scores, __pyx_mstate->__pyx_n_u_exponentials, __pyx_mstate->__pyx_n_u_correct_path_score, __pyx_mstate->__pyx_n_u_token, __pyx_mstate->__pyx_n_u_tag, __pyx_mstate->__pyx_n_u_net_scores, __pyx_mstate->__pyx_n_u_error};
    __pyx_mstate_global->__pyx_codeobj_tab[16] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_calculate_gradients_wll, __pyx_k_A_r_Qa_R_3b_D_A_Q_E_s_6_avQha_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 507, 334};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_scores, __pyx_mstate->__pyx_n_u_path_scores, __pyx_mstate->__pyx_n_u_path_backtrack, __pyx_mstate->__pyx_n_u_output_range, __pyx_mstate->__pyx_n_u_transitions, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_prev_score_and_trans, __pyx_mstate->__pyx_n_u_answer, __pyx_mstate->__pyx_n_u_previous_tag};
    __pyx_mstate_global->__pyx_codeobj_tab[17] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_viterbi, __pyx_k_A_4_CuCs_83a_6_b_1A_axq_1E_q_2T, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[17])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 555, 26};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_validation_sentences, __pyx_mstate->__pyx_n_u_validation_tags};
    __pyx_mstate_global->__pyx_codeobj_tab[18] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_set_validation_data, __pyx_k_A12_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[18])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 567, 23};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_decay_factor};
    __pyx_mstate_global->__pyx_codeobj_tab[19] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_set_learning_rate_decay, __pyx_k_9_q_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[19])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 579, 95};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_epoch, __pyx_mstate->__pyx_n_u_factor};
    __pyx_mstate_global->__pyx_codeobj_tab[20] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_decrease_learning_rates, __pyx_k_A_4t_CvS_c_r_Bd_Bb_b_A_a_q_4_G1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[20])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 617, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_sent};
    __pyx_mstate_global->__pyx_codeobj_tab[21] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k__7, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[21])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 595, 339};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sentences, __pyx_mstate->__pyx_n_u_tags, __pyx_mstate->__pyx_n_u_epochs, __pyx_mstate->__pyx_n_u_epochs_between_reports, __pyx_mstate->__pyx_n_u_desired_accuracy, __pyx_mstate->__pyx_n_u_logger, __pyx_mstate->__pyx_n_u_top_accuracy, __pyx_mstate->__pyx_n_u_last_accuracy, __pyx_mstate->__pyx_n_u_last_error, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr};
    __pyx_mstate_global->__pyx_codeobj_tab[22] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_train, __pyx_k_A56_1_e1_32Q_q_Rq_N_T_4_S_1_E_aq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[22])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 656, 47};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_num, __pyx_mstate->__pyx_n_u_logger};
    __pyx_mstate_global->__pyx_codeobj_tab[23] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_print_epoch_report, __pyx_k_A_1_e1A_q_q_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[23])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 670, 112};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sentences, __pyx_mstate->__pyx_n_u_tags, __pyx_mstate->__pyx_n_u_random_state, __pyx_mstate->__pyx_n_u_sent, __pyx_mstate->__pyx_n_u_sent_tags};
    __pyx_mstate_global->__pyx_codeobj_tab[24] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_train_epoch, __pyx_k_A_IQ_IQ_A_r_1A_F_s_a_N_6_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[24])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 702, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_sent};
    __pyx_mstate_global->__pyx_codeobj_tab[25] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[25])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 693, 79};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_hits, __pyx_mstate->__pyx_n_u_sent, __pyx_mstate->__pyx_n_u_gold_tags, __pyx_mstate->__pyx_n_u_answer, __pyx_mstate->__pyx_n_u_num_tokens, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr};
    __pyx_mstate_global->__pyx_codeobj_tab[26] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_validate, __pyx_k_A_q_F_s_4_d_T_aq_BnAWCq_S_A_L_Qf, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[26])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 19, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 705, 336};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sentence, __pyx_mstate->__pyx_n_u_output_deltas, __pyx_mstate->__pyx_n_u_output_bias_deltas, __pyx_mstate->__pyx_n_u_dCdf_3, __pyx_mstate->__pyx_n_u_dCdf_2, __pyx_mstate->__pyx_n_u_hidden_deltas, __pyx_mstate->__pyx_n_u_hidden_bias_deltas, __pyx_mstate->__pyx_n_u_input_gradients, __pyx_mstate->__pyx_n_u_input_deltas, __pyx_mstate->__pyx_n_u_padded_sentence, __pyx_mstate->__pyx_n_u_features, __pyx_mstate->__pyx_n_u_table, __pyx_mstate->__pyx_n_u_start, __pyx_mstate->__pyx_n_u_end, __pyx_mstate->__pyx_n_u_t, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_w_deltas};
    __pyx_mstate_global->__pyx_codeobj_tab[27] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_backpropagate, __pyx_k_A_N_D_Q_T_t1A_4q_A_4_4Ba_b_AT_V4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[27])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 804, 114};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_data};
    __pyx_mstate_global->__pyx_codeobj_tab[28] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_load_parameters, __pyx_k_A_r_at1_d_1_O4q_d_1_O4q_d_4q_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[28])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 821, 96};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[29] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_save, __pyx_k_A_t1_A_T_4q_a_D_Q_T_D_t_3_t1_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[29])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 837, 246};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_filename, __pyx_mstate->__pyx_n_u_data, __pyx_mstate->__pyx_n_u_hidden_weights, __pyx_mstate->__pyx_n_u_hidden_bias, __pyx_mstate->__pyx_n_u_output_weights, __pyx_mstate->__pyx_n_u_output_bias, __pyx_mstate->__pyx_n_u_word_window_size, __pyx_mstate->__pyx_n_u_input_size, __pyx_mstate->__pyx_n_u_hidden_size, __pyx_mstate->__pyx_n_u_output_size, __pyx_mstate->__pyx_n_u_transitions, __pyx_mstate->__pyx_n_u_nn};
    __pyx_mstate_global->__pyx_codeobj_tab[30] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_load_from_file_2, __pyx_k_A_r_aq_Qa_d_1_Qa_d_1_4q_T_d_1_d, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[30])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 82, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[31] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_a_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[31])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 82, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[32] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k__8, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[32])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 82, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[33] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_A_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[33])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 82, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[34] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k__9, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[34])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 83, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[35] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_a_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[35])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 83, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_value};
    __pyx_mstate_global->__pyx_codeobj_tab[36] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_set, __pyx_k_a_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[36])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 83, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[37] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[37])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 83, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_value};
    __pyx_mstate_global->__pyx_codeobj_tab[38] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_set, __pyx_k_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[38])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 84, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[39] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_a_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[39])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 84, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_value};
    __pyx_mstate_global->__pyx_codeobj_tab[40] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_set, __pyx_k_a_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[40])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 85, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[41] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_Q_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[41])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 85, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_value};
    __pyx_mstate_global->__pyx_codeobj_tab[42] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_set, __pyx_k_Q_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[42])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 85, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[43] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_del, __pyx_k_Q_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[43])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 86, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[44] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_a_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[44])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 93, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[45] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[45])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 93, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_value};
    __pyx_mstate_global->__pyx_codeobj_tab[46] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_set, __pyx_k_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[46])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 93, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[47] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_del, __pyx_k_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[47])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 93, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[48] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k__8, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[48])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 93, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_value};
    __pyx_mstate_global->__pyx_codeobj_tab[49] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_set, __pyx_k__8, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[49])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 93, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[50] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_del, __pyx_k__8, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[50])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 96, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[51] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_Q_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[51])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 96, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[52] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[52])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 97, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[53] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_Q_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[53])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 97, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[54] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k__10, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[54])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 98, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[55] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_Q_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[55])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 98, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[56] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_1_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[56])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 98, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[57] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k__11, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[57])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 101, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[58] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_Q_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[58])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 101, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_value};
    __pyx_mstate_global->__pyx_codeobj_tab[59] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_set, __pyx_k_Q_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[59])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 101, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[60] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_del, __pyx_k_Q_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[60])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 104, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[61] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_a_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[61])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 104, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_value};
    __pyx_mstate_global->__pyx_codeobj_tab[62] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_set, __pyx_k_a_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[62])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 105, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[63] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[63])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 105, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_value};
    __pyx_mstate_global->__pyx_codeobj_tab[64] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_set, __pyx_k_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[64])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 105, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[65] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_del, __pyx_k_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[65])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 108, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[66] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k__12, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[66])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 111, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[67] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_Q_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[67])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 111, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[68] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_A_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[68])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 112, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[69] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_Q_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[69])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 112, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[70] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k__13, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[70])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 112, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[71] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_A_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[71])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 119, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[72] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_A_5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[72])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 119, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_value};
    __pyx_mstate_global->__pyx_codeobj_tab[73] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_set, __pyx_k_A_5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[73])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 119, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[74] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_del, __pyx_k_A_5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[74])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 120, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[75] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_A_5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[75])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 120, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_value};
    __pyx_mstate_global->__pyx_codeobj_tab[76] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_set, __pyx_k_A_5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[76])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 120, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[77] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_network_pyx, __pyx_mstate->__pyx_n_u_del, __pyx_k_A_5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[77])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1, 1354};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[78] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_k_T_D_t_hdRccgg_A_A_P_P_T_T_b_b_f, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[78])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16, 11};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[79] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_k_QfA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[79])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 56, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_table};
    __pyx_mstate_global->__pyx_codeobj_tab[80] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[80])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {8, 0, 0, 25, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 51, 430};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_feature_tables, __pyx_mstate->__pyx_n_u_target_dist_table, __pyx_mstate->__pyx_n_u_pred_dist_table, __pyx_mstate->__pyx_n_u_word_window, __pyx_mstate->__pyx_n_u_hidden1_size, __pyx_mstate->__pyx_n_u_hidden2_size, __pyx_mstate->__pyx_n_u_output_size, __pyx_mstate->__pyx_n_u_input_size, __pyx_mstate->__pyx_n_u_dist_features_per_token, __pyx_mstate->__pyx_n_u_input_size_with_distance, __pyx_mstate->__pyx_n_u_high, __pyx_mstate->__pyx_n_u_hidden_weights, __pyx_mstate->__pyx_n_u_num_dist_features, __pyx_mstate->__pyx_n_u_target_dist_weights, __pyx_mstate->__pyx_n_u_pred_dist_weights, __pyx_mstate->__pyx_n_u_hidden_bias, __pyx_mstate->__pyx_n_u_hidden2_weights, __pyx_mstate->__pyx_n_u_hidden2_bias, __pyx_mstate->__pyx_n_u_output_dim, __pyx_mstate->__pyx_n_u_output_weights, __pyx_mstate->__pyx_n_u_output_bias, __pyx_mstate->__pyx_n_u_net, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr};
    __pyx_mstate_global->__pyx_codeobj_tab[81] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_create_new, __pyx_k_A_c_Q_a_36_R_fTUUV_c_Rq_uBb_Qa_7, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[81])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 100, 129};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_hidden2_size, __pyx_mstate->__pyx_n_u_table_dims, __pyx_mstate->__pyx_n_u_dist_table_dims, __pyx_mstate->__pyx_n_u_desc, __pyx_mstate->__pyx_n_u_t};
    __pyx_mstate_global->__pyx_codeobj_tab[82] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_description, __pyx_k_A_uD_1_Jd_Qc_6_d_t1_d_q_3d_F_4tK, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[82])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {14, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 122, 149};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_word_window, __pyx_mstate->__pyx_n_u_input_size, __pyx_mstate->__pyx_n_u_hidden1_size, __pyx_mstate->__pyx_n_u_hidden2_size, __pyx_mstate->__pyx_n_u_output_size, __pyx_mstate->__pyx_n_u_hidden1_weights, __pyx_mstate->__pyx_n_u_hidden1_bias, __pyx_mstate->__pyx_n_u_target_dist_weights, __pyx_mstate->__pyx_n_u_pred_dist_weights, __pyx_mstate->__pyx_n_u_hidden2_weights, __pyx_mstate->__pyx_n_u_hidden2_bias, __pyx_mstate->__pyx_n_u_output_weights, __pyx_mstate->__pyx_n_u_output_bias};
    __pyx_mstate_global->__pyx_codeobj_tab[83] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_k_A_Q_E_3A_3DA3C1_O_r_l_A_O1_1_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[83])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 148, 142};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_d};
    __pyx_mstate_global->__pyx_codeobj_tab[84] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_generate_save_dict, __pyx_k_A_A_4q_Q_T_4q_A_T_T_4q_a_D_Q_T_D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[84])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 169, 28};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_data};
    __pyx_mstate_global->__pyx_codeobj_tab[85] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_save, __pyx_k_A_t_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[85])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 178, 318};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_data, __pyx_mstate->__pyx_n_u_filename, __pyx_mstate->__pyx_n_u_hidden_weights, __pyx_mstate->__pyx_n_u_hidden_bias, __pyx_mstate->__pyx_n_u_hidden2_weights, __pyx_mstate->__pyx_n_u_hidden2_bias, __pyx_mstate->__pyx_n_u_output_weights, __pyx_mstate->__pyx_n_u_output_bias, __pyx_mstate->__pyx_n_u_word_window_size, __pyx_mstate->__pyx_n_u_input_size, __pyx_mstate->__pyx_n_u_hidden_size, __pyx_mstate->__pyx_n_u_hidden2_size, __pyx_mstate->__pyx_n_u_output_size, __pyx_mstate->__pyx_n_u_nn};
    __pyx_mstate_global->__pyx_codeobj_tab[86] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_load_from_file, __pyx_k_A_Qa_d_1_aq_t1A_Qa_d_1_4q_T_d_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[86])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 224, 33};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_filename, __pyx_mstate->__pyx_n_u_data};
    __pyx_mstate_global->__pyx_codeobj_tab[87] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_load_from_file_2, __pyx_k_A_r_az_a_s_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[87])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 234, 188};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_data};
    __pyx_mstate_global->__pyx_codeobj_tab[88] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_load_parameters, __pyx_k_A_r_at1_d_1_O4q_d_1_O4q_d_4q_Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[88])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 261, 41};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_validation_sentences, __pyx_mstate->__pyx_n_u_validation_predicates, __pyx_mstate->__pyx_n_u_validation_tags, __pyx_mstate->__pyx_n_u_validation_arguments};
    __pyx_mstate_global->__pyx_codeobj_tab[89] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_set_validation_data, __pyx_k_A_78_A_Q_q_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[89])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 288, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_sent};
    __pyx_mstate_global->__pyx_codeobj_tab[90] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k__7, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[90])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {8, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 275, 360};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sentences, __pyx_mstate->__pyx_n_u_predicates, __pyx_mstate->__pyx_n_u_tags, __pyx_mstate->__pyx_n_u_epochs, __pyx_mstate->__pyx_n_u_epochs_between_reports, __pyx_mstate->__pyx_n_u_desired_accuracy, __pyx_mstate->__pyx_n_u_arguments, __pyx_mstate->__pyx_n_u_logger, __pyx_mstate->__pyx_n_u_last_accuracy, __pyx_mstate->__pyx_n_u_top_accuracy, __pyx_mstate->__pyx_n_u_last_error, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr};
    __pyx_mstate_global->__pyx_codeobj_tab[91] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_train, __pyx_k_A56_7q_S_N_T_Zwa_1_e1_32Q_q_Rq_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[91])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 334, 26};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[92] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_reset_counters, __pyx_k_A_IQ_IQ_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[92])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 343, 104};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sentences, __pyx_mstate->__pyx_n_u_predicates, __pyx_mstate->__pyx_n_u_tags, __pyx_mstate->__pyx_n_u_arguments, __pyx_mstate->__pyx_n_u_random_state};
    __pyx_mstate_global->__pyx_codeobj_tab[93] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_shuffle_data, __pyx_k_C1_r_1A_1A_WA_gZq_gXQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[93])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 360, 118};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sentences, __pyx_mstate->__pyx_n_u_predicates, __pyx_mstate->__pyx_n_u_tags, __pyx_mstate->__pyx_n_u_arguments, __pyx_mstate->__pyx_n_u_i_args, __pyx_mstate->__pyx_n_u_sent_args, __pyx_mstate->__pyx_n_u_sent, __pyx_mstate->__pyx_n_u_sent_preds, __pyx_mstate->__pyx_n_u_sent_tags};
    __pyx_mstate_global->__pyx_codeobj_tab[94] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_train_epoch, __pyx_k_A_A_N_l_WA_T_F_m3a_a_z_D_N_6_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[94])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 381, 51};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sentence, __pyx_mstate->__pyx_n_u_predicates, __pyx_mstate->__pyx_n_u_arguments, __pyx_mstate->__pyx_n_u_logprob, __pyx_mstate->__pyx_n_u_allow_repeats};
    __pyx_mstate_global->__pyx_codeobj_tab[95] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_tag_sentence_2, __pyx_k_A_7q_Zwa_t_L8H, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[95])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 32, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 400, 103};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_positions, __pyx_mstate->__pyx_n_u_argument, __pyx_mstate->__pyx_n_u_target_dist_table, __pyx_mstate->__pyx_n_u_pred_dist_table, __pyx_mstate->__pyx_n_u_target_dist_weights, __pyx_mstate->__pyx_n_u_pred_dist_weights, __pyx_mstate->__pyx_n_u_target_dist_offset, __pyx_mstate->__pyx_n_u_pred_dist_offset, __pyx_mstate->__pyx_n_u_target_dist_lookup, __pyx_mstate->__pyx_n_u_pred_dist_lookup, __pyx_mstate->__pyx_n_u_target_convolution_lookup, __pyx_mstate->__pyx_n_u_pred_convolution_lookup, __pyx_mstate->__pyx_n_u_target_dist_deltas, __pyx_mstate->__pyx_n_u_pred_dist_deltas, __pyx_mstate->__pyx_n_u_hidden2_size, __pyx_mstate->__pyx_n_u_hidden2_weights, __pyx_mstate->__pyx_n_u_hidden2_bias, __pyx_mstate->__pyx_n_u_hidden2_values, __pyx_mstate->__pyx_n_u_hidden2_before_activation, __pyx_mstate->__pyx_n_u_hidden_before_activation, __pyx_mstate->__pyx_n_u_convolution_lookup, __pyx_mstate->__pyx_n_u_max_indices, __pyx_mstate->__pyx_n_u_num_targets, __pyx_mstate->__pyx_n_u_only_classify, __pyx_mstate->__pyx_n_u_half_window, __pyx_mstate->__pyx_n_u_hidden_gradients, __pyx_mstate->__pyx_n_u_hidden2_gradients, __pyx_mstate->__pyx_n_u_input_deltas, __pyx_mstate->__pyx_n_u_num_sentences, __pyx_mstate->__pyx_n_u_validation_predicates, __pyx_mstate->__pyx_n_u_validation_arguments};
    __pyx_mstate_global->__pyx_codeobj_tab[96] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_argument_distances, __pyx_k_A_IU_RuA_Rxq_81A_L_BgQ_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[96])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 421, 483};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sentence, __pyx_mstate->__pyx_n_u_predicate, __pyx_mstate->__pyx_n_u_argument_blocks, __pyx_mstate->__pyx_n_u_training, __pyx_mstate->__pyx_n_u_convolution_values, __pyx_mstate->__pyx_n_u_scores, __pyx_mstate->__pyx_n_u_input_and_pred_dist_values, __pyx_mstate->__pyx_n_u_pred_dist_indices, __pyx_mstate->__pyx_n_u_pred_dist_values, __pyx_mstate->__pyx_n_u_target, __pyx_mstate->__pyx_n_u_target_dist_indices, __pyx_mstate->__pyx_n_u_argument, __pyx_mstate->__pyx_n_u_target_dist_values};
    __pyx_mstate_global->__pyx_codeobj_tab[97] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_sentence_convolution, __pyx_k_AIJ_O3a_Cz_AQ_RvRt_Q_1_6_4_T_r_r, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[97])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 509, 85};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sentence, __pyx_mstate->__pyx_n_u_training};
    __pyx_mstate_global->__pyx_codeobj_tab[98] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_pre_tagging_setup, __pyx_k_A_1_RvRs_d_q_4_3fD0Fa_4_F_B, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[98])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 19, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 525, 298};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sentence, __pyx_mstate->__pyx_n_u_predicates, __pyx_mstate->__pyx_n_u_tags, __pyx_mstate->__pyx_n_u_argument_blocks, __pyx_mstate->__pyx_n_u_allow_repeats, __pyx_mstate->__pyx_n_u_logprob, __pyx_mstate->__pyx_n_u_answer, __pyx_mstate->__pyx_n_u_training, __pyx_mstate->__pyx_n_u_token_scores, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_predicate, __pyx_mstate->__pyx_n_u_pred_arguments, __pyx_mstate->__pyx_n_u_pred_answer, __pyx_mstate->__pyx_n_u_pred_tags, __pyx_mstate->__pyx_n_u_all_scores, __pyx_mstate->__pyx_n_u_last_token, __pyx_mstate->__pyx_n_u_logadd, __pyx_mstate->__pyx_n_u_confidence};
    __pyx_mstate_global->__pyx_codeobj_tab[99] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_tag_sentence, __pyx_k_A_1_A_5_q_q_C_IQa_XT_A_PQQR__AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[99])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 576, 187};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_num_items, __pyx_mstate->__pyx_n_u_hits, __pyx_mstate->__pyx_n_u_i_args, __pyx_mstate->__pyx_n_u_sent_args, __pyx_mstate->__pyx_n_u_sent, __pyx_mstate->__pyx_n_u_sent_preds, __pyx_mstate->__pyx_n_u_sent_tags, __pyx_mstate->__pyx_n_u_answer, __pyx_mstate->__pyx_n_u_predicate_answer, __pyx_mstate->__pyx_n_u_predicate_tags, __pyx_mstate->__pyx_n_u_net_tag, __pyx_mstate->__pyx_n_u_gold_tag};
    __pyx_mstate_global->__pyx_codeobj_tab[100] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_validate, __pyx_k_A_A_q_4_WA_T_a_F_m3at104A04A_t_D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[100])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 609, 37};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tags, __pyx_mstate->__pyx_n_u_scores};
    __pyx_mstate_global->__pyx_codeobj_tab[101] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_calculate_gradients, __pyx_k_A_4q_4_5QfA_4_0_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[101])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 616, 163};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tags, __pyx_mstate->__pyx_n_u_scores, __pyx_mstate->__pyx_n_u_correction, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_tag_scores, __pyx_mstate->__pyx_n_u_tag, __pyx_mstate->__pyx_n_u_exponentials, __pyx_mstate->__pyx_n_u_exp_sum, __pyx_mstate->__pyx_n_u_logadd, __pyx_mstate->__pyx_n_u_error};
    __pyx_mstate_global->__pyx_codeobj_tab[102] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_calculate_gradients_classify, __pyx_k_A_R_81_Q_C_Yaq_aq_2T_b_AQ_Rt1A_G, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[102])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 653, 93};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dCd_tanh, __pyx_mstate->__pyx_n_u_dCd_hidden2};
    __pyx_mstate_global->__pyx_codeobj_tab[103] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_backpropagate, __pyx_k_A_4_T_a_4_q_2Yat1_Q_D_at1_IRy_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[103])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 675, 528};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_predicate, __pyx_mstate->__pyx_n_u_arguments, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_gradients_t, __pyx_mstate->__pyx_n_u_last_values, __pyx_mstate->__pyx_n_u_deltas, __pyx_mstate->__pyx_n_u_grad_matrix, __pyx_mstate->__pyx_n_u_input_values, __pyx_mstate->__pyx_n_u_neuron_maxes, __pyx_mstate->__pyx_n_u_target_dists, __pyx_mstate->__pyx_n_u_argument, __pyx_mstate->__pyx_n_u_dist_features, __pyx_mstate->__pyx_n_u_pred_dists};
    __pyx_mstate_global->__pyx_codeobj_tab[104] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_adjust_weights, __pyx_k_A34_d_T1B_SWWX_2T_r_Q_q_D_d_3b_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[104])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 742, 390};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sentence, __pyx_mstate->__pyx_n_u_predicate, __pyx_mstate->__pyx_n_u_arguments, __pyx_mstate->__pyx_n_u_hidden_gradients, __pyx_mstate->__pyx_n_u_input_gradients, __pyx_mstate->__pyx_n_u_target_dist_gradients, __pyx_mstate->__pyx_n_u_pred_dist_gradients, __pyx_mstate->__pyx_n_u_gradients, __pyx_mstate->__pyx_n_u_convolution_max, __pyx_mstate->__pyx_n_u_target_dists, __pyx_mstate->__pyx_n_u_column_numbers, __pyx_mstate->__pyx_n_u_target, __pyx_mstate->__pyx_n_u_argument, __pyx_mstate->__pyx_n_u_pred_dists};
    __pyx_mstate_global->__pyx_codeobj_tab[105] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_calculate_input_deltas, __pyx_k_A_34_F_Cq_4q_A_q_DPQ_b_b_V1D_A_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[105])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 18, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 797, 491};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sentence, __pyx_mstate->__pyx_n_u_predicate, __pyx_mstate->__pyx_n_u_start_from, __pyx_mstate->__pyx_n_u_dist_target_from, __pyx_mstate->__pyx_n_u_dist_pred_from, __pyx_mstate->__pyx_n_u_pre_dist, __pyx_mstate->__pyx_n_u_pos_dist, __pyx_mstate->__pyx_n_u_padded_sentence, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_table, __pyx_mstate->__pyx_n_u_table_deltas, __pyx_mstate->__pyx_n_u_token, __pyx_mstate->__pyx_n_u_deltas, __pyx_mstate->__pyx_n_u_dist_deltas, __pyx_mstate->__pyx_n_u_pre_deltas, __pyx_mstate->__pyx_n_u_pos_deltas};
    __pyx_mstate_global->__pyx_codeobj_tab[106] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_adjust_features, __pyx_k_A_Q_1_4q_1_4_1_b_Bd_2_a_E_at1_9I, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[106])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 19, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 849, 509};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_scores, __pyx_mstate->__pyx_n_u_allow_repeats, __pyx_mstate->__pyx_n_u_best_scores, __pyx_mstate->__pyx_n_u_logadd, __pyx_mstate->__pyx_n_u_logprobs, __pyx_mstate->__pyx_n_u_counts, __pyx_mstate->__pyx_n_u_conflicting_tag, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_conflicting_probs, __pyx_mstate->__pyx_n_u_highest_prob_arg, __pyx_mstate->__pyx_n_u_other_args, __pyx_mstate->__pyx_n_u_path_scores, __pyx_mstate->__pyx_n_u_path_backtrack, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_token, __pyx_mstate->__pyx_n_u_prev_score_and_trans, __pyx_mstate->__pyx_n_u_answer, __pyx_mstate->__pyx_n_u_previous_tag};
    __pyx_mstate_global->__pyx_codeobj_tab[107] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_viterbi, __pyx_k_ANO_4_Cq_q_q_q_Rt1Bd_2T_1_c_7_Ry, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[107])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 923, 236};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_num_distances, __pyx_mstate->__pyx_n_u_window_from, __pyx_mstate->__pyx_n_u_window_to, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_shift, __pyx_mstate->__pyx_n_u_inds};
    __pyx_mstate_global->__pyx_codeobj_tab[108] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_create_target_lookup, __pyx_k_A_fAS_PPRRS_F_A_00B_DHZZ_aab_a_D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[108])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 952, 235};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_num_distances, __pyx_mstate->__pyx_n_u_window_from, __pyx_mstate->__pyx_n_u_window_to, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_shift, __pyx_mstate->__pyx_n_u_inds};
    __pyx_mstate_global->__pyx_codeobj_tab[109] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_create_pred_lookup, __pyx_k_A_F_3b_NbPQ_FVV_b_a_D_aq_E_at1_B, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[109])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 980, 279};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sentence, __pyx_mstate->__pyx_n_u_training, __pyx_mstate->__pyx_n_u_padded_sentence, __pyx_mstate->__pyx_n_u_window, __pyx_mstate->__pyx_n_u_input_data, __pyx_mstate->__pyx_n_u_new_data, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_element, __pyx_mstate->__pyx_n_u_token_indices, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_table, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_table};
    __pyx_mstate_global->__pyx_codeobj_tab[110] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_create_convolution_lookup, __pyx_k_A_4_1_b_r_Q_Q_a_F_Cq_4q_a_R_1_U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[110])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 14, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[111] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[111])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 14, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_value};
    __pyx_mstate_global->__pyx_codeobj_tab[112] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_set, __pyx_k_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[112])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 14, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[113] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_del, __pyx_k_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[113])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 14, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[114] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_a_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[114])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 14, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_value};
    __pyx_mstate_global->__pyx_codeobj_tab[115] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_set, __pyx_k_a_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[115])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 14, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[116] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_del, __pyx_k_a_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[116])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 15, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[117] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_Q_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[117])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 15, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[118] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k__14, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[118])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[119] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_a_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[119])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[120] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k__10, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[120])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 17, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[121] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_Q_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[121])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 17, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[122] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k__15, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[122])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 18, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[123] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_Q_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[123])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 18, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[124] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k__16, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[124])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 19, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[125] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_Q_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[125])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 19, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[126] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k__15, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[126])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 22, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[127] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_a_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[127])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 23, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[128] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_Q_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[128])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 23, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[129] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_a_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[129])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 24, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[130] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_Q_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[130])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 25, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[131] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_Q_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[131])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 25, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[132] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k__16, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[132])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 31, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[133] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkconv_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_k_Q_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[133])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1, 2582};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[134] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_k_T_D_t3H_O___ggkk_A_A_V_V_Z_Z_i, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[134])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16, 11};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[135] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_k_2_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[135])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 19, 28};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_data};
    __pyx_mstate_global->__pyx_codeobj_tab[136] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkdependenc, __pyx_mstate->__pyx_n_u_save, __pyx_k_A_t_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[136])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 29, 38};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_filename, __pyx_mstate->__pyx_n_u_data, __pyx_mstate->__pyx_n_u_nn};
    __pyx_mstate_global->__pyx_codeobj_tab[137] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkdependenc, __pyx_mstate->__pyx_n_u_load_from_file_2, __pyx_k_A_r_az_a_S_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[137])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 41, 95};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sentences, __pyx_mstate->__pyx_n_u_heads, __pyx_mstate->__pyx_n_u_epochs, __pyx_mstate->__pyx_n_u_epochs_between_reports, __pyx_mstate->__pyx_n_u_desired_accuracy, __pyx_mstate->__pyx_n_u_labels, __pyx_mstate->__pyx_n_u_predicates, __pyx_mstate->__pyx_n_u_sentence};
    __pyx_mstate_global->__pyx_codeobj_tab[138] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkdependenc, __pyx_mstate->__pyx_n_u_train, __pyx_k_A_C1_Qb_q_1Kt_q_4_S_A_q_Q_e6_Q_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[138])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 65, 31};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sentences, __pyx_mstate->__pyx_n_u_heads, __pyx_mstate->__pyx_n_u_labels};
    __pyx_mstate_global->__pyx_codeobj_tab[139] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkdependenc, __pyx_mstate->__pyx_n_u_set_validation_data, __pyx_k_J_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[139])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 77, 46};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sentence, __pyx_mstate->__pyx_n_u_predicates, __pyx_mstate->__pyx_n_u_heads, __pyx_mstate->__pyx_n_u_labels};
    __pyx_mstate_global->__pyx_codeobj_tab[140] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkdependenc, __pyx_mstate->__pyx_n_u_tag_sentence, __pyx_k_1_7_Q_31Ja_1_G1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[140])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 87, 248};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sentence, __pyx_mstate->__pyx_n_u_heads, __pyx_mstate->__pyx_n_u_training, __pyx_mstate->__pyx_n_u_num_tokens, __pyx_mstate->__pyx_n_u_token_scores, __pyx_mstate->__pyx_n_u_token, __pyx_mstate->__pyx_n_u_head, __pyx_mstate->__pyx_n_u_answer};
    __pyx_mstate_global->__pyx_codeobj_tab[141] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkdependenc, __pyx_mstate->__pyx_n_u_tag_sentence_unlabeled_dependen, __pyx_k_WWX_6_q_S_F_L_2Q_IU_1_4_5Qj_6_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[141])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 134, 197};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sentence, __pyx_mstate->__pyx_n_u_heads, __pyx_mstate->__pyx_n_u_labels, __pyx_mstate->__pyx_n_u_answer, __pyx_mstate->__pyx_n_u_scores, __pyx_mstate->__pyx_n_u_training, __pyx_mstate->__pyx_n_u_token, __pyx_mstate->__pyx_n_u_head, __pyx_mstate->__pyx_n_u_label};
    __pyx_mstate_global->__pyx_codeobj_tab[142] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkdependenc, __pyx_mstate->__pyx_n_u_tag_sentence_labeled_dependency, __pyx_k_A_7_q_6_Qa_IU_3aq_5_1AV1_T_q_q_9, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[142])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 172, 136};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_gold_head, __pyx_mstate->__pyx_n_u_scores, __pyx_mstate->__pyx_n_u_exp_scores, __pyx_mstate->__pyx_n_u_exp_sum, __pyx_mstate->__pyx_n_u_error, __pyx_mstate->__pyx_n_u_new_shape};
    __pyx_mstate_global->__pyx_codeobj_tab[143] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkdependenc, __pyx_mstate->__pyx_n_u_calculate_gradients, __pyx_k_A_7b_AQ_D_Qk_1_D_aq_Ja_6_A_1_N_T, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[143])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 212, 250};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_hits, __pyx_mstate->__pyx_n_u_num_tokens, __pyx_mstate->__pyx_n_u_sentence_hits, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_sent, __pyx_mstate->__pyx_n_u_heads, __pyx_mstate->__pyx_n_u_sentence_hit, __pyx_mstate->__pyx_n_u_answer, __pyx_mstate->__pyx_n_u_gold_tags, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_net_tag, __pyx_mstate->__pyx_n_u_gold_tag};
    __pyx_mstate_global->__pyx_codeobj_tab[144] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkdependenc, __pyx_mstate->__pyx_n_u_validate, __pyx_k_A_q_Q_E_as_4q_4_AQ_D_1_t_Cq_A_D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[144])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 251, 19};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[145] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkdependenc, __pyx_mstate->__pyx_n_u_average_error, __pyx_k_A_IT_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[145])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 257, 54};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_num, __pyx_mstate->__pyx_n_u_logger};
    __pyx_mstate_global->__pyx_codeobj_tab[146] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkdependenc, __pyx_mstate->__pyx_n_u_print_epoch_report, __pyx_k_A_1_e1A_0_0_0_0_0, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[146])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 273, 42};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sentence, __pyx_mstate->__pyx_n_u_heads};
    __pyx_mstate_global->__pyx_codeobj_tab[147] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkdependenc, __pyx_mstate->__pyx_n_u_tag_sentence_2, __pyx_k_A_6_A_4_1_4_8_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[147])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 287, 110};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_graph, __pyx_mstate->__pyx_n_u_reachable_vertices, __pyx_mstate->__pyx_n_u_vertices_in_cycles, __pyx_mstate->__pyx_n_u_visited, __pyx_mstate->__pyx_n_u_cycles, __pyx_mstate->__pyx_n_u_vertex, __pyx_mstate->__pyx_n_u_cycle};
    __pyx_mstate_global->__pyx_codeobj_tab[148] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkdependenc, __pyx_mstate->__pyx_n_u_find_cycles, __pyx_k_A_Q_Je1Cq_wc_Cwc_D_awha_C1_vWA_g, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[148])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 318, 179};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_graph, __pyx_mstate->__pyx_n_u_vertex, __pyx_mstate->__pyx_n_u_visited, __pyx_mstate->__pyx_n_u_reachable, __pyx_mstate->__pyx_n_u_unreachable, __pyx_mstate->__pyx_n_u_next_vertex, __pyx_mstate->__pyx_n_u_root, __pyx_mstate->__pyx_n_u_cycle};
    __pyx_mstate_global->__pyx_codeobj_tab[149] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkdependenc, __pyx_mstate->__pyx_n_u_find_cycle_recursive, __pyx_k_A_e1A_s_1_t1A_s_s_c_WAQ_6_A_A_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[149])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 25, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 358, 438};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_heads, __pyx_mstate->__pyx_n_u_cycle, __pyx_mstate->__pyx_n_u_num_vertices, __pyx_mstate->__pyx_n_u_outside, __pyx_mstate->__pyx_n_u_outgoing_weights, __pyx_mstate->__pyx_n_u_outside_inds, __pyx_mstate->__pyx_n_u_max_outgoing_inds, __pyx_mstate->__pyx_n_u_max_outgoing_weights, __pyx_mstate->__pyx_n_u_cycle_inds, __pyx_mstate->__pyx_n_u_incoming_weights, __pyx_mstate->__pyx_n_u_cycle_score, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_vertex, __pyx_mstate->__pyx_n_u_head_to_v, __pyx_mstate->__pyx_n_u_max_incoming_inds, __pyx_mstate->__pyx_n_u_max_incoming_weights, __pyx_mstate->__pyx_n_u_new_head_ind, __pyx_mstate->__pyx_n_u_vertex_leaving_cycle_ind, __pyx_mstate->__pyx_n_u_new_head, __pyx_mstate->__pyx_n_u_vertex_leaving_cycle, __pyx_mstate->__pyx_n_u_old_head, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[150] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkdependenc, __pyx_mstate->__pyx_n_u_contract_cycle, __pyx_k_A_t_fAQ_F_1Bd_uA_3b_q_Qa_3ay_2V1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[150])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 433, 55};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_heads, __pyx_mstate->__pyx_n_u_cycles, __pyx_mstate->__pyx_n_u_cycle};
    __pyx_mstate_global->__pyx_codeobj_tab[151] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkdependenc, __pyx_mstate->__pyx_n_u_find_maximum_spanning_tree, __pyx_k_A_waq_1_IQ_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[151])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 14, 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[152] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_nltkor_tag_libs_networkdependenc, __pyx_mstate->__pyx_n_u_get, __pyx_k_Q_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[152])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1, 2682};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[153] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_k_T_D_t3H_O___ttx_y_A_A_E_E_V_V_Z, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[153])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16, 11};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[154] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_k_AV1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[154])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1, 86};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_PickleError, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[155] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_pyx_unpickle_Network, __pyx_k_hk_A_1_b_b_d_d_e_7_1_7_N_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[155])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 11, 1382};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_result, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[156] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_pyx_unpickle_Network__set_stat, __pyx_k_Kq_L8H_STTXXddtt_A_A_E_E_Q_Q_Z, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[156])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1, 89};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_PickleError, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[157] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_pyx_unpickle_ConvolutionalNetw, __pyx_k_hk_A_1_A_A_B_xq_7_6a7Nn_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[157])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 11, 2401};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_result, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[158] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_pyx_unpickle_ConvolutionalNetw_2, __pyx_k_Kq_L8H_STTXXddz_F_F_G_G_K_K_W_W, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[158])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1, 90};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_PickleError, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[159] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_pyx_unpickle_ConvolutionalDepe, __pyx_k_hk_A_1_e_e_g_g_h_1_7_Abbppq_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[159])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 11, 2471};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_result, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[160] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_pyx_unpickle_ConvolutionalDepe_2, __pyx_k_Kq_L8H_STTXXddz_F_F_G_G_K_K_W_W_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[160])) goto bad;
  }
  Py_DECREF(tuple_dedup_map);
  return 0;
  bad:
  Py_DECREF(tuple_dedup_map);
  return -1;
}
/* #### Code section: init_globals ### */

static int __Pyx_InitGlobals(void) {
  /* PythonCompatibility.init */
  if (likely(__Pyx_init_co_variables() == 0)); else

if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* NumpyImportArray.init */
  /*
 * Cython has automatically inserted a call to _import_array since
 * you didn't include one when you cimported numpy. To disable this
 * add the line
 *   <void>numpy._import_array
 */
#ifdef NPY_FEATURE_VERSION
#ifndef NO_IMPORT_ARRAY
if (unlikely(_import_array() == -1)) {
    PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import "
    "(auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; "
    "use '<void>numpy._import_array' to disable if you are certain you don't need it).");
}
#endif
#endif

if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* CachedMethodType.init */
  #if CYTHON_COMPILING_IN_LIMITED_API
{
    PyObject *typesModule=NULL;
    typesModule = PyImport_ImportModule("types");
    if (typesModule) {
        __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType");
        Py_DECREF(typesModule);
    }
} // error handling follows
#endif

if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cleanup_globals ### */
/* #### Code section: cleanup_module ### */
/* #### Code section: main_method ### */
/* #### Code section: utility_code_pragmas ### */
#ifdef _MSC_VER
#pragma warning( push )
/* Warning 4127: conditional expression is constant
 * Cython uses constant conditional expressions to allow in inline functions to be optimized at
 * compile-time, so this warning is not useful
 */
#pragma warning( disable : 4127 )
#endif



/* #### Code section: utility_code_def ### */

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule(modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, "RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* PyErrExceptionMatches */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    int result;
    PyObject *exc_type;
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *current_exception = tstate->current_exception;
    if (unlikely(!current_exception)) return 0;
    exc_type = (PyObject*) Py_TYPE(current_exception);
    if (exc_type == err) return 1;
#else
    exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
#endif
    #if CYTHON_AVOID_BORROWED_REFS
    Py_INCREF(exc_type);
    #endif
    if (unlikely(PyTuple_Check(err))) {
        result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    } else {
        result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
    }
    #if CYTHON_AVOID_BORROWED_REFS
    Py_DECREF(exc_type);
    #endif
    return result;
}
#endif

/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *tmp_value;
    assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
    if (value) {
        #if CYTHON_COMPILING_IN_CPYTHON
        if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
        #endif
            PyException_SetTraceback(value, tb);
    }
    tmp_value = tstate->current_exception;
    tstate->current_exception = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
#else
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject* exc_value;
    exc_value = tstate->current_exception;
    tstate->current_exception = 0;
    *value = exc_value;
    *type = NULL;
    *tb = NULL;
    if (exc_value) {
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        #if CYTHON_COMPILING_IN_CPYTHON
        *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
        Py_XINCREF(*tb);
        #else
        *tb = PyException_GetTraceback(exc_value);
        #endif
    }
#else
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#endif
}
#endif

/* PyObjectGetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* PyObjectGetAttrStrNoError */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        __Pyx_PyErr_Clear();
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
    PyObject *result;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
    return result;
#else
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
        return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
    }
#endif
    result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
    if (unlikely(!result)) {
        __Pyx_PyObject_GetAttrStr_ClearAttributeError();
    }
    return result;
#endif
}

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name);
    if (unlikely(!result) && !PyErr_Occurred()) {
        PyErr_Format(PyExc_NameError,
            "name '%U' is not defined", name);
    }
    return result;
}

/* GetTopmostException */
#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
           exc_info->previous_item != NULL)
    {
        exc_info = exc_info->previous_item;
    }
    return exc_info;
}
#endif

/* SaveResetException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    PyObject *exc_value = exc_info->exc_value;
    if (exc_value == NULL || exc_value == Py_None) {
        *value = NULL;
        *type = NULL;
        *tb = NULL;
    } else {
        *value = exc_value;
        Py_INCREF(*value);
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        *tb = PyException_GetTraceback(exc_value);
    }
  #elif CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    *type = exc_info->exc_type;
    *value = exc_info->exc_value;
    *tb = exc_info->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
  #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
  #endif
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = tstate->exc_info;
    PyObject *tmp_value = exc_info->exc_value;
    exc_info->exc_value = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
  #else
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = type;
    exc_info->exc_value = value;
    exc_info->exc_traceback = tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
  #endif
}
#endif

/* GetException */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
#endif
{
    PyObject *local_type = NULL, *local_value, *local_tb = NULL;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
  #if PY_VERSION_HEX >= 0x030C0000
    local_value = tstate->current_exception;
    tstate->current_exception = 0;
  #else
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
  #endif
#elif __PYX_LIMITED_VERSION_HEX > 0x030C0000
    local_value = PyErr_GetRaisedException();
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
#if __PYX_LIMITED_VERSION_HEX > 0x030C0000
    if (likely(local_value)) {
        local_type = (PyObject*) Py_TYPE(local_value);
        Py_INCREF(local_type);
        local_tb = PyException_GetTraceback(local_value);
    }
#else
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
#endif // __PYX_LIMITED_VERSION_HEX > 0x030C0000
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    #if CYTHON_USE_EXC_INFO_STACK
    {
        _PyErr_StackItem *exc_info = tstate->exc_info;
      #if PY_VERSION_HEX >= 0x030B00a4
        tmp_value = exc_info->exc_value;
        exc_info->exc_value = local_value;
        tmp_type = NULL;
        tmp_tb = NULL;
        Py_XDECREF(local_type);
        Py_XDECREF(local_tb);
      #else
        tmp_type = exc_info->exc_type;
        tmp_value = exc_info->exc_value;
        tmp_tb = exc_info->exc_traceback;
        exc_info->exc_type = local_type;
        exc_info->exc_value = local_value;
        exc_info->exc_traceback = local_tb;
      #endif
    }
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000
    PyErr_SetHandledException(local_value);
    Py_XDECREF(local_value);
    Py_XDECREF(local_type);
    Py_XDECREF(local_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
#if __PYX_LIMITED_VERSION_HEX <= 0x030C0000
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
#endif
}

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject *const *args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject **fastlocals;
    Py_ssize_t i;
    PyObject *result;
    assert(globals != NULL);
    /* XXX Perhaps we should create a specialized
       PyFrame_New() that doesn't take locals, but does
       take builtins without sanity checking them.
       */
    assert(tstate != NULL);
    f = PyFrame_New(tstate, co, globals, NULL);
    if (f == NULL) {
        return NULL;
    }
    fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
    PyObject *kwdefs;
    PyObject *kwtuple, **k;
    PyObject **d;
    Py_ssize_t nd;
    Py_ssize_t nk;
    PyObject *result;
    assert(kwargs == NULL || PyDict_Check(kwargs));
    nk = kwargs ? PyDict_Size(kwargs) : 0;
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) {
        return NULL;
    }
    if (
            co->co_kwonlyargcount == 0 &&
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif

/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = Py_TYPE(func)->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
    self = __Pyx_CyOrPyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectFastCall */
#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) {
    PyObject *argstuple;
    PyObject *result = 0;
    size_t i;
    argstuple = PyTuple_New((Py_ssize_t)nargs);
    if (unlikely(!argstuple)) return NULL;
    for (i = 0; i < nargs; i++) {
        Py_INCREF(args[i]);
        if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad;
    }
    result = __Pyx_PyObject_Call(func, argstuple, kwargs);
  bad:
    Py_DECREF(argstuple);
    return result;
}
#endif
#if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API
  #if PY_VERSION_HEX < 0x03090000
    #define __Pyx_PyVectorcall_Function(callable) _PyVectorcall_Function(callable)
  #elif CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) {
    PyTypeObject *tp = Py_TYPE(callable);
    #if defined(__Pyx_CyFunction_USED)
    if (__Pyx_CyFunction_CheckExact(callable)) {
        return __Pyx_CyFunction_func_vectorcall(callable);
    }
    #endif
    if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
        return NULL;
    }
    assert(PyCallable_Check(callable));
    Py_ssize_t offset = tp->tp_vectorcall_offset;
    assert(offset > 0);
    vectorcallfunc ptr;
    memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
    return ptr;
}
  #else
    #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
  #endif
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t _nargs, PyObject *kwargs) {
    Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
#if CYTHON_COMPILING_IN_CPYTHON
    if (nargs == 0 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
            return __Pyx_PyObject_CallMethO(func, NULL);
    }
    else if (nargs == 1 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
            return __Pyx_PyObject_CallMethO(func, args[0]);
    }
#endif
    #if PY_VERSION_HEX < 0x030800B1
    #if CYTHON_FAST_PYCCALL
    if (PyCFunction_Check(func)) {
        if (kwargs) {
            return _PyCFunction_FastCallDict(func, args, nargs, kwargs);
        } else {
            return _PyCFunction_FastCallKeywords(func, args, nargs, NULL);
        }
    }
    if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) {
        return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL);
    }
    #endif
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs);
    }
    #endif
    #endif
    if (kwargs == NULL) {
        #if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API
        vectorcallfunc f = __Pyx_PyVectorcall_Function(func);
        if (f) {
            return f(func, args, _nargs, NULL);
        }
        #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL
        if (__Pyx_CyFunction_CheckExact(func)) {
            __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func);
            if (f) return f(func, args, _nargs, NULL);
        }
        #elif CYTHON_COMPILING_IN_LIMITED_API && CYTHON_VECTORCALL
        return PyObject_Vectorcall(func, args, _nargs, NULL);
        #endif
    }
    if (nargs == 0) {
        return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs);
    }
    #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
    #else
    return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
    #endif
}

/* RaiseException */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause) {
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if PY_VERSION_HEX >= 0x030C00A6
        PyException_SetTraceback(value, tb);
#elif CYTHON_FAST_THREAD_STATE
        PyThreadState *tstate = __Pyx_PyThreadState_Current;
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#else
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}

/* Profile */
#if CYTHON_PROFILE || CYTHON_TRACE
#if CYTHON_TRACE && !CYTHON_USE_SYS_MONITORING
static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int line) {
    int ret;
    PyObject *type, *value, *traceback;
    __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
    __Pyx_PyFrame_SetLineNumber(frame, line);
    __Pyx_EnterTracing(tstate);
    ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
    __Pyx_LeaveTracing(tstate);
    if (likely(!ret)) {
        __Pyx_ErrRestoreInState(tstate, type, value, traceback);
    } else {
        Py_XDECREF(type);
        Py_XDECREF(value);
        Py_XDECREF(traceback);
    }
    return ret;
}
#endif
CYTHON_UNUSED static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) {
    PyCodeObject *py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno);
    if (likely(py_code)) {
        py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS;
    }
    return py_code;
}
#if CYTHON_USE_SYS_MONITORING
CYTHON_UNUSED static int __Pyx__TraceStartFunc(PyMonitoringState *state_array, PyObject *code_obj, int offset, int skip_event) {
    int ret;
    __pyx_monitoring_version_type version = 0;
    ret = PyMonitoring_EnterScope(state_array, &version, __Pyx_MonitoringEventTypes, __Pyx_MonitoringEventTypes_CyFunc_count);
    if (unlikely(ret == -1)) return -1;
    return skip_event ? 0 : PyMonitoring_FirePyStartEvent(&state_array[__Pyx_Monitoring_PY_START], code_obj, offset);
}
CYTHON_UNUSED static int __Pyx__TraceStartGen(PyMonitoringState *state_array, __pyx_monitoring_version_type *version, PyObject *code_obj, int offset) {
    int ret;
    ret = PyMonitoring_EnterScope(state_array, version, __Pyx_MonitoringEventTypes, __Pyx_MonitoringEventTypes_CyGen_count);
    if (unlikely(ret == -1)) return -1;
    return PyMonitoring_FirePyStartEvent(&state_array[__Pyx_Monitoring_PY_START], code_obj, offset);
}
CYTHON_UNUSED static int __Pyx__TraceResumeGen(PyMonitoringState *state_array, __pyx_monitoring_version_type *version, PyObject *code_obj, int offset) {
    int ret;
    ret = PyMonitoring_EnterScope(state_array, version, __Pyx_MonitoringEventTypes, __Pyx_MonitoringEventTypes_CyGen_count);
    if (unlikely(ret == -1)) return -1;
    return PyMonitoring_FirePyResumeEvent(&state_array[__Pyx_Monitoring_PY_RESUME], code_obj, offset);
}
CYTHON_UNUSED static void __Pyx__TraceException(PyMonitoringState *monitoring_state, PyObject *code_obj, int offset, int reraised) {
    if (reraised) {
        (void) PyMonitoring_FireReraiseEvent(monitoring_state, code_obj, offset);
    } else {
        (void) PyMonitoring_FireRaiseEvent(monitoring_state, code_obj, offset);
    }
}
#if CYTHON_TRACE
CYTHON_UNUSED static int __Pyx__TraceLine(PyMonitoringState *monitoring_state, PyObject *code_obj, int line, int offset) {
    int ret;
    PyObject *exc = PyErr_GetRaisedException();
    ret = PyMonitoring_FireLineEvent(monitoring_state, code_obj, offset, line);
    if (exc) PyErr_SetRaisedException(exc);
    return ret;
}
#endif
#else
static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
                                   PyFrameObject** frame,
                                   PyThreadState* tstate,
                                   const char *funcname,
                                   const char *srcfile,
                                   int firstlineno,
                                   int skip_event) {
    if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
        int needs_new_code_obj = (*code == NULL);
        if (needs_new_code_obj) {
            *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
            if (*code == NULL) return 0;
        }
        *frame = PyFrame_New(
            tstate,                          /*PyThreadState *tstate*/
            *code,                           /*PyCodeObject *code*/
            __pyx_mstate_global->__pyx_d,    /*PyObject *globals*/
            0                                /*PyObject *locals*/
        );
        if (needs_new_code_obj && !CYTHON_PROFILE_REUSE_CODEOBJ)
            Py_CLEAR(*code); // otherwise the reference is owned externally
        if (*frame == NULL) return 0;
        if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
            Py_INCREF(Py_None);
            (*frame)->f_trace = Py_None;
        }
    }
    if (!skip_event) {
        PyObject *type, *value, *traceback;
        int retval = 1;
        __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
        __Pyx_EnterTracing(tstate);
        __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
        #if CYTHON_TRACE
        if (tstate->c_tracefunc)
            retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
        if (retval && tstate->c_profilefunc)
        #endif
            retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
        __Pyx_LeaveTracing(tstate);
        if (unlikely(!retval)) {
            Py_XDECREF(type);
            Py_XDECREF(value);
            Py_XDECREF(traceback);
            return -1;
        }
        __Pyx_ErrRestoreInState(tstate, type, value, traceback);
    }
    return __Pyx_IsTracing(tstate, 0, 0);
}
#endif
#endif

/* PyObjectFastCallMethod */
#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf) {
    PyObject *result;
    PyObject *attr = PyObject_GetAttr(args[0], name);
    if (unlikely(!attr))
        return NULL;
    result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1);
    Py_DECREF(attr);
    return result;
}
#endif

/* ExtTypeTest */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    __Pyx_TypeName obj_type_name;
    __Pyx_TypeName type_name;
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(__Pyx_TypeCheck(obj, type)))
        return 1;
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    type_name = __Pyx_PyType_GetFullyQualifiedName(type);
    PyErr_Format(PyExc_TypeError,
                 "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME,
                 obj_type_name, type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    __Pyx_DECREF_TypeName(type_name);
    return 0;
}

/* PyDictVersioning */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
    PyObject **dictptr = NULL;
    Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
    if (offset) {
#if CYTHON_COMPILING_IN_CPYTHON
        dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
#else
        dictptr = _PyObject_GetDictPtr(obj);
#endif
    }
    return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
}
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
        return 0;
    return obj_dict_version == __Pyx_get_object_dict_version(obj);
}
#endif

/* GetModuleGlobalName */
#if CYTHON_USE_DICT_VERSIONS
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
#else
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
#endif
{
    PyObject *result;
#if CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(!__pyx_m)) {
        if (!PyErr_Occurred())
            PyErr_SetNone(PyExc_NameError);
        return NULL;
    }
    result = PyObject_GetAttr(__pyx_m, name);
    if (likely(result)) {
        return result;
    }
    PyErr_Clear();
#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) PyErr_Clear();
    __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return result;
    }
#else
    result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

/* PyObjectVectorCallKwBuilder */
#if CYTHON_VECTORCALL
static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    (void)__Pyx_PyObject_FastCallDict;
    if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1;
    Py_INCREF(key);
    args[n] = value;
    return 0;
}
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    (void)__Pyx_VectorcallBuilder_AddArgStr;
    if (unlikely(!PyUnicode_Check(key))) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        return -1;
    }
    return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n);
}
static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    PyObject *pyKey = PyUnicode_FromString(key);
    if (!pyKey) return -1;
    return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n);
}
#else // CYTHON_VECTORCALL
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) {
    if (unlikely(!PyUnicode_Check(key))) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        return -1;
    }
    return PyDict_SetItem(builder, key, value);
}
#endif

/* PyObjectVectorCallMethodKwBuilder */
#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
    PyObject *result;
    PyObject *obj = PyObject_GetAttr(args[0], name);
    if (unlikely(!obj))
        return NULL;
    result = __Pyx_Object_Vectorcall_CallFromBuilder(obj, args+1, nargsf-1, kwnames);
    Py_DECREF(obj);
    return result;
}
#endif

/* IsLittleEndian */
static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
{
  union {
    uint32_t u32;
    uint8_t u8[4];
  } S;
  S.u32 = 0x01020304;
  return S.u8[0] == 4;
}

/* BufferFormatCheck */
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
                              __Pyx_BufFmt_StackElem* stack,
                              const __Pyx_TypeInfo* type) {
  stack[0].field = &ctx->root;
  stack[0].parent_offset = 0;
  ctx->root.type = type;
  ctx->root.name = "buffer dtype";
  ctx->root.offset = 0;
  ctx->head = stack;
  ctx->head->field = &ctx->root;
  ctx->fmt_offset = 0;
  ctx->head->parent_offset = 0;
  ctx->new_packmode = '@';
  ctx->enc_packmode = '@';
  ctx->new_count = 1;
  ctx->enc_count = 0;
  ctx->enc_type = 0;
  ctx->is_complex = 0;
  ctx->is_valid_array = 0;
  ctx->struct_alignment = 0;
  while (type->typegroup == 'S') {
    ++ctx->head;
    ctx->head->field = type->fields;
    ctx->head->parent_offset = 0;
    type = type->fields->type;
  }
}
static int __Pyx_BufFmt_ParseNumber(const char** ts) {
    int count;
    const char* t = *ts;
    if (*t < '0' || *t > '9') {
      return -1;
    } else {
        count = *t++ - '0';
        while (*t >= '0' && *t <= '9') {
            count *= 10;
            count += *t++ - '0';
        }
    }
    *ts = t;
    return count;
}
static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
    int number = __Pyx_BufFmt_ParseNumber(ts);
    if (number == -1)
        PyErr_Format(PyExc_ValueError,\
                     "Does not understand character buffer dtype format string ('%c')", **ts);
    return number;
}
static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
  PyErr_Format(PyExc_ValueError,
               "Unexpected format string character: '%c'", ch);
}
static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
  switch (ch) {
    case '?': return "'bool'";
    case 'c': return "'char'";
    case 'b': return "'signed char'";
    case 'B': return "'unsigned char'";
    case 'h': return "'short'";
    case 'H': return "'unsigned short'";
    case 'i': return "'int'";
    case 'I': return "'unsigned int'";
    case 'l': return "'long'";
    case 'L': return "'unsigned long'";
    case 'q': return "'long long'";
    case 'Q': return "'unsigned long long'";
    case 'f': return (is_complex ? "'complex float'" : "'float'");
    case 'd': return (is_complex ? "'complex double'" : "'double'");
    case 'g': return (is_complex ? "'complex long double'" : "'long double'");
    case 'T': return "a struct";
    case 'O': return "Python object";
    case 'P': return "a pointer";
    case 's': case 'p': return "a string";
    case 0: return "end";
    default: return "unparsable format string";
  }
}
static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return 2;
    case 'i': case 'I': case 'l': case 'L': return 4;
    case 'q': case 'Q': return 8;
    case 'f': return (is_complex ? 8 : 4);
    case 'd': return (is_complex ? 16 : 8);
    case 'g': {
      PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
      return 0;
    }
    case 'O': case 'P': return sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(short);
    case 'i': case 'I': return sizeof(int);
    case 'l': case 'L': return sizeof(long);
    #ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(PY_LONG_LONG);
    #endif
    case 'f': return sizeof(float) * (is_complex ? 2 : 1);
    case 'd': return sizeof(double) * (is_complex ? 2 : 1);
    case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
    case 'O': case 'P': return sizeof(void*);
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}
typedef struct { char c; short x; } __Pyx_st_short;
typedef struct { char c; int x; } __Pyx_st_int;
typedef struct { char c; long x; } __Pyx_st_long;
typedef struct { char c; float x; } __Pyx_st_float;
typedef struct { char c; double x; } __Pyx_st_double;
typedef struct { char c; long double x; } __Pyx_st_longdouble;
typedef struct { char c; void *x; } __Pyx_st_void_p;
#ifdef HAVE_LONG_LONG
typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
#endif
static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, int is_complex) {
  CYTHON_UNUSED_VAR(is_complex);
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
#ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
#endif
    case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
/* These are for computing the padding at the end of the struct to align
   on the first member of the struct. This will probably the same as above,
   but we don't have any guarantees.
 */
typedef struct { short x; char c; } __Pyx_pad_short;
typedef struct { int x; char c; } __Pyx_pad_int;
typedef struct { long x; char c; } __Pyx_pad_long;
typedef struct { float x; char c; } __Pyx_pad_float;
typedef struct { double x; char c; } __Pyx_pad_double;
typedef struct { long double x; char c; } __Pyx_pad_longdouble;
typedef struct { void *x; char c; } __Pyx_pad_void_p;
#ifdef HAVE_LONG_LONG
typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
#endif
static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, int is_complex) {
  CYTHON_UNUSED_VAR(is_complex);
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
#ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
#endif
    case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
  switch (ch) {
    case 'c':
        return 'H';
    case 'b': case 'h': case 'i':
    case 'l': case 'q': case 's': case 'p':
        return 'I';
    case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
        return 'U';
    case 'f': case 'd': case 'g':
        return (is_complex ? 'C' : 'R');
    case 'O':
        return 'O';
    case 'P':
        return 'P';
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}
static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
    const char* expected;
    const char* quote;
    if (ctx->head == NULL) {
      expected = "end";
      quote = "";
    } else {
      expected = ctx->head->field->type->name;
      quote = "'";
    }
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected %s%s%s but got %s",
                 quote, expected, quote,
                 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
  } else {
    const __Pyx_StructField* field = ctx->head->field;
    const __Pyx_StructField* parent = (ctx->head - 1)->field;
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
                 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
                 parent->type->name, field->name);
  }
}
static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
  char group;
  size_t size, offset, arraysize = 1;
  if (ctx->enc_type == 0) return 0;
  if (ctx->head->field->type->arraysize[0]) {
    int i, ndim = 0;
    if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
        ctx->is_valid_array = ctx->head->field->type->ndim == 1;
        ndim = 1;
        if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
            PyErr_Format(PyExc_ValueError,
                         "Expected a dimension of size %zu, got %zu",
                         ctx->head->field->type->arraysize[0], ctx->enc_count);
            return -1;
        }
    }
    if (!ctx->is_valid_array) {
      PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
                   ctx->head->field->type->ndim, ndim);
      return -1;
    }
    for (i = 0; i < ctx->head->field->type->ndim; i++) {
      arraysize *= ctx->head->field->type->arraysize[i];
    }
    ctx->is_valid_array = 0;
    ctx->enc_count = 1;
  }
  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
  do {
    const __Pyx_StructField* field = ctx->head->field;
    const __Pyx_TypeInfo* type = field->type;
    if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
      size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
    } else {
      size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
    }
    if (ctx->enc_packmode == '@') {
      size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
      size_t align_mod_offset;
      if (align_at == 0) return -1;
      align_mod_offset = ctx->fmt_offset % align_at;
      if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
      if (ctx->struct_alignment == 0)
          ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
                                                                 ctx->is_complex);
    }
    if (type->size != size || type->typegroup != group) {
      if (type->typegroup == 'C' && type->fields != NULL) {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        ++ctx->head;
        ctx->head->field = type->fields;
        ctx->head->parent_offset = parent_offset;
        continue;
      }
      if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
      } else {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return -1;
      }
    }
    offset = ctx->head->parent_offset + field->offset;
    if (ctx->fmt_offset != offset) {
      PyErr_Format(PyExc_ValueError,
                   "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
                   (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
      return -1;
    }
    ctx->fmt_offset += size;
    if (arraysize)
      ctx->fmt_offset += (arraysize - 1) * size;
    --ctx->enc_count;
    while (1) {
      if (field == &ctx->root) {
        ctx->head = NULL;
        if (ctx->enc_count != 0) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return -1;
        }
        break;
      }
      ctx->head->field = ++field;
      if (field->type == NULL) {
        --ctx->head;
        field = ctx->head->field;
        continue;
      } else if (field->type->typegroup == 'S') {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        if (field->type->fields->type == NULL) continue;
        field = field->type->fields;
        ++ctx->head;
        ctx->head->field = field;
        ctx->head->parent_offset = parent_offset;
        break;
      } else {
        break;
      }
    }
  } while (ctx->enc_count);
  ctx->enc_type = 0;
  ctx->is_complex = 0;
  return 0;
}
static int
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
{
    const char *ts = *tsp;
    int i = 0, number, ndim;
    ++ts;
    if (ctx->new_count != 1) {
        PyErr_SetString(PyExc_ValueError,
                        "Cannot handle repeated arrays in format string");
        return -1;
    }
    if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return -1;
    ndim = ctx->head->field->type->ndim;
    while (*ts && *ts != ')') {
        switch (*ts) {
            case ' ': case '\f': case '\r': case '\n': case '\t': case '\v':  continue;
            default:  break;
        }
        number = __Pyx_BufFmt_ExpectNumber(&ts);
        if (number == -1) return -1;
        if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) {
            PyErr_Format(PyExc_ValueError,
                        "Expected a dimension of size %zu, got %d",
                        ctx->head->field->type->arraysize[i], number);
            return -1;
        }
        if (*ts != ',' && *ts != ')') {
            PyErr_Format(PyExc_ValueError,
                                "Expected a comma in format string, got '%c'", *ts);
            return -1;
        }
        if (*ts == ',') ts++;
        i++;
    }
    if (i != ndim) {
        PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
                            ctx->head->field->type->ndim, i);
        return -1;
    }
    if (!*ts) {
        PyErr_SetString(PyExc_ValueError,
                        "Unexpected end of format string, expected ')'");
        return -1;
    }
    ctx->is_valid_array = 1;
    ctx->new_count = 1;
    *tsp = ++ts;
    return 0;
}
static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
  int got_Z = 0;
  while (1) {
    switch(*ts) {
      case 0:
        if (ctx->enc_type != 0 && ctx->head == NULL) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return NULL;
        }
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        if (ctx->head != NULL) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return NULL;
        }
        return ts;
      case ' ':
      case '\r':
      case '\n':
        ++ts;
        break;
      case '<':
        if (!__Pyx_Is_Little_Endian()) {
          PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '>':
      case '!':
        if (__Pyx_Is_Little_Endian()) {
          PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '=':
      case '@':
      case '^':
        ctx->new_packmode = *ts++;
        break;
      case 'T':
        {
          const char* ts_after_sub;
          size_t i, struct_count = ctx->new_count;
          size_t struct_alignment = ctx->struct_alignment;
          ctx->new_count = 1;
          ++ts;
          if (*ts != '{') {
            PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
            return NULL;
          }
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_type = 0;
          ctx->enc_count = 0;
          ctx->struct_alignment = 0;
          ++ts;
          ts_after_sub = ts;
          for (i = 0; i != struct_count; ++i) {
            ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
            if (!ts_after_sub) return NULL;
          }
          ts = ts_after_sub;
          if (struct_alignment) ctx->struct_alignment = struct_alignment;
        }
        break;
      case '}':
        {
          size_t alignment = ctx->struct_alignment;
          ++ts;
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_type = 0;
          if (alignment && ctx->fmt_offset % alignment) {
            ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
          }
        }
        return ts;
      case 'x':
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        ctx->fmt_offset += ctx->new_count;
        ctx->new_count = 1;
        ctx->enc_count = 0;
        ctx->enc_type = 0;
        ctx->enc_packmode = ctx->new_packmode;
        ++ts;
        break;
      case 'Z':
        got_Z = 1;
        ++ts;
        if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
          __Pyx_BufFmt_RaiseUnexpectedChar('Z');
          return NULL;
        }
        CYTHON_FALLTHROUGH;
      case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
      case 'l': case 'L': case 'q': case 'Q':
      case 'f': case 'd': case 'g':
      case 'O': case 'p':
        if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
            (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
          ctx->enc_count += ctx->new_count;
          ctx->new_count = 1;
          got_Z = 0;
          ++ts;
          break;
        }
        CYTHON_FALLTHROUGH;
      case 's':
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        ctx->enc_count = ctx->new_count;
        ctx->enc_packmode = ctx->new_packmode;
        ctx->enc_type = *ts;
        ctx->is_complex = got_Z;
        ++ts;
        ctx->new_count = 1;
        got_Z = 0;
        break;
      case ':':
        ++ts;
        while(*ts != ':') ++ts;
        ++ts;
        break;
      case '(':
        if (__pyx_buffmt_parse_array(ctx, &ts) < 0) return NULL;
        break;
      default:
        {
          int number = __Pyx_BufFmt_ExpectNumber(&ts);
          if (number == -1) return NULL;
          ctx->new_count = (size_t)number;
        }
    }
  }
}

/* BufferGetAndValidate */
  static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
  if (unlikely(info->buf == NULL)) return;
  if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
  PyBuffer_Release(info);
}
static void __Pyx_ZeroBuffer(Py_buffer* buf) {
  buf->buf = NULL;
  buf->obj = NULL;
  buf->strides = __Pyx_zeros;
  buf->shape = __Pyx_zeros;
  buf->suboffsets = __Pyx_minusones;
}
static int __Pyx__GetBufferAndValidate(
        Py_buffer* buf, PyObject* obj,  const __Pyx_TypeInfo* dtype, int flags,
        int nd, int cast, __Pyx_BufFmt_StackElem* stack)
{
  buf->buf = NULL;
  if (unlikely(PyObject_GetBuffer(obj, buf, flags) == -1)) {
    __Pyx_ZeroBuffer(buf);
    return -1;
  }
  if (unlikely(buf->ndim != nd)) {
    PyErr_Format(PyExc_ValueError,
                 "Buffer has wrong number of dimensions (expected %d, got %d)",
                 nd, buf->ndim);
    goto fail;
  }
  if (!cast) {
    __Pyx_BufFmt_Context ctx;
    __Pyx_BufFmt_Init(&ctx, stack, dtype);
    if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
  }
  if (unlikely((size_t)buf->itemsize != dtype->size)) {
    PyErr_Format(PyExc_ValueError,
      "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
      buf->itemsize, (buf->itemsize > 1) ? "s" : "",
      dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
    goto fail;
  }
  if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
  return 0;
fail:;
  __Pyx_SafeReleaseBuffer(buf);
  return -1;
}

/* TupleAndListFromArray */
  #if !CYTHON_COMPILING_IN_CPYTHON && CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    Py_ssize_t i;
    if (n <= 0) {
        return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
    }
    res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    for (i = 0; i < n; i++) {
        if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < 0)) {
            Py_DECREF(res);
            return NULL;
        }
        Py_INCREF(src[i]);
    }
    return res;
}
#elif CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
    PyObject *v;
    Py_ssize_t i;
    for (i = 0; i < length; i++) {
        v = dest[i] = src[i];
        Py_INCREF(v);
    }
}
static CYTHON_INLINE PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
    }
    res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
    return res;
}
static CYTHON_INLINE PyObject *
__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        return PyList_New(0);
    }
    res = PyList_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
    return res;
}
#endif

/* BytesEquals */
  static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\
        !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS)
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result;
#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
            Py_hash_t hash1, hash2;
            hash1 = ((PyBytesObject*)s1)->ob_shash;
            hash2 = ((PyBytesObject*)s2)->ob_shash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                return (equals == Py_NE);
            }
#endif
            result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

/* UnicodeEquals */
  static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length, length2;
        int kind;
        void *data1, *data2;
        #if !CYTHON_COMPILING_IN_LIMITED_API
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        #endif
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(length < 0)) return -1;
        #endif
        length2 = __Pyx_PyUnicode_GET_LENGTH(s2);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(length2 < 0)) return -1;
        #endif
        if (length != length2) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                goto return_ne;
            }
        }
#endif
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    return (equals == Py_EQ);
return_ne:
    return (equals == Py_NE);
#endif
}

/* fastcall */
  #if CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
{
    Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames);
    #if !CYTHON_ASSUME_SAFE_SIZE
    if (unlikely(n == -1)) return NULL;
    #endif
    for (i = 0; i < n; i++)
    {
        PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!namei)) return NULL;
        #endif
        if (s == namei) return kwvalues[i];
    }
    for (i = 0; i < n; i++)
    {
        PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!namei)) return NULL;
        #endif
        int eq = __Pyx_PyUnicode_Equals(s, namei, Py_EQ);
        if (unlikely(eq != 0)) {
            if (unlikely(eq < 0)) return NULL;
            return kwvalues[i];
        }
    }
    return NULL;
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
    Py_ssize_t i, nkwargs;
    PyObject *dict;
#if !CYTHON_ASSUME_SAFE_SIZE
    nkwargs = PyTuple_Size(kwnames);
    if (unlikely(nkwargs < 0)) return NULL;
#else
    nkwargs = PyTuple_GET_SIZE(kwnames);
#endif
    dict = PyDict_New();
    if (unlikely(!dict))
        return NULL;
    for (i=0; i<nkwargs; i++) {
#if !CYTHON_ASSUME_SAFE_MACROS
        PyObject *key = PyTuple_GetItem(kwnames, i);
        if (!key) goto bad;
#else
        PyObject *key = PyTuple_GET_ITEM(kwnames, i);
#endif
        if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
            goto bad;
    }
    return dict;
bad:
    Py_DECREF(dict);
    return NULL;
}
#endif
#endif

/* RaiseDoubleKeywords */
  static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
}

/* UnpackUnboundCMethod */
  #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
    PyObject *result;
    PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
    if (unlikely(!selfless_args)) return NULL;
    result = PyObject_Call(method, selfless_args, kwargs);
    Py_DECREF(selfless_args);
    return result;
}
#elif CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) {
        return _PyObject_Vectorcall
            (method, args ? args+1 : NULL, nargs ? nargs-1 : 0, kwnames);
}
#else
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) {
    return
#if PY_VERSION_HEX < 0x03090000
    _PyObject_Vectorcall
#else
    PyObject_Vectorcall
#endif
        (method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames);
}
#endif
static PyMethodDef __Pyx_UnboundCMethod_Def = {
     "CythonUnboundCMethod",
     __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
     METH_VARARGS | METH_KEYWORDS,
#else
     METH_FASTCALL | METH_KEYWORDS,
#endif
     NULL
};
static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method, *result=NULL;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    result = method;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
        target->func = descr->d_method->ml_meth;
        target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS);
    } else
#endif
#if CYTHON_COMPILING_IN_PYPY
#else
    if (PyCFunction_Check(method))
#endif
    {
        PyObject *self;
        int self_found;
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        self = PyObject_GetAttrString(method, "__self__");
        if (!self) {
            PyErr_Clear();
        }
#else
        self = PyCFunction_GET_SELF(method);
#endif
        self_found = (self && self != Py_None);
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        Py_XDECREF(self);
#endif
        if (self_found) {
            PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
            if (unlikely(!unbound_method)) return -1;
            Py_DECREF(method);
            result = unbound_method;
        }
    }
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    if (unlikely(target->method)) {
        Py_DECREF(result);
    } else
#endif
    target->method = result;
    return 0;
}

/* CallUnboundCMethod2 */
  #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
    int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
    if (likely(was_initialized == 2 && cfunc->func)) {
        PyObject *args[2] = {arg1, arg2};
        if (cfunc->flag == METH_FASTCALL) {
            return __Pyx_CallCFunctionFast(cfunc, self, args, 2);
        }
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL);
    }
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    else if (unlikely(was_initialized == 1)) {
        __Pyx_CachedCFunction tmp_cfunc = {
#ifndef __cplusplus
            0
#endif
        };
        tmp_cfunc.type = cfunc->type;
        tmp_cfunc.method_name = cfunc->method_name;
        return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2);
    }
#endif
    PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
    __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
    return result;
}
#endif
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        PyObject *result = NULL;
        PyObject *args = PyTuple_New(2);
        if (unlikely(!args)) return NULL;
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 0, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 1, arg2);
        if (cfunc->flag & METH_KEYWORDS)
            result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
        else
            result = __Pyx_CallCFunction(cfunc, self, args);
        Py_DECREF(args);
        return result;
    }
#endif
    {
        PyObject *args[4] = {NULL, self, arg1, arg2};
        return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
    }
}

/* ParseKeywords */
  static int __Pyx_ValidateDuplicatePosArgs(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    const char* function_name)
{
    PyObject ** const *name = argnames;
    while (name != first_kw_arg) {
        PyObject *key = **name;
        int found = PyDict_Contains(kwds, key);
        if (unlikely(found)) {
            if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key);
            goto bad;
        }
        name++;
    }
    return 0;
bad:
    return -1;
}
#if CYTHON_USE_UNICODE_INTERNALS
static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) {
    int kind;
    Py_ssize_t len = PyUnicode_GET_LENGTH(s1);
    if (len != PyUnicode_GET_LENGTH(s2)) return 0;
    kind = PyUnicode_KIND(s1);
    if (kind != PyUnicode_KIND(s2)) return 0;
    const void *data1 = PyUnicode_DATA(s1);
    const void *data2 = PyUnicode_DATA(s2);
    return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0);
}
#endif
static int __Pyx_MatchKeywordArg_str(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    PyObject ** const *name;
    #if CYTHON_USE_UNICODE_INTERNALS
    Py_hash_t key_hash = ((PyASCIIObject*)key)->hash;
    if (unlikely(key_hash == -1)) {
        key_hash = PyObject_Hash(key);
        if (unlikely(key_hash == -1))
            goto bad;
    }
    #endif
    name = first_kw_arg;
    while (*name) {
        PyObject *name_str = **name;
        #if CYTHON_USE_UNICODE_INTERNALS
        if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) {
            *index_found = (size_t) (name - argnames);
            return 1;
        }
        #else
        #if CYTHON_ASSUME_SAFE_SIZE
        if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
        #endif
        {
            int cmp = PyUnicode_Compare(name_str, key);
            if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
            if (cmp == 0) {
                *index_found = (size_t) (name - argnames);
                return 1;
            }
        }
        #endif
        name++;
    }
    name = argnames;
    while (name != first_kw_arg) {
        PyObject *name_str = **name;
        #if CYTHON_USE_UNICODE_INTERNALS
        if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) {
            if (__Pyx_UnicodeKeywordsEqual(name_str, key))
                goto arg_passed_twice;
        }
        #else
        #if CYTHON_ASSUME_SAFE_SIZE
        if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
        #endif
        {
            if (unlikely(name_str == key)) goto arg_passed_twice;
            int cmp = PyUnicode_Compare(name_str, key);
            if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
            if (cmp == 0) goto arg_passed_twice;
        }
        #endif
        name++;
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
bad:
    return -1;
}
static int __Pyx_MatchKeywordArg_nostr(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    PyObject ** const *name;
    if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type;
    name = first_kw_arg;
    while (*name) {
        int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
        if (cmp == 1) {
            *index_found = (size_t) (name - argnames);
            return 1;
        }
        if (unlikely(cmp == -1)) goto bad;
        name++;
    }
    name = argnames;
    while (name != first_kw_arg) {
        int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
        if (unlikely(cmp != 0)) {
            if (cmp == 1) goto arg_passed_twice;
            else goto bad;
        }
        name++;
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
bad:
    return -1;
}
static CYTHON_INLINE int __Pyx_MatchKeywordArg(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    return likely(PyUnicode_CheckExact(key)) ?
        __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) :
        __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name);
}
static void __Pyx_RejectUnknownKeyword(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    const char *function_name)
{
    Py_ssize_t pos = 0;
    PyObject *key = NULL;
    __Pyx_BEGIN_CRITICAL_SECTION(kwds);
    while (PyDict_Next(kwds, &pos, &key, NULL)) {
        PyObject** const *name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (!*name) {
            #if CYTHON_AVOID_BORROWED_REFS
            Py_INCREF(key);
            #endif
            size_t index_found = 0;
            int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
            if (cmp != 1) {
                if (cmp == 0) {
                    PyErr_Format(PyExc_TypeError,
                        "%s() got an unexpected keyword argument '%U'",
                        function_name, key);
                }
                #if CYTHON_AVOID_BORROWED_REFS
                Py_DECREF(key);
                #endif
                break;
            }
            #if CYTHON_AVOID_BORROWED_REFS
            Py_DECREF(key);
            #endif
        }
    }
    __Pyx_END_CRITICAL_SECTION();
    assert(PyErr_Occurred());
}
static int __Pyx_ParseKeywordDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    PyObject** const *name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    Py_ssize_t extracted = 0;
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
    if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
#endif
    name = first_kw_arg;
    while (*name && num_kwargs > extracted) {
        PyObject * key = **name;
        PyObject *value;
        int found = 0;
        #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
        found = PyDict_GetItemRef(kwds, key, &value);
        #else
        value = PyDict_GetItemWithError(kwds, key);
        if (value) {
            Py_INCREF(value);
            found = 1;
        } else {
            if (unlikely(PyErr_Occurred())) goto bad;
        }
        #endif
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
            extracted++;
        }
        name++;
    }
    if (num_kwargs > extracted) {
        if (ignore_unknown_kwargs) {
            if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1))
                goto bad;
        } else {
            __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name);
            goto bad;
        }
    }
    return 0;
bad:
    return -1;
}
static int __Pyx_ParseKeywordDictToDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject** const *name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    Py_ssize_t len;
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
    if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
#endif
    if (PyDict_Update(kwds2, kwds) < 0) goto bad;
    name = first_kw_arg;
    while (*name) {
        PyObject *key = **name;
        PyObject *value;
#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop))
        int found = PyDict_Pop(kwds2, key, &value);
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
        }
#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
        int found = PyDict_GetItemRef(kwds2, key, &value);
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
            if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad;
        }
#else
    #if CYTHON_COMPILING_IN_CPYTHON
        value = _PyDict_Pop(kwds2, key, kwds2);
    #else
        value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2);
    #endif
        if (value == kwds2) {
            Py_DECREF(value);
        } else {
            if (unlikely(!value)) goto bad;
            values[name-argnames] = value;
        }
#endif
        name++;
    }
    len = PyDict_Size(kwds2);
    if (len > 0) {
        return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name);
    } else if (unlikely(len == -1)) {
        goto bad;
    }
    return 0;
bad:
    return -1;
}
static int __Pyx_ParseKeywordsTuple(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    PyObject *key = NULL;
    PyObject** const * name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) {
#if CYTHON_AVOID_BORROWED_REFS
        key = __Pyx_PySequence_ITEM(kwds, pos);
#else
        key = __Pyx_PyTuple_GET_ITEM(kwds, pos);
#endif
#if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!key)) goto bad;
#endif
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            PyObject *value = kwvalues[pos];
            values[name-argnames] = __Pyx_NewRef(value);
        } else {
            size_t index_found = 0;
            int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
            if (cmp == 1) {
                PyObject *value = kwvalues[pos];
                values[index_found] = __Pyx_NewRef(value);
            } else {
                if (unlikely(cmp == -1)) goto bad;
                if (kwds2) {
                    PyObject *value = kwvalues[pos];
                    if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
                } else if (!ignore_unknown_kwargs) {
                    goto invalid_keyword;
                }
            }
        }
        #if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(key);
        key = NULL;
        #endif
    }
    return 0;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    goto bad;
bad:
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(key);
    #endif
    return -1;
}
static int __Pyx_ParseKeywords(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)))
        return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
    else if (kwds2)
        return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name);
    else
        return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
}

/* RaiseArgTupleInvalid */
  static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* RaiseUnboundLocalError */
  static void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* GetItemInt */
  static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (unlikely(!j)) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS && !CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyTuple_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
            return __Pyx_PyList_GetItemRef(o, n);
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
        PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
        if (mm && mm->mp_subscript) {
            PyObject *r, *key = PyLong_FromSsize_t(i);
            if (unlikely(!key)) return NULL;
            r = mm->mp_subscript(o, key);
            Py_DECREF(key);
            return r;
        }
        if (likely(sm && sm->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
                Py_ssize_t l = sm->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return sm->sq_item(o, i);
        }
    }
#else
    if (is_list || !PyMapping_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
}

/* pep479 */
  static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) {
    PyObject *exc, *val, *tb, *cur_exc, *new_exc;
    __Pyx_PyThreadState_declare
    int is_async_stopiteration = 0;
    CYTHON_MAYBE_UNUSED_VAR(in_async_gen);
    __Pyx_PyThreadState_assign
    cur_exc = __Pyx_PyErr_CurrentExceptionType();
    if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) {
        if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopAsyncIteration))) {
            is_async_stopiteration = 1;
        } else {
            return;
        }
    }
    __Pyx_GetException(&exc, &val, &tb);
    Py_XDECREF(exc);
    Py_XDECREF(tb);
    new_exc = PyObject_CallFunction(PyExc_RuntimeError, "s",
        is_async_stopiteration ? "async generator raised StopAsyncIteration" :
        in_async_gen ? "async generator raised StopIteration" :
        "generator raised StopIteration");
    if (!new_exc) {
        Py_XDECREF(val);
        return;
    }
    PyException_SetCause(new_exc, val); // steals ref to val
    PyErr_SetObject(PyExc_RuntimeError, new_exc);
}

/* PyFloatBinop */
  #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyFloat_TrueDivideCObj(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) {
    const double a = floatval;
    double b, result;
    CYTHON_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    if (likely(PyFloat_CheckExact(op2))) {
        b = __Pyx_PyFloat_AS_DOUBLE(op2);
        if (unlikely(zerodivision_check && ((b) == 0.0))) { PyErr_SetString(PyExc_ZeroDivisionError, "float division by zero"); return NULL;}
    } else
    if (likely(PyLong_CheckExact(op2))) {
        #if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsZero(op2)) {
            b = 0.0;
            if (unlikely(zerodivision_check && ((b) == 0.0))) { PyErr_SetString(PyExc_ZeroDivisionError, "float division by zero"); return NULL;}
        } else if (__Pyx_PyLong_IsCompact(op2)) {
            b = (double) __Pyx_PyLong_CompactValue(op2);
        } else {
            const digit* digits = __Pyx_PyLong_Digits(op2);
            const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op2);
            switch (size) {
                case -2:
                case 2:
                    if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
                        b = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
                            if (size == -2)
                                b = -b;
                            break;
                        }
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                case 3:
                    if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
                        b = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
                            if (size == -3)
                                b = -b;
                            break;
                        }
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                case 4:
                    if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
                        b = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
                            if (size == -4)
                                b = -b;
                            break;
                        }
                    }
                    CYTHON_FALLTHROUGH;
                default:
        #endif
                    b = PyLong_AsDouble(op2);
                    if (unlikely(b == -1.0 && PyErr_Occurred())) return NULL;
                    #if !CYTHON_USE_PYLONG_INTERNALS
                    if (unlikely(zerodivision_check && ((b) == 0.0))) { PyErr_SetString(PyExc_ZeroDivisionError, "float division by zero"); return NULL;}
                    #endif
        #if CYTHON_USE_PYLONG_INTERNALS
            }
        }
        #endif
    } else {
        return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2);
    }
        result = a / b;
        return PyFloat_FromDouble(result);
}
#endif

/* RaiseUnexpectedTypeError */
  static int
__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj)
{
    __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME,
                 expected, obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* RejectKeywords */
  static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds) {
    PyObject *key = NULL;
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds))) {
        key = __Pyx_PySequence_ITEM(kwds, 0);
    } else {
        Py_ssize_t pos = 0;
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
        if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return;
#endif
        PyDict_Next(kwds, &pos, &key, NULL);
        Py_INCREF(key);
    }
    if (likely(key)) {
        PyErr_Format(PyExc_TypeError,
            "%s() got an unexpected keyword argument '%U'",
            function_name, key);
        Py_DECREF(key);
    }
}

/* CIntToDigits */
  static const char DIGIT_PAIRS_10[2*10*10+1] = {
    "00010203040506070809"
    "10111213141516171819"
    "20212223242526272829"
    "30313233343536373839"
    "40414243444546474849"
    "50515253545556575859"
    "60616263646566676869"
    "70717273747576777879"
    "80818283848586878889"
    "90919293949596979899"
};
static const char DIGIT_PAIRS_8[2*8*8+1] = {
    "0001020304050607"
    "1011121314151617"
    "2021222324252627"
    "3031323334353637"
    "4041424344454647"
    "5051525354555657"
    "6061626364656667"
    "7071727374757677"
};
static const char DIGITS_HEX[2*16+1] = {
    "0123456789abcdef"
    "0123456789ABCDEF"
};

/* BuildPyUnicode */
  static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, const char* chars, int clength,
                                                int prepend_sign, char padding_char) {
    PyObject *uval;
    Py_ssize_t uoffset = ulength - clength;
#if CYTHON_USE_UNICODE_INTERNALS
    Py_ssize_t i;
    void *udata;
    uval = PyUnicode_New(ulength, 127);
    if (unlikely(!uval)) return NULL;
    udata = PyUnicode_DATA(uval);
    if (uoffset > 0) {
        i = 0;
        if (prepend_sign) {
            __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-');
            i++;
        }
        for (; i < uoffset; i++) {
            __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
        }
    }
    for (i=0; i < clength; i++) {
        __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
    }
#else
    {
        PyObject *sign = NULL, *padding = NULL;
        uval = NULL;
        if (uoffset > 0) {
            prepend_sign = !!prepend_sign;
            if (uoffset > prepend_sign) {
                padding = PyUnicode_FromOrdinal(padding_char);
                if (likely(padding) && uoffset > prepend_sign + 1) {
                    PyObject *tmp = PySequence_Repeat(padding, uoffset - prepend_sign);
                    Py_DECREF(padding);
                    padding = tmp;
                }
                if (unlikely(!padding)) goto done_or_error;
            }
            if (prepend_sign) {
                sign = PyUnicode_FromOrdinal('-');
                if (unlikely(!sign)) goto done_or_error;
            }
        }
        uval = PyUnicode_DecodeASCII(chars, clength, NULL);
        if (likely(uval) && padding) {
            PyObject *tmp = PyUnicode_Concat(padding, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
        if (likely(uval) && sign) {
            PyObject *tmp = PyUnicode_Concat(sign, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
done_or_error:
        Py_XDECREF(padding);
        Py_XDECREF(sign);
    }
#endif
    return uval;
}

/* COrdinalToPyUnicode */
  static CYTHON_INLINE int __Pyx_CheckUnicodeValue(int value) {
    return value <= 1114111;
}
static PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(int value, Py_ssize_t ulength, char padding_char) {
    if (likely(ulength <= 250)) {
        char chars[256];
        if (value <= 255) {
            memset(chars, padding_char, (size_t) (ulength - 1));
            chars[ulength-1] = (char) value;
            return PyUnicode_DecodeLatin1(chars, ulength, NULL);
        }
        char *cpos = chars + sizeof(chars);
        if (value < 0x800) {
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0xc0 | (value & 0x1f));
        } else if (value < 0x10000) {
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0xe0 | (value & 0x0f));
        } else {
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0xf0 | (value & 0x07));
        }
        cpos -= ulength;
        memset(cpos, padding_char, (size_t) (ulength - 1));
        return PyUnicode_DecodeUTF8(cpos, chars + sizeof(chars) - cpos, NULL);
    }
    if (value <= 127 && CYTHON_USE_UNICODE_INTERNALS) {
        const char chars[1] = {(char) value};
        return __Pyx_PyUnicode_BuildFromAscii(ulength, chars, 1, 0, padding_char);
    }
    {
        PyObject *uchar, *padding_uchar, *padding, *result;
        padding_uchar = PyUnicode_FromOrdinal(padding_char);
        if (unlikely(!padding_uchar)) return NULL;
        padding = PySequence_Repeat(padding_uchar, ulength - 1);
        Py_DECREF(padding_uchar);
        if (unlikely(!padding)) return NULL;
        uchar = PyUnicode_FromOrdinal(value);
        if (unlikely(!uchar)) {
            Py_DECREF(padding);
            return NULL;
        }
        result = PyUnicode_Concat(padding, uchar);
        Py_DECREF(padding);
        Py_DECREF(uchar);
        return result;
    }
}

/* CIntToPyUnicode */
  static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(int)*3+2];
    char *dpos, *end = digits + sizeof(int)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    int remaining;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (format_char == 'c') {
        if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
                     !(sizeof(value) <= 2 || value & ~ (int) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
            PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
            return NULL;
        }
        if (width <= 1) {
            return PyUnicode_FromOrdinal((int) value);
        }
        return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
    }
    if (format_char == 'X') {
        hex_digits += 16;
        format_char = 'x';
    }
    remaining = value;
    last_one_off = 0;
    dpos = end;
    do {
        int digit_pos;
        switch (format_char) {
        case 'o':
            digit_pos = abs((int)(remaining % (8*8)));
            remaining = (int) (remaining / (8*8));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 8);
            break;
        case 'd':
            digit_pos = abs((int)(remaining % (10*10)));
            remaining = (int) (remaining / (10*10));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 10);
            break;
        case 'x':
            *(--dpos) = hex_digits[abs((int)(remaining % 16))];
            remaining = (int) (remaining / 16);
            break;
        default:
            assert(0);
            break;
        }
    } while (unlikely(remaining != 0));
    assert(!last_one_off || *dpos == '0');
    dpos += last_one_off;
    length = end - dpos;
    ulength = length;
    prepend_sign = 0;
    if (!is_unsigned && value <= neg_one) {
        if (padding_char == ' ' || width <= length + 1) {
            *(--dpos) = '-';
            ++length;
        } else {
            prepend_sign = 1;
        }
        ++ulength;
    }
    if (width > ulength) {
        ulength = width;
    }
    if (ulength == 1) {
        return PyUnicode_FromOrdinal(*dpos);
    }
    return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}

/* PyObjectFormatAndDecref */
  static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
    if (unlikely(!s)) return NULL;
    if (likely(PyUnicode_CheckExact(s))) return s;
    return __Pyx_PyObject_FormatAndDecref(s, f);
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
    PyObject *result;
    if (unlikely(!s)) return NULL;
    result = PyObject_Format(s, f);
    Py_DECREF(s);
    return result;
}

/* JoinPyUnicode */
  static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char) {
#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyObject *result_uval;
    int result_ukind, kind_shift;
    Py_ssize_t i, char_pos;
    void *result_udata;
    if (max_char > 1114111) max_char = 1114111;
    result_uval = PyUnicode_New(result_ulength, max_char);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
    kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1;
    result_udata = PyUnicode_DATA(result_uval);
    assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
    if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0))
        goto overflow;
    char_pos = 0;
    for (i=0; i < value_count; i++) {
        int ukind;
        Py_ssize_t ulength;
        void *udata;
        PyObject *uval = values[i];
        #if !CYTHON_COMPILING_IN_LIMITED_API
        if (__Pyx_PyUnicode_READY(uval) == (-1))
            goto bad;
        #endif
        ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(ulength < 0)) goto bad;
        #endif
        if (unlikely(!ulength))
            continue;
        if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
            goto overflow;
        ukind = __Pyx_PyUnicode_KIND(uval);
        udata = __Pyx_PyUnicode_DATA(uval);
        if (ukind == result_ukind) {
            memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
        } else {
            #if PY_VERSION_HEX >= 0x030d0000
            if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
            #elif CYTHON_COMPILING_IN_CPYTHON || defined(_PyUnicode_FastCopyCharacters)
            _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
            #else
            Py_ssize_t j;
            for (j=0; j < ulength; j++) {
                Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
                __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
            }
            #endif
        }
        char_pos += ulength;
    }
    return result_uval;
overflow:
    PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
bad:
    Py_DECREF(result_uval);
    return NULL;
#else
    Py_ssize_t i;
    PyObject *result = NULL;
    PyObject *value_tuple = PyTuple_New(value_count);
    if (unlikely(!value_tuple)) return NULL;
    CYTHON_UNUSED_VAR(max_char);
    CYTHON_UNUSED_VAR(result_ulength);
    for (i=0; i<value_count; i++) {
        if (__Pyx_PyTuple_SET_ITEM(value_tuple, i, values[i]) != (0)) goto bad;
        Py_INCREF(values[i]);
    }
    result = PyUnicode_Join(__pyx_mstate_global->__pyx_empty_unicode, value_tuple);
bad:
    Py_DECREF(value_tuple);
    return result;
#endif
}

/* ArgTypeTest */
  static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    __Pyx_TypeName type_name;
    __Pyx_TypeName obj_type_name;
    PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode;
    int from_annotation_subclass = 0;
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    else if (!exact) {
        if (likely(__Pyx_TypeCheck(obj, type))) return 1;
    } else if (exact == 2) {
        if (__Pyx_TypeCheck(obj, type)) {
            from_annotation_subclass = 1;
            extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately;
        }
    }
    type_name = __Pyx_PyType_GetFullyQualifiedName(type);
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME
        ", got " __Pyx_FMT_TYPENAME ")"
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
        "%s%U"
#endif
        , name, type_name, obj_type_name
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
        , (from_annotation_subclass ? ". " : ""), extra_info
#endif
        );
#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    if (exact == 2 && from_annotation_subclass) {
        PyObject *res;
        PyObject *vargs[2];
        vargs[0] = PyErr_GetRaisedException();
        vargs[1] = extra_info;
        res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL);
        Py_XDECREF(res);
        PyErr_SetRaisedException(vargs[0]);
    }
#endif
    __Pyx_DECREF_TypeName(type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* PyLongBinop */
  #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a, x;
#ifdef HAVE_LONG_LONG
    const PY_LONG_LONG llb = intval;
    PY_LONG_LONG lla, llx;
#endif
    if (unlikely(__Pyx_PyLong_IsZero(op1))) {
        return __Pyx_NewRef(op2);
    }
    if (likely(__Pyx_PyLong_IsCompact(op1))) {
        a = __Pyx_PyLong_CompactValue(op1);
    } else {
        const digit* digits = __Pyx_PyLong_Digits(op1);
        const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
        switch (size) {
            case -2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                    lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case -3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                    a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                    lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                    a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case -4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                    a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                    lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                    a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
        }
    }
            x = a + b;
        return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
    long_long:
            llx = lla + llb;
        return PyLong_FromLongLong(llx);
#endif
    return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace);
    
    
}
#endif
static PyObject* __Pyx_Float___Pyx_PyLong_AddObjC(PyObject *float_val, long intval, int zerodivision_check) {
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    double a = __Pyx_PyFloat_AS_DOUBLE(float_val);
        double result;
        
        result = ((double)a) + (double)b;
        return PyFloat_FromDouble(result);
}
static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        return __Pyx_Float___Pyx_PyLong_AddObjC(op1, intval, zerodivision_check);
    }
    return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace);
}
#endif

/* PyObjectCallOneArg */
  static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *args[2] = {NULL, arg};
    return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* ObjectGetItem */
  #if CYTHON_USE_TYPE_SLOTS
static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
    PyObject *runerr = NULL;
    Py_ssize_t key_value;
    key_value = __Pyx_PyIndex_AsSsize_t(index);
    if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
        return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
    }
    if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
        __Pyx_TypeName index_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(index));
        PyErr_Clear();
        PyErr_Format(PyExc_IndexError,
            "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name);
        __Pyx_DECREF_TypeName(index_type_name);
    }
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
    __Pyx_TypeName obj_type_name;
    if (likely(PyType_Check(obj))) {
        PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_mstate_global->__pyx_n_u_class_getitem);
        if (!meth) {
            PyErr_Clear();
        } else {
            PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
            Py_DECREF(meth);
            return result;
        }
    }
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
    PyTypeObject *tp = Py_TYPE(obj);
    PyMappingMethods *mm = tp->tp_as_mapping;
    PySequenceMethods *sm = tp->tp_as_sequence;
    if (likely(mm && mm->mp_subscript)) {
        return mm->mp_subscript(obj, key);
    }
    if (likely(sm && sm->sq_item)) {
        return __Pyx_PyObject_GetIndex(obj, key);
    }
    return __Pyx_PyObject_GetItem_Slow(obj, key);
}
#endif

/* DivInt[long] */
  static CYTHON_INLINE long __Pyx_div_long(long a, long b, int b_is_constant) {
    long q = a / b;
    long r = a - q*b;
    long adapt_python = (b_is_constant ?
        ((r != 0) & ((r < 0) ^ (b < 0))) :
        ((r != 0) & ((r ^ b) < 0))
    );
    return q - adapt_python;
}

/* SliceObject */
  static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
        Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
    __Pyx_TypeName obj_type_name;
#if CYTHON_USE_TYPE_SLOTS
    PyMappingMethods* mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_subscript))
#endif
    {
        PyObject* result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyLong_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyLong_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_USE_TYPE_SLOTS
        result = mp->mp_subscript(obj, py_slice);
#else
        result = PyObject_GetItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
bad:
    return NULL;
}

/* SetItemInt */
  static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
    int r;
    if (unlikely(!j)) return -1;
    r = PyObject_SetItem(o, j, v);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
                                               CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
            Py_INCREF(v);
#if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
            PyList_SetItem(o, n, v);
#else
            PyObject* old = PyList_GET_ITEM(o, n);
            PyList_SET_ITEM(o, n, v);
            Py_DECREF(old);
#endif
            return 1;
        }
    } else {
        PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
        PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
        if (mm && mm->mp_ass_subscript) {
            int r;
            PyObject *key = PyLong_FromSsize_t(i);
            if (unlikely(!key)) return -1;
            r = mm->mp_ass_subscript(o, key, v);
            Py_DECREF(key);
            return r;
        }
        if (likely(sm && sm->sq_ass_item)) {
            if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
                Py_ssize_t l = sm->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return -1;
                    PyErr_Clear();
                }
            }
            return sm->sq_ass_item(o, i, v);
        }
    }
#else
    if (is_list || !PyMapping_Check(o))
    {
        return PySequence_SetItem(o, i, v);
    }
#endif
    return __Pyx_SetItemInt_Generic(o, PyLong_FromSsize_t(i), v);
}

/* PyLongBinop */
  #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a, x;
#ifdef HAVE_LONG_LONG
    const PY_LONG_LONG llb = intval;
    PY_LONG_LONG lla, llx;
#endif
    if (unlikely(__Pyx_PyLong_IsZero(op1))) {
        return PyLong_FromLong(-intval);
    }
    if (likely(__Pyx_PyLong_IsCompact(op1))) {
        a = __Pyx_PyLong_CompactValue(op1);
    } else {
        const digit* digits = __Pyx_PyLong_Digits(op1);
        const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
        switch (size) {
            case -2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                    lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case -3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                    a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                    lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                    a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case -4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                    a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                    lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                    a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
        }
    }
            x = a - b;
        return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
    long_long:
            llx = lla - llb;
        return PyLong_FromLongLong(llx);
#endif
    return __Pyx_Fallback___Pyx_PyLong_SubtractObjC(op1, op2, inplace);
    
    
}
#endif
static PyObject* __Pyx_Float___Pyx_PyLong_SubtractObjC(PyObject *float_val, long intval, int zerodivision_check) {
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    double a = __Pyx_PyFloat_AS_DOUBLE(float_val);
        double result;
        
        result = ((double)a) - (double)b;
        return PyFloat_FromDouble(result);
}
static CYTHON_INLINE PyObject* __Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_SubtractObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        return __Pyx_Float___Pyx_PyLong_SubtractObjC(op1, intval, zerodivision_check);
    }
    return __Pyx_Fallback___Pyx_PyLong_SubtractObjC(op1, op2, inplace);
}
#endif

/* RaiseTooManyValuesToUnpack */
  static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* RaiseNeedMoreValuesToUnpack */
  static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* IterFinish */
  static CYTHON_INLINE int __Pyx_IterFinish(void) {
    PyObject* exc_type;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    exc_type = __Pyx_PyErr_CurrentExceptionType();
    if (unlikely(exc_type)) {
        if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
            return -1;
        __Pyx_PyErr_Clear();
        return 0;
    }
    return 0;
}

/* UnpackItemEndCheck */
  static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    }
    return __Pyx_IterFinish();
}

/* BufferFallbackError */
  static void __Pyx_RaiseBufferFallbackError(void) {
  PyErr_SetString(PyExc_ValueError,
     "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
}

/* PyLongCompare */
  static CYTHON_INLINE int __Pyx_PyLong_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(inplace);
    if (op1 == op2) {
        return 1;
    }
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
        const digit* digits = __Pyx_PyLong_Digits(op1);
        if (intval == 0) {
            return (__Pyx_PyLong_IsZero(op1) == 1);
        } else if (intval < 0) {
            if (__Pyx_PyLong_IsNonNeg(op1))
                return 0;
            intval = -intval;
        } else {
            if (__Pyx_PyLong_IsNeg(op1))
                return 0;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        return (unequal == 0);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = __Pyx_PyFloat_AS_DOUBLE(op1);
        return ((double)a == (double)b);
    }
    return __Pyx_PyObject_IsTrueAndDecref(
        PyObject_RichCompare(op1, op2, Py_EQ));
}

/* PyFloatBinop */
  #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyFloat_AddCObj(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) {
    const double a = floatval;
    double b, result;
    CYTHON_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    if (likely(PyFloat_CheckExact(op2))) {
        b = __Pyx_PyFloat_AS_DOUBLE(op2);
        
    } else
    if (likely(PyLong_CheckExact(op2))) {
        #if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsZero(op2)) {
            b = 0.0;
            
        } else if (__Pyx_PyLong_IsCompact(op2)) {
            b = (double) __Pyx_PyLong_CompactValue(op2);
        } else {
            const digit* digits = __Pyx_PyLong_Digits(op2);
            const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op2);
            switch (size) {
                case -2:
                case 2:
                    if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
                        b = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
                            if (size == -2)
                                b = -b;
                            break;
                        }
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                case 3:
                    if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
                        b = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
                            if (size == -3)
                                b = -b;
                            break;
                        }
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                case 4:
                    if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
                        b = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
                            if (size == -4)
                                b = -b;
                            break;
                        }
                    }
                    CYTHON_FALLTHROUGH;
                default:
        #endif
                    b = PyLong_AsDouble(op2);
                    if (unlikely(b == -1.0 && PyErr_Occurred())) return NULL;
        #if CYTHON_USE_PYLONG_INTERNALS
            }
        }
        #endif
    } else {
        return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
    }
        result = a + b;
        return PyFloat_FromDouble(result);
}
#endif

/* PyLongBinop */
  #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_AddCObj(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long a = intval;
    long b, x;
#ifdef HAVE_LONG_LONG
    const PY_LONG_LONG lla = intval;
    PY_LONG_LONG llb, llx;
#endif
    if (unlikely(__Pyx_PyLong_IsZero(op2))) {
        return __Pyx_NewRef(op1);
    }
    if (likely(__Pyx_PyLong_IsCompact(op2))) {
        b = __Pyx_PyLong_CompactValue(op2);
    } else {
        const digit* digits = __Pyx_PyLong_Digits(op2);
        const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op2);
        switch (size) {
            case -2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                    llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                    llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case -3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                    b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                    llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                    b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                    llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case -4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                    b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                    llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                    b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                    llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
        }
    }
            x = a + b;
        return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
    long_long:
            llx = lla + llb;
        return PyLong_FromLongLong(llx);
#endif
    return __Pyx_Fallback___Pyx_PyLong_AddCObj(op1, op2, inplace);
    
    
}
#endif
static PyObject* __Pyx_Float___Pyx_PyLong_AddCObj(PyObject *float_val, long intval, int zerodivision_check) {
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long a = intval;
    double b = __Pyx_PyFloat_AS_DOUBLE(float_val);
        double result;
        
        result = ((double)a) + (double)b;
        return PyFloat_FromDouble(result);
}
static CYTHON_INLINE PyObject* __Pyx_PyLong_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op2))) {
        return __Pyx_Unpacked___Pyx_PyLong_AddCObj(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    if (PyFloat_CheckExact(op2)) {
        return __Pyx_Float___Pyx_PyLong_AddCObj(op2, intval, zerodivision_check);
    }
    return __Pyx_Fallback___Pyx_PyLong_AddCObj(op1, op2, inplace);
}
#endif

/* PyObjectFormat */
  #if CYTHON_USE_UNICODE_WRITER
static PyObject* __Pyx_PyObject_Format(PyObject* obj, PyObject* format_spec) {
    int ret;
    _PyUnicodeWriter writer;
    if (likely(PyFloat_CheckExact(obj))) {
        _PyUnicodeWriter_Init(&writer);
        ret = _PyFloat_FormatAdvancedWriter(
            &writer,
            obj,
            format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
    } else if (likely(PyLong_CheckExact(obj))) {
        _PyUnicodeWriter_Init(&writer);
        ret = _PyLong_FormatAdvancedWriter(
            &writer,
            obj,
            format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
    } else {
        return PyObject_Format(obj, format_spec);
    }
    if (unlikely(ret == -1)) {
        _PyUnicodeWriter_Dealloc(&writer);
        return NULL;
    }
    return _PyUnicodeWriter_Finish(&writer);
}
#endif

/* pybytes_as_double */
  static double __Pyx_SlowPyString_AsDouble(PyObject *obj) {
    PyObject *float_value = PyFloat_FromString(obj);
    if (likely(float_value)) {
        double value = __Pyx_PyFloat_AS_DOUBLE(float_value);
        Py_DECREF(float_value);
        return value;
    }
    return (double)-1;
}
static const char* __Pyx__PyBytes_AsDouble_Copy(const char* start, char* buffer, Py_ssize_t length) {
    int last_was_punctuation = 1;
    int parse_error_found = 0;
    Py_ssize_t i;
    for (i=0; i < length; i++) {
        char chr = start[i];
        int is_punctuation = (chr == '_') | (chr == '.') | (chr == 'e') | (chr == 'E');
        *buffer = chr;
        buffer += (chr != '_');
        parse_error_found |= last_was_punctuation & is_punctuation;
        last_was_punctuation = is_punctuation;
    }
    parse_error_found |= last_was_punctuation;
    *buffer = '\0';
    return unlikely(parse_error_found) ? NULL : buffer;
}
static double __Pyx__PyBytes_AsDouble_inf_nan(const char* start, Py_ssize_t length) {
    int matches = 1;
    char sign = start[0];
    int is_signed = (sign == '+') | (sign == '-');
    start += is_signed;
    length -= is_signed;
    switch (start[0]) {
        #ifdef Py_NAN
        case 'n':
        case 'N':
            if (unlikely(length != 3)) goto parse_failure;
            matches &= (start[1] == 'a' || start[1] == 'A');
            matches &= (start[2] == 'n' || start[2] == 'N');
            if (unlikely(!matches)) goto parse_failure;
            return (sign == '-') ? -Py_NAN : Py_NAN;
        #endif
        case 'i':
        case 'I':
            if (unlikely(length < 3)) goto parse_failure;
            matches &= (start[1] == 'n' || start[1] == 'N');
            matches &= (start[2] == 'f' || start[2] == 'F');
            if (likely(length == 3 && matches))
                return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
            if (unlikely(length != 8)) goto parse_failure;
            matches &= (start[3] == 'i' || start[3] == 'I');
            matches &= (start[4] == 'n' || start[4] == 'N');
            matches &= (start[5] == 'i' || start[5] == 'I');
            matches &= (start[6] == 't' || start[6] == 'T');
            matches &= (start[7] == 'y' || start[7] == 'Y');
            if (unlikely(!matches)) goto parse_failure;
            return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
        case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
            break;
        default:
            goto parse_failure;
    }
    return 0.0;
parse_failure:
    return -1.0;
}
static CYTHON_INLINE int __Pyx__PyBytes_AsDouble_IsSpace(char ch) {
    return (ch == 0x20) | !((ch < 0x9) | (ch > 0xd));
}
CYTHON_UNUSED static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length) {
    double value;
    Py_ssize_t i, digits;
    const char *last = start + length;
    char *end;
    while (__Pyx__PyBytes_AsDouble_IsSpace(*start))
        start++;
    while (start < last - 1 && __Pyx__PyBytes_AsDouble_IsSpace(last[-1]))
        last--;
    length = last - start;
    if (unlikely(length <= 0)) goto fallback;
    value = __Pyx__PyBytes_AsDouble_inf_nan(start, length);
    if (unlikely(value == -1.0)) goto fallback;
    if (value != 0.0) return value;
    digits = 0;
    for (i=0; i < length; digits += start[i++] != '_');
    if (likely(digits == length)) {
        value = PyOS_string_to_double(start, &end, NULL);
    } else if (digits < 40) {
        char number[40];
        last = __Pyx__PyBytes_AsDouble_Copy(start, number, length);
        if (unlikely(!last)) goto fallback;
        value = PyOS_string_to_double(number, &end, NULL);
    } else {
        char *number = (char*) PyMem_Malloc((digits + 1) * sizeof(char));
        if (unlikely(!number)) goto fallback;
        last = __Pyx__PyBytes_AsDouble_Copy(start, number, length);
        if (unlikely(!last)) {
            PyMem_Free(number);
            goto fallback;
        }
        value = PyOS_string_to_double(number, &end, NULL);
        PyMem_Free(number);
    }
    if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) {
        return value;
    }
fallback:
    return __Pyx_SlowPyString_AsDouble(obj);
}

/* pynumber_float */
  static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj) {
    double val;
    if (PyLong_CheckExact(obj)) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (likely(__Pyx_PyLong_IsCompact(obj))) {
            val = (double) __Pyx_PyLong_CompactValue(obj);
            goto no_error;
        }
#endif
        val = PyLong_AsDouble(obj);
    } else if (PyUnicode_CheckExact(obj)) {
        val = __Pyx_PyUnicode_AsDouble(obj);
    } else if (PyBytes_CheckExact(obj)) {
        val = __Pyx_PyBytes_AsDouble(obj);
    } else if (PyByteArray_CheckExact(obj)) {
        val = __Pyx_PyByteArray_AsDouble(obj);
    } else {
        return PyNumber_Float(obj);
    }
    if (unlikely(val == -1 && PyErr_Occurred())) {
        return NULL;
    }
#if CYTHON_USE_PYLONG_INTERNALS
no_error:
#endif
    return PyFloat_FromDouble(val);
}

/* BufferIndexError */
  static void __Pyx_RaiseBufferIndexError(int axis) {
  PyErr_Format(PyExc_IndexError,
     "Out of bounds on buffer access (axis %d)", axis);
}

/* DictGetItem */
  #if !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    if (unlikely(__Pyx_PyDict_GetItemRef(d, key, &value) == 0)) { // no value, no error
        if (unlikely(PyTuple_Check(key))) {
            PyObject* args = PyTuple_Pack(1, key);
            if (likely(args)) {
                PyErr_SetObject(PyExc_KeyError, args);
                Py_DECREF(args);
            }
        } else {
            PyErr_SetObject(PyExc_KeyError, key);
        }
    }
    return value;
}
#endif

/* GetAttr3 */
  #if __PYX_LIMITED_VERSION_HEX < 0x030d0000
static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    Py_INCREF(d);
    return d;
}
#endif
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    int res = PyObject_GetOptionalAttr(o, n, &r);
    return (res != 0) ? r : __Pyx_NewRef(d);
#else
  #if CYTHON_USE_TYPE_SLOTS
    if (likely(PyUnicode_Check(n))) {
        r = __Pyx_PyObject_GetAttrStrNoError(o, n);
        if (unlikely(!r) && likely(!PyErr_Occurred())) {
            r = __Pyx_NewRef(d);
        }
        return r;
    }
  #endif
    r = PyObject_GetAttr(o, n);
    return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
#endif
}

/* PyObjectSetAttrStr */
  #if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
    return PyObject_SetAttr(obj, attr_name, value);
}
#endif

/* CIntToPyUnicode */
  static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(long)*3+2];
    char *dpos, *end = digits + sizeof(long)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    long remaining;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (format_char == 'c') {
        if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
                     !(sizeof(value) <= 2 || value & ~ (long) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
            PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
            return NULL;
        }
        if (width <= 1) {
            return PyUnicode_FromOrdinal((int) value);
        }
        return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
    }
    if (format_char == 'X') {
        hex_digits += 16;
        format_char = 'x';
    }
    remaining = value;
    last_one_off = 0;
    dpos = end;
    do {
        int digit_pos;
        switch (format_char) {
        case 'o':
            digit_pos = abs((int)(remaining % (8*8)));
            remaining = (long) (remaining / (8*8));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 8);
            break;
        case 'd':
            digit_pos = abs((int)(remaining % (10*10)));
            remaining = (long) (remaining / (10*10));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 10);
            break;
        case 'x':
            *(--dpos) = hex_digits[abs((int)(remaining % 16))];
            remaining = (long) (remaining / 16);
            break;
        default:
            assert(0);
            break;
        }
    } while (unlikely(remaining != 0));
    assert(!last_one_off || *dpos == '0');
    dpos += last_one_off;
    length = end - dpos;
    ulength = length;
    prepend_sign = 0;
    if (!is_unsigned && value <= neg_one) {
        if (padding_char == ' ' || width <= length + 1) {
            *(--dpos) = '-';
            ++length;
        } else {
            prepend_sign = 1;
        }
        ++ulength;
    }
    if (width > ulength) {
        ulength = width;
    }
    if (ulength == 1) {
        return PyUnicode_FromOrdinal(*dpos);
    }
    return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}

/* PyLongBinop */
  #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_TrueDivideObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_TrueDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a, x;
    if (unlikely(__Pyx_PyLong_IsZero(op1))) {
    }
    if (likely(__Pyx_PyLong_IsCompact(op1))) {
        a = __Pyx_PyLong_CompactValue(op1);
    } else {
        const digit* digits = __Pyx_PyLong_Digits(op1);
        const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
        switch (size) {
            case -2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) {
                    a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                }
                CYTHON_FALLTHROUGH;
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) {
                    a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                }
                CYTHON_FALLTHROUGH;
            case -3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) {
                    a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                }
                CYTHON_FALLTHROUGH;
            case 3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) {
                    a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                }
                CYTHON_FALLTHROUGH;
            case -4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) {
                    a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                }
                CYTHON_FALLTHROUGH;
            case 4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) {
                    a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                }
                CYTHON_FALLTHROUGH;
            default: return PyLong_Type.tp_as_number->nb_true_divide(op1, op2);
        }
    }
            if ((8 * sizeof(long) <= 53 || likely(labs(a) <= ((PY_LONG_LONG)1 << 53)))
                    || __Pyx_PyLong_DigitCount(op1) <= 52 / PyLong_SHIFT) {
                return PyFloat_FromDouble((double)a / (double)b);
            }
            return PyLong_Type.tp_as_number->nb_true_divide(op1, op2);
        return PyLong_FromLong(x);
    
}
#endif
static PyObject* __Pyx_Float___Pyx_PyLong_TrueDivideObjC(PyObject *float_val, long intval, int zerodivision_check) {
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    double a = __Pyx_PyFloat_AS_DOUBLE(float_val);
        double result;
        
        result = ((double)a) / (double)b;
        return PyFloat_FromDouble(result);
}
static CYTHON_INLINE PyObject* __Pyx_PyLong_TrueDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_TrueDivideObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        return __Pyx_Float___Pyx_PyLong_TrueDivideObjC(op1, intval, zerodivision_check);
    }
    return __Pyx_Fallback___Pyx_PyLong_TrueDivideObjC(op1, op2, inplace);
}
#endif

/* PyLongBinop */
  #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_FloorDivideObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceFloorDivide : PyNumber_FloorDivide)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_FloorDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a, x;
#ifdef HAVE_LONG_LONG
    const PY_LONG_LONG llb = intval;
    PY_LONG_LONG lla, llx;
#endif
    if (unlikely(__Pyx_PyLong_IsZero(op1))) {
        return __Pyx_NewRef(op1);
    }
    if (likely(__Pyx_PyLong_IsCompact(op1))) {
        a = __Pyx_PyLong_CompactValue(op1);
    } else {
        const digit* digits = __Pyx_PyLong_Digits(op1);
        const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
        switch (size) {
            case -2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                    lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case -3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                    a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                    lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                    a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case -4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                    a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                    lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            case 4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                    a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    break;
                #ifdef HAVE_LONG_LONG
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    goto long_long;
                #endif
                }
                CYTHON_FALLTHROUGH;
            default: return PyLong_Type.tp_as_number->nb_floor_divide(op1, op2);
        }
    }
            {
                long q, r;
                q = a / b;
                r = a - q*b;
                q -= ((r != 0) & ((r ^ b) < 0));
                x = q;
            }
        return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
    long_long:
            {
                PY_LONG_LONG q, r;
                q = lla / llb;
                r = lla - q*llb;
                q -= ((r != 0) & ((r ^ llb) < 0));
                llx = q;
            }
        return PyLong_FromLongLong(llx);
#endif
    return __Pyx_Fallback___Pyx_PyLong_FloorDivideObjC(op1, op2, inplace);
    
    
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyLong_FloorDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_FloorDivideObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    return __Pyx_Fallback___Pyx_PyLong_FloorDivideObjC(op1, op2, inplace);
}
#endif

/* IterNextPlain */
  #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void) {
    if (unlikely(!__pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache))
        __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache = __Pyx_GetBuiltinName(__pyx_mstate_global->__pyx_n_u_next);
    return __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache;
}
#endif
static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator) {
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
    PyObject *result;
    PyObject *next = __Pyx_GetBuiltinNext_LimitedAPI();
    if (unlikely(!next)) return NULL;
    result = PyObject_CallFunctionObjArgs(next, iterator, NULL);
    return result;
#else
    (void)__Pyx_GetBuiltinName; // only for early limited API
    iternextfunc iternext = __Pyx_PyObject_GetIterNextFunc(iterator);
    assert(iternext);
    return iternext(iterator);
#endif
}

/* IterNext */
  #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03080000
static PyObject *__Pyx_PyIter_Next2(PyObject *o, PyObject *defval) {
    PyObject *result;
    PyObject *next = __Pyx_GetBuiltinNext_LimitedAPI();
    if (unlikely(!next)) return NULL;
    result = PyObject_CallFunctionObjArgs(next, o, defval, NULL);
    return result;
}
#else
static PyObject *__Pyx_PyIter_Next2Default(PyObject* defval) {
    PyObject* exc_type;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    exc_type = __Pyx_PyErr_CurrentExceptionType();
    if (unlikely(exc_type)) {
        if (!defval || unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
            return NULL;
        __Pyx_PyErr_Clear();
        Py_INCREF(defval);
        return defval;
    }
    if (defval) {
        Py_INCREF(defval);
        return defval;
    }
    __Pyx_PyErr_SetNone(PyExc_StopIteration);
    return NULL;
}
static void __Pyx_PyIter_Next_ErrorNoIterator(PyObject *iterator) {
    __Pyx_TypeName iterator_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(iterator));
    PyErr_Format(PyExc_TypeError,
        __Pyx_FMT_TYPENAME " object is not an iterator", iterator_type_name);
    __Pyx_DECREF_TypeName(iterator_type_name);
}
static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject* defval) {
    PyObject* next;
#if !CYTHON_COMPILING_IN_LIMITED_API
    iternextfunc iternext = __Pyx_PyObject_TryGetSlot(iterator, tp_iternext, iternextfunc);
    if (likely(iternext)) {
        next = iternext(iterator);
        if (likely(next))
            return next;
    #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
        if (unlikely(iternext == &_PyObject_NextNotImplemented))
            return NULL;
    #endif
    } else if (CYTHON_USE_TYPE_SLOTS) {
        __Pyx_PyIter_Next_ErrorNoIterator(iterator);
        return NULL;
    } else
#endif
    if (unlikely(!PyIter_Check(iterator))) {
        __Pyx_PyIter_Next_ErrorNoIterator(iterator);
        return NULL;
    } else {
        next = defval ? PyIter_Next(iterator) : __Pyx_PyIter_Next_Plain(iterator);
        if (likely(next))
            return next;
    }
    return __Pyx_PyIter_Next2Default(defval);
}
#endif

/* PyLongCompare */
  static CYTHON_INLINE int __Pyx_PyLong_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(inplace);
    if (op1 == op2) {
        return 0;
    }
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
        const digit* digits = __Pyx_PyLong_Digits(op1);
        if (intval == 0) {
            return (__Pyx_PyLong_IsZero(op1) != 1);
        } else if (intval < 0) {
            if (__Pyx_PyLong_IsNonNeg(op1))
                return 1;
            intval = -intval;
        } else {
            if (__Pyx_PyLong_IsNeg(op1))
                return 1;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        return (unequal != 0);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = __Pyx_PyFloat_AS_DOUBLE(op1);
        return ((double)a != (double)b);
    }
    return __Pyx_PyObject_IsTrueAndDecref(
        PyObject_RichCompare(op1, op2, Py_NE));
}

/* pyobject_as_double */
  static double __Pyx__PyObject_AsDouble(PyObject* obj) {
    if (PyUnicode_CheckExact(obj)) {
        return __Pyx_PyUnicode_AsDouble(obj);
    } else if (PyBytes_CheckExact(obj)) {
        return __Pyx_PyBytes_AsDouble(obj);
    } else if (PyByteArray_CheckExact(obj)) {
        return __Pyx_PyByteArray_AsDouble(obj);
    } else {
        PyObject* float_value;
#if !CYTHON_USE_TYPE_SLOTS
        float_value = PyNumber_Float(obj);  if ((0)) goto bad;
        (void)__Pyx_PyObject_CallOneArg;
#else
        PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number;
        if (likely(nb) && likely(nb->nb_float)) {
            float_value = nb->nb_float(obj);
            if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) {
                __Pyx_TypeName float_value_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(float_value));
                PyErr_Format(PyExc_TypeError,
                    "__float__ returned non-float (type " __Pyx_FMT_TYPENAME ")",
                    float_value_type_name);
                __Pyx_DECREF_TypeName(float_value_type_name);
                Py_DECREF(float_value);
                goto bad;
            }
        } else {
            float_value = __Pyx_PyObject_CallOneArg((PyObject*)&PyFloat_Type, obj);
        }
#endif
        if (likely(float_value)) {
            double value = __Pyx_PyFloat_AS_DOUBLE(float_value);
            Py_DECREF(float_value);
            return value;
        }
    }
bad:
    return (double)-1;
}

/* PyObjectCallNoArg */
  static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
    PyObject *arg[2] = {NULL, NULL};
    return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* pyfrozenset_new */
  static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) {
    if (it) {
        PyObject* result;
#if CYTHON_COMPILING_IN_PYPY
        PyObject* args;
        args = PyTuple_Pack(1, it);
        if (unlikely(!args))
            return NULL;
        result = PyObject_Call((PyObject*)&PyFrozenSet_Type, args, NULL);
        Py_DECREF(args);
        return result;
#else
        if (PyFrozenSet_CheckExact(it)) {
            Py_INCREF(it);
            return it;
        }
        result = PyFrozenSet_New(it);
        if (unlikely(!result))
            return NULL;
        if ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
#if CYTHON_COMPILING_IN_LIMITED_API
            || __Pyx_get_runtime_version() >= 0x030A0000
#endif
            )
            return result;
        {
            Py_ssize_t size = __Pyx_PySet_GET_SIZE(result);
            if (likely(size > 0))
                return result;
#if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely(size < 0)) {
                Py_DECREF(result);
                return NULL;
            }
#endif
        }
        Py_DECREF(result);
#endif
    }
    return __Pyx_PyObject_CallNoArg((PyObject*) &PyFrozenSet_Type);
}

/* PySetContains */
  static int __Pyx_PySet_ContainsUnhashable(PyObject *set, PyObject *key) {
    int result = -1;
    if (PySet_Check(key) && PyErr_ExceptionMatches(PyExc_TypeError)) {
        PyObject *tmpkey;
        PyErr_Clear();
        tmpkey = __Pyx_PyFrozenSet_New(key);
        if (tmpkey != NULL) {
            result = PySet_Contains(set, tmpkey);
            Py_DECREF(tmpkey);
        }
    }
    return result;
}
static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq) {
    int result = PySet_Contains(set, key);
    if (unlikely(result < 0)) {
        result = __Pyx_PySet_ContainsUnhashable(set, key);
    }
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

/* PyObjectCall2Args */
  static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args[3] = {NULL, arg1, arg2};
    return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* CallUnboundCMethod1 */
  #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
    int was_initialized =  __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
    if (likely(was_initialized == 2 && cfunc->func)) {
        int flag = cfunc->flag;
        if (flag == METH_O) {
            return __Pyx_CallCFunction(cfunc, self, arg);
        } else if (flag == METH_FASTCALL) {
            return __Pyx_CallCFunctionFast(cfunc, self, &arg, 1);
        } else if (flag == (METH_FASTCALL | METH_KEYWORDS)) {
            return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, &arg, 1, NULL);
        }
    }
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    else if (unlikely(was_initialized == 1)) {
        __Pyx_CachedCFunction tmp_cfunc = {
#ifndef __cplusplus
            0
#endif
        };
        tmp_cfunc.type = cfunc->type;
        tmp_cfunc.method_name = cfunc->method_name;
        return __Pyx__CallUnboundCMethod1(&tmp_cfunc, self, arg);
    }
#endif
    PyObject* result = __Pyx__CallUnboundCMethod1(cfunc, self, arg);
    __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
    return result;
}
#endif
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
    PyObject *result = NULL;
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        PyObject *args = PyTuple_New(1);
        if (unlikely(!args)) return NULL;
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 0, arg);
        if (cfunc->flag & METH_KEYWORDS)
            result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
        else
            result = __Pyx_CallCFunction(cfunc, self, args);
        Py_DECREF(args);
    } else
#endif
    {
        result = __Pyx_PyObject_Call2Args(cfunc->method, self, arg);
    }
    return result;
}

/* Import */
  static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *module = 0;
    PyObject *empty_dict = 0;
    PyObject *empty_list = 0;
    empty_dict = PyDict_New();
    if (unlikely(!empty_dict))
        goto bad;
    if (level == -1) {
        const char* package_sep = strchr(__Pyx_MODULE_NAME, '.');
        if (package_sep != (0)) {
            module = PyImport_ImportModuleLevelObject(
                name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, 1);
            if (unlikely(!module)) {
                if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
                    goto bad;
                PyErr_Clear();
            }
        }
        level = 0;
    }
    if (!module) {
        module = PyImport_ImportModuleLevelObject(
            name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, level);
    }
bad:
    Py_XDECREF(empty_dict);
    Py_XDECREF(empty_list);
    return module;
}

/* ImportFrom */
  static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        const char* module_name_str = 0;
        PyObject* module_name = 0;
        PyObject* module_dot = 0;
        PyObject* full_name = 0;
        PyErr_Clear();
        module_name_str = PyModule_GetName(module);
        if (unlikely(!module_name_str)) { goto modbad; }
        module_name = PyUnicode_FromString(module_name_str);
        if (unlikely(!module_name)) { goto modbad; }
        module_dot = PyUnicode_Concat(module_name, __pyx_mstate_global->__pyx_kp_u__5);
        if (unlikely(!module_dot)) { goto modbad; }
        full_name = PyUnicode_Concat(module_dot, name);
        if (unlikely(!full_name)) { goto modbad; }
        #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM  < 0x07030400) ||\
                CYTHON_COMPILING_IN_GRAAL
        {
            PyObject *modules = PyImport_GetModuleDict();
            if (unlikely(!modules))
                goto modbad;
            value = PyObject_GetItem(modules, full_name);
        }
        #else
        value = PyImport_GetModule(full_name);
        #endif
      modbad:
        Py_XDECREF(full_name);
        Py_XDECREF(module_dot);
        Py_XDECREF(module_name);
    }
    if (unlikely(!value)) {
        PyErr_Format(PyExc_ImportError, "cannot import name %S", name);
    }
    return value;
}

/* HasAttr */
  #if __PYX_LIMITED_VERSION_HEX < 0x030d0000
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!PyUnicode_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_PyObject_GetAttrStrNoError(o, n);
    if (!r) {
        return (unlikely(PyErr_Occurred())) ? -1 : 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}
#endif

/* CallTypeTraverse */
  #if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000)
#else
static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) {
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000
    if (__Pyx_get_runtime_version() < 0x03090000) return 0;
    #endif
    if (!always_call) {
        PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*);
        unsigned long flags = PyType_GetFlags(base);
        if (flags & Py_TPFLAGS_HEAPTYPE) {
            return 0;
        }
    }
    Py_VISIT((PyObject*)Py_TYPE(o));
    return 0;
}
#endif

/* FixUpExtensionType */
  static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    CYTHON_UNUSED_VAR(spec);
    CYTHON_UNUSED_VAR(type);
#else
    const PyType_Slot *slot = spec->slots;
    while (slot && slot->slot && slot->slot != Py_tp_members)
        slot++;
    if (slot && slot->slot == Py_tp_members) {
        int changed = 0;
#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON)
        const
#endif
            PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
        while (memb && memb->name) {
            if (memb->name[0] == '_' && memb->name[1] == '_') {
#if PY_VERSION_HEX < 0x030900b1
                if (strcmp(memb->name, "__weaklistoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_weaklistoffset = memb->offset;
                    changed = 1;
                }
                else if (strcmp(memb->name, "__dictoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_dictoffset = memb->offset;
                    changed = 1;
                }
#if CYTHON_METH_FASTCALL
                else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
#if PY_VERSION_HEX >= 0x030800b4
                    type->tp_vectorcall_offset = memb->offset;
#else
                    type->tp_print = (printfunc) memb->offset;
#endif
                    changed = 1;
                }
#endif
#else
                if ((0));
#endif
#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON
                else if (strcmp(memb->name, "__module__") == 0) {
                    PyObject *descr;
                    assert(memb->type == T_OBJECT);
                    assert(memb->flags == 0 || memb->flags == READONLY);
                    descr = PyDescr_NewMember(type, memb);
                    if (unlikely(!descr))
                        return -1;
                    if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) {
                        Py_DECREF(descr);
                        return -1;
                    }
                    Py_DECREF(descr);
                    changed = 1;
                }
#endif
            }
            memb++;
        }
        if (changed)
            PyType_Modified(type);
    }
#endif
    return 0;
}

/* PyObjectGetMethod */
  static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
    PyObject *attr;
#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
    __Pyx_TypeName type_name;
    PyTypeObject *tp = Py_TYPE(obj);
    PyObject *descr;
    descrgetfunc f = NULL;
    PyObject **dictptr, *dict;
    int meth_found = 0;
    assert (*method == NULL);
    if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
        attr = __Pyx_PyObject_GetAttrStr(obj, name);
        goto try_unpack;
    }
    if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
        return 0;
    }
    descr = _PyType_Lookup(tp, name);
    if (likely(descr != NULL)) {
        Py_INCREF(descr);
#if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR
        if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR))
#else
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type)))
        #endif
#endif
        {
            meth_found = 1;
        } else {
            f = Py_TYPE(descr)->tp_descr_get;
            if (f != NULL && PyDescr_IsData(descr)) {
                attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
                Py_DECREF(descr);
                goto try_unpack;
            }
        }
    }
    dictptr = _PyObject_GetDictPtr(obj);
    if (dictptr != NULL && (dict = *dictptr) != NULL) {
        Py_INCREF(dict);
        attr = __Pyx_PyDict_GetItemStr(dict, name);
        if (attr != NULL) {
            Py_INCREF(attr);
            Py_DECREF(dict);
            Py_XDECREF(descr);
            goto try_unpack;
        }
        Py_DECREF(dict);
    }
    if (meth_found) {
        *method = descr;
        return 1;
    }
    if (f != NULL) {
        attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
        Py_DECREF(descr);
        goto try_unpack;
    }
    if (likely(descr != NULL)) {
        *method = descr;
        return 0;
    }
    type_name = __Pyx_PyType_GetFullyQualifiedName(tp);
    PyErr_Format(PyExc_AttributeError,
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
                 type_name, name);
    __Pyx_DECREF_TypeName(type_name);
    return 0;
#else
    attr = __Pyx_PyObject_GetAttrStr(obj, name);
    goto try_unpack;
#endif
try_unpack:
#if CYTHON_UNPACK_METHODS
    if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
        PyObject *function = PyMethod_GET_FUNCTION(attr);
        Py_INCREF(function);
        Py_DECREF(attr);
        *method = function;
        return 1;
    }
#endif
    *method = attr;
    return 0;
}

/* PyObjectCallMethod0 */
  static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    PyObject *method = NULL, *result = NULL;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_CallOneArg(method, obj);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) goto bad;
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
}

/* ValidateBasesTuple */
  #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) {
    Py_ssize_t i, n;
#if CYTHON_ASSUME_SAFE_SIZE
    n = PyTuple_GET_SIZE(bases);
#else
    n = PyTuple_Size(bases);
    if (unlikely(n < 0)) return -1;
#endif
    for (i = 1; i < n; i++)
    {
        PyTypeObject *b;
#if CYTHON_AVOID_BORROWED_REFS
        PyObject *b0 = PySequence_GetItem(bases, i);
        if (!b0) return -1;
#elif CYTHON_ASSUME_SAFE_MACROS
        PyObject *b0 = PyTuple_GET_ITEM(bases, i);
#else
        PyObject *b0 = PyTuple_GetItem(bases, i);
        if (!b0) return -1;
#endif
        b = (PyTypeObject*) b0;
        if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
        {
            __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(b);
            PyErr_Format(PyExc_TypeError,
                "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name);
            __Pyx_DECREF_TypeName(b_name);
#if CYTHON_AVOID_BORROWED_REFS
            Py_DECREF(b0);
#endif
            return -1;
        }
        if (dictoffset == 0)
        {
            Py_ssize_t b_dictoffset = 0;
#if CYTHON_USE_TYPE_SLOTS
            b_dictoffset = b->tp_dictoffset;
#else
            PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__");
            if (!py_b_dictoffset) goto dictoffset_return;
            b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset);
            Py_DECREF(py_b_dictoffset);
            if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
#endif
            if (b_dictoffset) {
                {
                    __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(b);
                    PyErr_Format(PyExc_TypeError,
                        "extension type '%.200s' has no __dict__ slot, "
                        "but base type '" __Pyx_FMT_TYPENAME "' has: "
                        "either add 'cdef dict __dict__' to the extension type "
                        "or add '__slots__ = [...]' to the base type",
                        type_name, b_name);
                    __Pyx_DECREF_TypeName(b_name);
                }
#if !CYTHON_USE_TYPE_SLOTS
              dictoffset_return:
#endif
#if CYTHON_AVOID_BORROWED_REFS
                Py_DECREF(b0);
#endif
                return -1;
            }
        }
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(b0);
#endif
    }
    return 0;
}
#endif

/* PyType_Ready */
  CYTHON_UNUSED static int __Pyx_PyType_HasMultipleInheritance(PyTypeObject *t) {
    while (t) {
        PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
        if (bases) {
            return 1;
        }
        t = __Pyx_PyType_GetSlot(t, tp_base, PyTypeObject*);
    }
    return 0;
}
static int __Pyx_PyType_Ready(PyTypeObject *t) {
#if CYTHON_USE_TYPE_SPECS || !CYTHON_COMPILING_IN_CPYTHON || defined(PYSTON_MAJOR_VERSION)
    (void)__Pyx_PyObject_CallMethod0;
#if CYTHON_USE_TYPE_SPECS
    (void)__Pyx_validate_bases_tuple;
#endif
    return PyType_Ready(t);
#else
    int r;
    if (!__Pyx_PyType_HasMultipleInheritance(t)) {
        return PyType_Ready(t);
    }
    PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
    if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1))
        return -1;
#if !defined(PYSTON_MAJOR_VERSION)
    {
        int gc_was_enabled;
    #if PY_VERSION_HEX >= 0x030A00b1
        gc_was_enabled = PyGC_Disable();
        (void)__Pyx_PyObject_CallMethod0;
    #else
        PyObject *ret, *py_status;
        PyObject *gc = NULL;
        #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\
                !CYTHON_COMPILING_IN_GRAAL
        gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc);
        #endif
        if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc);
        if (unlikely(!gc)) return -1;
        py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_isenabled);
        if (unlikely(!py_status)) {
            Py_DECREF(gc);
            return -1;
        }
        gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
        Py_DECREF(py_status);
        if (gc_was_enabled > 0) {
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_disable);
            if (unlikely(!ret)) {
                Py_DECREF(gc);
                return -1;
            }
            Py_DECREF(ret);
        } else if (unlikely(gc_was_enabled == -1)) {
            Py_DECREF(gc);
            return -1;
        }
    #endif
        t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
#if PY_VERSION_HEX >= 0x030A0000
        t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
#endif
#else
        (void)__Pyx_PyObject_CallMethod0;
#endif
    r = PyType_Ready(t);
#if !defined(PYSTON_MAJOR_VERSION)
        t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
    #if PY_VERSION_HEX >= 0x030A00b1
        if (gc_was_enabled)
            PyGC_Enable();
    #else
        if (gc_was_enabled) {
            PyObject *tp, *v, *tb;
            PyErr_Fetch(&tp, &v, &tb);
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_enable);
            if (likely(ret || r == -1)) {
                Py_XDECREF(ret);
                PyErr_Restore(tp, v, tb);
            } else {
                Py_XDECREF(tp);
                Py_XDECREF(v);
                Py_XDECREF(tb);
                r = -1;
            }
        }
        Py_DECREF(gc);
    #endif
    }
#endif
    return r;
#endif
}

/* LimitedApiGetTypeDict */
  #if CYTHON_COMPILING_IN_LIMITED_API
static Py_ssize_t __Pyx_GetTypeDictOffset(void) {
    PyObject *tp_dictoffset_o;
    Py_ssize_t tp_dictoffset;
    tp_dictoffset_o = PyObject_GetAttrString((PyObject*)(&PyType_Type), "__dictoffset__");
    if (unlikely(!tp_dictoffset_o)) return -1;
    tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o);
    Py_DECREF(tp_dictoffset_o);
    if (unlikely(tp_dictoffset == 0)) {
        PyErr_SetString(
            PyExc_TypeError,
            "'type' doesn't have a dictoffset");
        return -1;
    } else if (unlikely(tp_dictoffset < 0)) {
        PyErr_SetString(
            PyExc_TypeError,
            "'type' has an unexpected negative dictoffset. "
            "Please report this as Cython bug");
        return -1;
    }
    return tp_dictoffset;
}
static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) {
    static Py_ssize_t tp_dictoffset = 0;
    if (unlikely(tp_dictoffset == 0)) {
        tp_dictoffset = __Pyx_GetTypeDictOffset();
        if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) {
            tp_dictoffset = 0; // try again next time?
            return NULL;
        }
    }
    return *(PyObject**)((char*)tp + tp_dictoffset);
}
#endif

/* DelItemOnTypeDict */
  static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k) {
    int result;
    PyObject *tp_dict;
#if CYTHON_COMPILING_IN_LIMITED_API
    tp_dict = __Pyx_GetTypeDict(tp);
    if (unlikely(!tp_dict)) return -1;
#else
    tp_dict = tp->tp_dict;
#endif
    result = PyDict_DelItem(tp_dict, k);
    if (likely(!result)) PyType_Modified(tp);
    return result;
}

/* SetItemOnTypeDict */
  static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) {
    int result;
    PyObject *tp_dict;
#if CYTHON_COMPILING_IN_LIMITED_API
    tp_dict = __Pyx_GetTypeDict(tp);
    if (unlikely(!tp_dict)) return -1;
#else
    tp_dict = tp->tp_dict;
#endif
    result = PyDict_SetItem(tp_dict, k, v);
    if (likely(!result)) {
        PyType_Modified(tp);
        if (unlikely(PyObject_HasAttr(v, __pyx_mstate_global->__pyx_n_u_set_name))) {
            PyObject *setNameResult = PyObject_CallMethodObjArgs(v, __pyx_mstate_global->__pyx_n_u_set_name,  (PyObject *) tp, k, NULL);
            if (!setNameResult) return -1;
            Py_DECREF(setNameResult);
        }
    }
    return result;
}

/* SetupReduce */
  static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_mstate_global->__pyx_n_u_name);
  if (likely(name_attr)) {
      ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
  } else {
      ret = -1;
  }
  if (unlikely(ret < 0)) {
      PyErr_Clear();
      ret = 0;
  }
  Py_XDECREF(name_attr);
  return ret;
}
static int __Pyx_setup_reduce(PyObject* type_obj) {
    int ret = 0;
    PyObject *object_reduce = NULL;
    PyObject *object_getstate = NULL;
    PyObject *object_reduce_ex = NULL;
    PyObject *reduce = NULL;
    PyObject *reduce_ex = NULL;
    PyObject *reduce_cython = NULL;
    PyObject *setstate = NULL;
    PyObject *setstate_cython = NULL;
    PyObject *getstate = NULL;
#if CYTHON_USE_PYTYPE_LOOKUP
    getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_getstate);
#else
    getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_getstate);
    if (!getstate && PyErr_Occurred()) {
        goto __PYX_BAD;
    }
#endif
    if (getstate) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_getstate);
#else
        object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_getstate);
        if (!object_getstate && PyErr_Occurred()) {
            goto __PYX_BAD;
        }
#endif
        if (object_getstate != getstate) {
            goto __PYX_GOOD;
        }
    }
#if CYTHON_USE_PYTYPE_LOOKUP
    object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#else
    object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#endif
    reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
    if (reduce_ex == object_reduce_ex) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce); if (!object_reduce) goto __PYX_BAD;
#else
        object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce); if (!object_reduce) goto __PYX_BAD;
#endif
        reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
        if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_mstate_global->__pyx_n_u_reduce_cython)) {
            reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython);
            if (likely(reduce_cython)) {
                ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
            } else if (reduce == object_reduce || PyErr_Occurred()) {
                goto __PYX_BAD;
            }
            setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate);
            if (!setstate) PyErr_Clear();
            if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_mstate_global->__pyx_n_u_setstate_cython)) {
                setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython);
                if (likely(setstate_cython)) {
                    ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                    ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                } else if (!setstate || PyErr_Occurred()) {
                    goto __PYX_BAD;
                }
            }
            PyType_Modified((PyTypeObject*)type_obj);
        }
    }
    goto __PYX_GOOD;
__PYX_BAD:
    if (!PyErr_Occurred()) {
        __Pyx_TypeName type_obj_name =
            __Pyx_PyType_GetFullyQualifiedName((PyTypeObject*)type_obj);
        PyErr_Format(PyExc_RuntimeError,
            "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name);
        __Pyx_DECREF_TypeName(type_obj_name);
    }
    ret = -1;
__PYX_GOOD:
#if !CYTHON_USE_PYTYPE_LOOKUP
    Py_XDECREF(object_reduce);
    Py_XDECREF(object_reduce_ex);
    Py_XDECREF(object_getstate);
    Py_XDECREF(getstate);
#endif
    Py_XDECREF(reduce);
    Py_XDECREF(reduce_ex);
    Py_XDECREF(reduce_cython);
    Py_XDECREF(setstate);
    Py_XDECREF(setstate_cython);
    return ret;
}

/* SetVTable */
  static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) {
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
    if (unlikely(!ob))
        goto bad;
#if CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
#else
    if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
#endif
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

/* GetVTable */
  static void* __Pyx_GetVtable(PyTypeObject *type) {
    void* ptr;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
#else
    PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
#endif
    if (!ob)
        goto bad;
    ptr = PyCapsule_GetPointer(ob, 0);
    if (!ptr && !PyErr_Occurred())
        PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
    Py_DECREF(ob);
    return ptr;
bad:
    Py_XDECREF(ob);
    return NULL;
}

/* MergeVTables */
  static int __Pyx_MergeVtables(PyTypeObject *type) {
    int i=0;
    Py_ssize_t size;
    void** base_vtables;
    __Pyx_TypeName tp_base_name = NULL;
    __Pyx_TypeName base_name = NULL;
    void* unknown = (void*)-1;
    PyObject* bases = __Pyx_PyType_GetSlot(type, tp_bases, PyObject*);
    int base_depth = 0;
    {
        PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
        while (base) {
            base_depth += 1;
            base = __Pyx_PyType_GetSlot(base, tp_base, PyTypeObject*);
        }
    }
    base_vtables = (void**) PyMem_Malloc(sizeof(void*) * (size_t)(base_depth + 1));
    base_vtables[0] = unknown;
#if CYTHON_COMPILING_IN_LIMITED_API
    size = PyTuple_Size(bases);
    if (size < 0) goto other_failure;
#else
    size = PyTuple_GET_SIZE(bases);
#endif
    for (i = 1; i < size; i++) {
        PyObject *basei;
        void* base_vtable;
#if CYTHON_AVOID_BORROWED_REFS
        basei = PySequence_GetItem(bases, i);
        if (unlikely(!basei)) goto other_failure;
#elif !CYTHON_ASSUME_SAFE_MACROS
        basei = PyTuple_GetItem(bases, i);
        if (unlikely(!basei)) goto other_failure;
#else
        basei = PyTuple_GET_ITEM(bases, i);
#endif
        base_vtable = __Pyx_GetVtable((PyTypeObject*)basei);
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(basei);
#endif
        if (base_vtable != NULL) {
            int j;
            PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
            for (j = 0; j < base_depth; j++) {
                if (base_vtables[j] == unknown) {
                    base_vtables[j] = __Pyx_GetVtable(base);
                    base_vtables[j + 1] = unknown;
                }
                if (base_vtables[j] == base_vtable) {
                    break;
                } else if (base_vtables[j] == NULL) {
                    goto bad;
                }
                base = __Pyx_PyType_GetSlot(base, tp_base, PyTypeObject*);
            }
        }
    }
    PyErr_Clear();
    PyMem_Free(base_vtables);
    return 0;
bad:
    {
        PyTypeObject* basei = NULL;
        PyTypeObject* tp_base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
        tp_base_name = __Pyx_PyType_GetFullyQualifiedName(tp_base);
#if CYTHON_AVOID_BORROWED_REFS
        basei = (PyTypeObject*)PySequence_GetItem(bases, i);
        if (unlikely(!basei)) goto really_bad;
#elif !CYTHON_ASSUME_SAFE_MACROS
        basei = (PyTypeObject*)PyTuple_GetItem(bases, i);
        if (unlikely(!basei)) goto really_bad;
#else
        basei = (PyTypeObject*)PyTuple_GET_ITEM(bases, i);
#endif
        base_name = __Pyx_PyType_GetFullyQualifiedName(basei);
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(basei);
#endif
    }
    PyErr_Format(PyExc_TypeError,
        "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name);
#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
really_bad: // bad has failed!
#endif
    __Pyx_DECREF_TypeName(tp_base_name);
    __Pyx_DECREF_TypeName(base_name);
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
other_failure:
#endif
    PyMem_Free(base_vtables);
    return -1;
}

/* TypeImport */
  #ifndef __PYX_HAVE_RT_ImportType_3_1_1
#define __PYX_HAVE_RT_ImportType_3_1_1
static PyTypeObject *__Pyx_ImportType_3_1_1(PyObject *module, const char *module_name, const char *class_name,
    size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_1_1 check_size)
{
    PyObject *result = 0;
    Py_ssize_t basicsize;
    Py_ssize_t itemsize;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_basicsize;
    PyObject *py_itemsize;
#endif
    result = PyObject_GetAttrString(module, class_name);
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#if !CYTHON_COMPILING_IN_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
    itemsize = ((PyTypeObject *)result)->tp_itemsize;
#else
    if (size == 0) {
        return (PyTypeObject *)result;
    }
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
    py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
    if (!py_itemsize)
        goto bad;
    itemsize = PyLong_AsSsize_t(py_itemsize);
    Py_DECREF(py_itemsize);
    py_itemsize = 0;
    if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (itemsize) {
        if (size % alignment) {
            alignment = size % alignment;
        }
        if (itemsize < (Py_ssize_t)alignment)
            itemsize = (Py_ssize_t)alignment;
    }
    if ((size_t)(basicsize + itemsize) < size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize+itemsize);
        goto bad;
    }
    if (check_size == __Pyx_ImportType_CheckSize_Error_3_1_1 &&
            ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd-%zd from PyObject",
            module_name, class_name, size, basicsize, basicsize+itemsize);
        goto bad;
    }
    else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_1_1 && (size_t)basicsize > size) {
        if (PyErr_WarnFormat(NULL, 0,
                "%.200s.%.200s size changed, may indicate binary incompatibility. "
                "Expected %zd from C header, got %zd from PyObject",
                module_name, class_name, size, basicsize) < 0) {
            goto bad;
        }
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(result);
    return NULL;
}
#endif

/* ImportDottedModule */
  static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) {
    PyObject *partial_name = NULL, *slice = NULL, *sep = NULL;
    Py_ssize_t size;
    if (unlikely(PyErr_Occurred())) {
        PyErr_Clear();
    }
#if CYTHON_ASSUME_SAFE_SIZE
    size = PyTuple_GET_SIZE(parts_tuple);
#else
    size = PyTuple_Size(parts_tuple);
    if (size < 0) goto bad;
#endif
    if (likely(size == count)) {
        partial_name = name;
    } else {
        slice = PySequence_GetSlice(parts_tuple, 0, count);
        if (unlikely(!slice))
            goto bad;
        sep = PyUnicode_FromStringAndSize(".", 1);
        if (unlikely(!sep))
            goto bad;
        partial_name = PyUnicode_Join(sep, slice);
    }
    PyErr_Format(
        PyExc_ModuleNotFoundError,
        "No module named '%U'", partial_name);
bad:
    Py_XDECREF(sep);
    Py_XDECREF(slice);
    Py_XDECREF(partial_name);
    return NULL;
}
static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) {
    PyObject *imported_module;
#if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM  < 0x07030400) ||\
        CYTHON_COMPILING_IN_GRAAL
    PyObject *modules = PyImport_GetModuleDict();
    if (unlikely(!modules))
        return NULL;
    imported_module = __Pyx_PyDict_GetItemStr(modules, name);
    Py_XINCREF(imported_module);
#else
    imported_module = PyImport_GetModule(name);
#endif
    return imported_module;
}
static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) {
    Py_ssize_t i, nparts;
#if CYTHON_ASSUME_SAFE_SIZE
    nparts = PyTuple_GET_SIZE(parts_tuple);
#else
    nparts = PyTuple_Size(parts_tuple);
    if (nparts < 0) return NULL;
#endif
    for (i=1; i < nparts && module; i++) {
        PyObject *part, *submodule;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        part = PyTuple_GET_ITEM(parts_tuple, i);
#else
        part = __Pyx_PySequence_ITEM(parts_tuple, i);
        if (!part) return NULL;
#endif
        submodule = __Pyx_PyObject_GetAttrStrNoError(module, part);
#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
        Py_DECREF(part);
#endif
        Py_DECREF(module);
        module = submodule;
    }
    if (unlikely(!module)) {
        return __Pyx__ImportDottedModule_Error(name, parts_tuple, i);
    }
    return module;
}
static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
    PyObject *imported_module;
    PyObject *module = __Pyx_Import(name, NULL, 0);
    if (!parts_tuple || unlikely(!module))
        return module;
    imported_module = __Pyx__ImportDottedModule_Lookup(name);
    if (likely(imported_module)) {
        Py_DECREF(module);
        return imported_module;
    }
    PyErr_Clear();
    return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple);
}
static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *module = __Pyx__ImportDottedModule_Lookup(name);
    if (likely(module)) {
        PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_mstate_global->__pyx_n_u_spec);
        if (likely(spec)) {
            PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_mstate_global->__pyx_n_u_initializing);
            if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) {
                Py_DECREF(spec);
                spec = NULL;
            }
            Py_XDECREF(unsafe);
        }
        if (likely(!spec)) {
            PyErr_Clear();
            return module;
        }
        Py_DECREF(spec);
        Py_DECREF(module);
    } else if (PyErr_Occurred()) {
        PyErr_Clear();
    }
#endif
    return __Pyx__ImportDottedModule(name, parts_tuple);
}

/* FetchSharedCythonModule */
  static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
    return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
}

/* dict_setdefault */
  static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value,
                                                       int is_safe_type) {
    PyObject* value;
    CYTHON_MAYBE_UNUSED_VAR(is_safe_type);
#if CYTHON_COMPILING_IN_LIMITED_API
    value = PyObject_CallMethod(d, "setdefault", "OO", key, default_value);
#elif PY_VERSION_HEX >= 0x030d0000
    PyDict_SetDefaultRef(d, key, default_value, &value);
#else
    value = PyDict_SetDefault(d, key, default_value);
    if (unlikely(!value)) return NULL;
    Py_INCREF(value);
#endif
    return value;
}

/* FetchCommonType */
  static int __Pyx_VerifyCachedType(PyObject *cached_type,
                               const char *name,
                               Py_ssize_t expected_basicsize) {
    Py_ssize_t basicsize;
    if (!PyType_Check(cached_type)) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s is not a type object", name);
        return -1;
    }
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_basicsize;
    py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
    if (unlikely(!py_basicsize)) return -1;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = NULL;
    if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) return -1;
#else
    basicsize = ((PyTypeObject*) cached_type)->tp_basicsize;
#endif
    if (basicsize != expected_basicsize) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s has the wrong size, try recompiling",
            name);
        return -1;
    }
    return 0;
}
static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
    int get_item_ref_result;
    const char* object_name = strrchr(spec->name, '.');
    object_name = object_name ? object_name+1 : spec->name;
    py_object_name = PyUnicode_FromString(object_name);
    if (!py_object_name) return NULL;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) goto done;
    abi_module_dict = PyModule_GetDict(abi_module);
    if (!abi_module_dict) goto done;
    get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type);
    if (get_item_ref_result == 1) {
        if (__Pyx_VerifyCachedType(
              cached_type,
              object_name,
              spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    } else if (unlikely(get_item_ref_result == -1)) {
        goto bad;
    }
    CYTHON_UNUSED_VAR(module);
    cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases);
    if (unlikely(!cached_type)) goto bad;
    if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
    new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type, 1);
    if (unlikely(new_cached_type != cached_type)) {
        if (unlikely(!new_cached_type)) goto bad;
        Py_DECREF(cached_type);
        cached_type = new_cached_type;
        if (__Pyx_VerifyCachedType(
                cached_type,
                object_name,
                spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    } else {
        Py_DECREF(new_cached_type);
    }
done:
    Py_XDECREF(abi_module);
    Py_DECREF(py_object_name);
    assert(cached_type == NULL || PyType_Check(cached_type));
    return (PyTypeObject *) cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* PyMethodNew */
  #if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
    PyObject *result;
    CYTHON_UNUSED_VAR(typ);
    if (!self)
        return __Pyx_NewRef(func);
    #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    {
        PyObject *args[] = {func, self};
        result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL);
    }
    #else
    result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL);
    #endif
    return result;
}
#else
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
    CYTHON_UNUSED_VAR(typ);
    if (!self)
        return __Pyx_NewRef(func);
    return PyMethod_New(func, self);
}
#endif

/* PyVectorcallFastCallDict */
  #if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL)
static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    PyObject *res = NULL;
    PyObject *kwnames;
    PyObject **newargs;
    PyObject **kwvalues;
    Py_ssize_t i, pos;
    size_t j;
    PyObject *key, *value;
    unsigned long keys_are_strings;
    #if !CYTHON_ASSUME_SAFE_SIZE
    Py_ssize_t nkw = PyDict_Size(kw);
    if (unlikely(nkw == -1)) return NULL;
    #else
    Py_ssize_t nkw = PyDict_GET_SIZE(kw);
    #endif
    newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
    if (unlikely(newargs == NULL)) {
        PyErr_NoMemory();
        return NULL;
    }
    for (j = 0; j < nargs; j++) newargs[j] = args[j];
    kwnames = PyTuple_New(nkw);
    if (unlikely(kwnames == NULL)) {
        PyMem_Free(newargs);
        return NULL;
    }
    kwvalues = newargs + nargs;
    pos = i = 0;
    keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
    while (PyDict_Next(kw, &pos, &key, &value)) {
        keys_are_strings &=
        #if CYTHON_COMPILING_IN_LIMITED_API
            PyType_GetFlags(Py_TYPE(key));
        #else
            Py_TYPE(key)->tp_flags;
        #endif
        Py_INCREF(key);
        Py_INCREF(value);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup;
        #else
        PyTuple_SET_ITEM(kwnames, i, key);
        #endif
        kwvalues[i] = value;
        i++;
    }
    if (unlikely(!keys_are_strings)) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        goto cleanup;
    }
    res = vc(func, newargs, nargs, kwnames);
cleanup:
    Py_DECREF(kwnames);
    for (i = 0; i < nkw; i++)
        Py_DECREF(kwvalues[i]);
    PyMem_Free(newargs);
    return res;
}
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    Py_ssize_t kw_size =
        likely(kw == NULL) ?
        0 :
#if !CYTHON_ASSUME_SAFE_SIZE
        PyDict_Size(kw);
#else
        PyDict_GET_SIZE(kw);
#endif
    if (kw_size == 0) {
        return vc(func, args, nargs, NULL);
    }
#if !CYTHON_ASSUME_SAFE_SIZE
    else if (unlikely(kw_size == -1)) {
        return NULL;
    }
#endif
    return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
}
#endif

/* CythonFunctionShared */
  #if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) {
    if (__Pyx_CyFunction_Check(func)) {
        return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc;
    } else if (PyCFunction_Check(func)) {
        return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
    if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) {
        int result;
        PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func);
        if (unlikely(!newFunc)) {
            PyErr_Clear(); // It's only an optimization, so don't throw an error
            return 0;
        }
        result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc);
        Py_DECREF(newFunc);
        return result;
    }
    return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc);
}
#else
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
    if (PyMethod_Check(func)) {
        func = PyMethod_GET_FUNCTION(func);
    }
    return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
}
#endif
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    __Pyx_Py_XDECREF_SET(
        __Pyx_CyFunction_GetClassObj(f),
            ((classobj) ? __Pyx_NewRef(classobj) : NULL));
#else
    __Pyx_Py_XDECREF_SET(
        ((PyCMethodObject *) (f))->mm_class,
        (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
#endif
}
static PyObject *
__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_doc == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_doc = PyObject_GetAttrString(op->func, "__doc__");
        if (unlikely(!op->func_doc)) return NULL;
#else
        if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
            op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
#endif
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) {
    PyObject *result;
    CYTHON_UNUSED_VAR(closure);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_doc_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_doc, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_name == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_name = PyObject_GetAttrString(op->func, "__name__");
#else
        op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
{
    PyObject *result = NULL;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_name_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_name, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    PyObject *result;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    Py_INCREF(op->func_qualname);
    result = op->func_qualname;
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_qualname, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_dict_locked(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    PyObject *result;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_dict_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_dict, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(op);
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
                 "currently affect the values used in function calls", 1);
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults_locked(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = NULL;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_defaults_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
                 "currently affect the values used in function calls", 1);
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults_locked(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_kwdefaults_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value || value == Py_None) {
        value = NULL;
    } else if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_annotations, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) {
    PyObject* result = op->func_annotations;
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) {
    PyObject *result;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_annotations_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static PyObject *
__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) {
    int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
    if (is_coroutine) {
        PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine;
        fromlist = PyList_New(1);
        if (unlikely(!fromlist)) return NULL;
        Py_INCREF(marker);
#if CYTHON_ASSUME_SAFE_MACROS
        PyList_SET_ITEM(fromlist, 0, marker);
#else
        if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
            Py_DECREF(marker);
            Py_DECREF(fromlist);
            return NULL;
        }
#endif
        module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0);
        Py_DECREF(fromlist);
        if (unlikely(!module)) goto ignore;
        is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker);
        Py_DECREF(module);
        if (likely(is_coroutine_value)) {
            return is_coroutine_value;
        }
ignore:
        PyErr_Clear();
    }
    return __Pyx_PyBool_FromLong(is_coroutine);
}
static PyObject *
__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
    PyObject *result;
    CYTHON_UNUSED_VAR(context);
    if (op->func_is_coroutine) {
        return __Pyx_NewRef(op->func_is_coroutine);
    }
    result = __Pyx_CyFunction_get_is_coroutine_value(op);
    if (unlikely(!result))
        return NULL;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    if (op->func_is_coroutine) {
        Py_DECREF(result);
        result = __Pyx_NewRef(op->func_is_coroutine);
    } else {
        op->func_is_coroutine = __Pyx_NewRef(result);
    }
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static void __Pyx_CyFunction_raise_argument_count_error(__pyx_CyFunctionObject *func, const char* message, Py_ssize_t size) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
    if (!py_name) return;
    PyErr_Format(PyExc_TypeError,
        "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
        py_name, message, size);
    Py_DECREF(py_name);
#else
    const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
    PyErr_Format(PyExc_TypeError,
        "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
        name, message, size);
#endif
}
static void __Pyx_CyFunction_raise_type_error(__pyx_CyFunctionObject *func, const char* message) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
    if (!py_name) return;
    PyErr_Format(PyExc_TypeError,
        "%.200S() %s",
        py_name, message);
    Py_DECREF(py_name);
#else
    const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
    PyErr_Format(PyExc_TypeError,
        "%.200s() %s",
        name, message);
#endif
}
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *
__Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) {
    CYTHON_UNUSED_VAR(context);
    return PyObject_GetAttrString(op->func, "__module__");
}
static int
__Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    return PyObject_SetAttrString(op->func, "__module__", value);
}
#endif
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {"__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
#endif
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
#if !CYTHON_COMPILING_IN_LIMITED_API
    {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
#endif
    {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
#if CYTHON_METH_FASTCALL
#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API
    {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
#else
    {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
#else
    {"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
#endif
#endif
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
{
    PyObject *result = NULL;
    CYTHON_UNUSED_VAR(args);
    __Pyx_BEGIN_CRITICAL_SECTION(m);
    Py_INCREF(m->func_qualname);
    result = m->func_qualname;
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
                                       PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
#if !CYTHON_COMPILING_IN_LIMITED_API
    PyCFunctionObject *cf = (PyCFunctionObject*) op;
#endif
    if (unlikely(op == NULL))
        return NULL;
#if CYTHON_COMPILING_IN_LIMITED_API
    op->func = PyCFunction_NewEx(ml, (PyObject*)op, module);
    if (unlikely(!op->func)) return NULL;
#endif
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
#if !CYTHON_COMPILING_IN_LIMITED_API
    cf->m_ml = ml;
    cf->m_self = (PyObject *) op;
#endif
    Py_XINCREF(closure);
    op->func_closure = closure;
#if !CYTHON_COMPILING_IN_LIMITED_API
    Py_XINCREF(module);
    cf->m_module = module;
#endif
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    op->func_classobj = NULL;
#else
    ((PyCMethodObject*)op)->mm_class = NULL;
#endif
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    op->func_is_coroutine = NULL;
#if CYTHON_METH_FASTCALL
    switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
    case METH_NOARGS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
        break;
    case METH_O:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
        break;
    case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
        break;
    case METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
        break;
    case METH_VARARGS | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = NULL;
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        Py_DECREF(op);
        return NULL;
    }
#endif
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(m->func);
#else
    Py_CLEAR(((PyCFunctionObject*)m)->m_module);
#endif
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
#if !CYTHON_COMPILING_IN_LIMITED_API
#if PY_VERSION_HEX < 0x030900B1
    Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
#else
    {
        PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
        ((PyCMethodObject *) (m))->mm_class = NULL;
        Py_XDECREF(cls);
    }
#endif
#endif
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    Py_CLEAR(m->func_is_coroutine);
    Py_CLEAR(m->defaults);
    return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    __Pyx_PyHeapTypeObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    __Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    {
        int e = __Pyx_call_type_traverse((PyObject*)m, 1, visit, arg);
        if (e) return e;
    }
    Py_VISIT(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(m->func);
#else
    Py_VISIT(((PyCFunctionObject*)m)->m_module);
#endif
    Py_VISIT(m->func_dict);
    __Pyx_VISIT_CONST(m->func_name);
    __Pyx_VISIT_CONST(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    __Pyx_VISIT_CONST(m->func_code);
#if !CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
#endif
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    Py_VISIT(m->func_is_coroutine);
    Py_VISIT(m->defaults);
    return 0;
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
    PyObject *repr;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    repr = PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
    __Pyx_END_CRITICAL_SECTION();
    return repr;
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *f = ((__pyx_CyFunctionObject*)func)->func;
    PyCFunction meth;
    int flags;
    meth = PyCFunction_GetFunction(f);
    if (unlikely(!meth)) return NULL;
    flags = PyCFunction_GetFlags(f);
    if (unlikely(flags < 0)) return NULL;
#else
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    int flags = f->m_ml->ml_flags;
#endif
    Py_ssize_t size;
    switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)(void(*)(void))meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_SIZE
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 0))
                return (*meth)(self, NULL);
            __Pyx_CyFunction_raise_argument_count_error(
                (__pyx_CyFunctionObject*)func,
                "takes no arguments", size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_SIZE
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
                #endif
                result = (*meth)(self, arg0);
                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                Py_DECREF(arg0);
                #endif
                return result;
            }
            __Pyx_CyFunction_raise_argument_count_error(
                (__pyx_CyFunctionObject*)func,
                "takes exactly one argument", size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        return NULL;
    }
    __Pyx_CyFunction_raise_type_error(
        (__pyx_CyFunctionObject*)func, "takes no keyword arguments");
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *self, *result;
#if CYTHON_COMPILING_IN_LIMITED_API
    self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func);
    if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
    self = ((PyCFunctionObject*)func)->m_self;
#endif
    result = __Pyx_CyFunction_CallMethod(func, self, arg, kw);
    return result;
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL)
     __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
    if (vc) {
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
        return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
#else
        (void) &__Pyx_PyVectorcall_FastCallDict;
        return PyVectorcall_Call(func, args, kw);
#endif
    }
#endif
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
#if CYTHON_ASSUME_SAFE_SIZE
        argc = PyTuple_GET_SIZE(args);
#else
        argc = PyTuple_Size(args);
        if (unlikely(argc < 0)) return NULL;
#endif
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (unlikely(!new_args))
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (unlikely(!self)) {
            Py_DECREF(new_args);
            PyErr_Format(PyExc_TypeError,
                         "unbound method %.200S() needs an argument",
                         cyfunc->func_qualname);
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL)
static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
{
    int ret = 0;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        if (unlikely(nargs < 1)) {
            __Pyx_CyFunction_raise_type_error(
                cyfunc, "needs an argument");
            return -1;
        }
        ret = 1;
    }
    if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) {
        __Pyx_CyFunction_raise_type_error(
            cyfunc, "takes no keyword arguments");
        return -1;
    }
    return ret;
}
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 0)) {
        __Pyx_CyFunction_raise_argument_count_error(
            cyfunc, "takes no arguments", nargs);
        return NULL;
    }
    return meth(self, NULL);
}
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 1)) {
        __Pyx_CyFunction_raise_argument_count_error(
            cyfunc, "takes exactly one argument", nargs);
        return NULL;
    }
    return meth(self, args[0]);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))meth)(self, args, nargs, kwnames);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, (size_t)nargs, kwnames);
}
#endif
static PyType_Slot __pyx_CyFunctionType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
    {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
    {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
    {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
    {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
    {Py_tp_methods, (void *)__pyx_CyFunction_methods},
    {Py_tp_members, (void *)__pyx_CyFunction_members},
    {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
    {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
    {0, 0},
};
static PyType_Spec __pyx_CyFunctionType_spec = {
    __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
    Py_TPFLAGS_METHOD_DESCRIPTOR |
#endif
#if CYTHON_METH_FASTCALL
#if defined(Py_TPFLAGS_HAVE_VECTORCALL)
    Py_TPFLAGS_HAVE_VECTORCALL |
#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL)
    _Py_TPFLAGS_HAVE_VECTORCALL |
#endif
#endif // CYTHON_METH_FASTCALL
#if PY_VERSION_HEX >= 0x030A0000
    Py_TPFLAGS_IMMUTABLETYPE |
#endif
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
    __pyx_CyFunctionType_slots
};
static int __pyx_CyFunction_init(PyObject *module) {
    __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
    mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL);
    if (unlikely(mstate->__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type);
    if (unlikely(!m->defaults))
        return NULL;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* CythonFunction */
  static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    PyObject *op = __Pyx_CyFunction_Init(
        PyObject_GC_New(__pyx_CyFunctionObject, __pyx_mstate_global->__pyx_CyFunctionType),
        ml, flags, qualname, closure, module, globals, code
    );
    if (likely(op)) {
        PyObject_GC_Track(op);
    }
    return op;
}

/* ClassMethod */
  static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM <= 0x05080000
    if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) {
        return PyClassMethod_New(method);
    }
#else
#if CYTHON_COMPILING_IN_PYPY
    if (PyMethodDescr_Check(method))
#else
    if (__Pyx_TypeCheck(method, &PyMethodDescr_Type))
#endif
    {
#if CYTHON_COMPILING_IN_LIMITED_API
        return PyErr_Format(
            PyExc_SystemError,
            "Cython cannot yet handle classmethod on a MethodDescriptorType (%S) in limited API mode. "
            "This is most likely a classmethod in a cdef class method with binding=False. "
            "Try setting 'binding' to True.",
            method);
#elif CYTHON_COMPILING_IN_GRAAL
        PyTypeObject *d_type = PyDescrObject_GetType(method);
        return PyDescr_NewClassMethod(d_type, PyMethodDescrObject_GetMethod(method));
#else
        PyMethodDescrObject *descr = (PyMethodDescrObject *)method;
        PyTypeObject *d_type = descr->d_common.d_type;
        return PyDescr_NewClassMethod(d_type, descr->d_method);
#endif
    }
#endif
#if !CYTHON_COMPILING_IN_LIMITED_API
    else if (PyMethod_Check(method)) {
        return PyClassMethod_New(PyMethod_GET_FUNCTION(method));
    }
    else {
        return PyClassMethod_New(method);
    }
#else
    {
        PyObject *func=NULL;
        PyObject *builtins, *classmethod, *classmethod_str, *result=NULL;
        if (__Pyx_TypeCheck(method, __pyx_mstate_global->__Pyx_CachedMethodType)) {
            func = PyObject_GetAttrString(method, "__func__");
            if (!func) goto bad;
        } else {
            func = method;
            Py_INCREF(func);
        }
        builtins = PyEval_GetBuiltins(); // borrowed
        if (unlikely(!builtins)) goto bad;
        classmethod_str = PyUnicode_FromString("classmethod");
        if (unlikely(!classmethod_str)) goto bad;
        classmethod = PyObject_GetItem(builtins, classmethod_str);
        Py_DECREF(classmethod_str);
        if (unlikely(!classmethod)) goto bad;
        result = PyObject_CallFunctionObjArgs(classmethod, func, NULL);
        Py_DECREF(classmethod);
        bad:
        Py_XDECREF(func);
        return result;
    }
#endif
}

/* GetNameInClass */
  static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) {
    PyObject *result;
    PyObject *dict;
    assert(PyType_Check(nmspace));
#if CYTHON_USE_TYPE_SLOTS
    dict = ((PyTypeObject*)nmspace)->tp_dict;
    Py_XINCREF(dict);
#else
    dict = PyObject_GetAttr(nmspace, __pyx_mstate_global->__pyx_n_u_dict);
#endif
    if (likely(dict)) {
        result = PyObject_GetItem(dict, name);
        Py_DECREF(dict);
        if (result) {
            return result;
        }
    }
    PyErr_Clear();
    __Pyx_GetModuleGlobalNameUncached(result, name);
    return result;
}

/* CLineInTraceback */
  #if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    CYTHON_MAYBE_UNUSED_VAR(tstate);
    if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_mstate_global->__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __Pyx_BEGIN_CRITICAL_SECTION(*cython_runtime_dict);
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, *cython_runtime_dict,
            __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback))
        Py_XINCREF(use_cline);
        __Pyx_END_CRITICAL_SECTION();
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_INCREF(use_cline);
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        (void) PyObject_SetAttr(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False);
    }
    else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    Py_XDECREF(use_cline);
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache */
  static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) {
    __Pyx_CachedCodeObjectType* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
    if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = code_cache->entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) {
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
    (void)__pyx__find_code_object;
    return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss.
#else
    struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count);
    if (old_count < 0) {
        __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
        return NULL;
    }
#endif
    __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line);
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
#endif
    return result;
#endif
}
static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object)
{
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            code_cache->entries = entries;
            code_cache->max_count = 64;
            code_cache->count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
    if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) {
        __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_INCREF(code_object);
        Py_DECREF(tmp);
        return;
    }
    if (code_cache->count == code_cache->max_count) {
        int new_max = code_cache->max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        code_cache->entries = entries;
        code_cache->max_count = new_max;
    }
    for (i=code_cache->count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    code_cache->count++;
    Py_INCREF(code_object);
}
static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) {
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
    (void)__pyx__insert_code_object;
    return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail.
#else
    struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_nonatomic_int_type expected = 0;
    if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) {
        return;
    }
#endif
    __pyx__insert_code_object(code_cache, code_line, code_object);
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN);
#endif
#endif
}

/* AddTraceback */
  #include "compile.h"
#include "frameobject.h"
#include "traceback.h"
#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
                                                       PyObject *firstlineno, PyObject *name) {
    PyObject *replace = NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
    replace = PyObject_GetAttrString(code, "replace");
    if (likely(replace)) {
        PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict);
        Py_DECREF(replace);
        return result;
    }
    PyErr_Clear();
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
    PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
    PyObject *exc_type, *exc_value, *exc_traceback;
    int success = 0;
    if (c_line) {
        (void) __pyx_cfilenm;
        (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
    }
    PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
    code_object = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!code_object) {
        code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
        if (unlikely(!code_object)) goto bad;
        py_py_line = PyLong_FromLong(py_line);
        if (unlikely(!py_py_line)) goto bad;
        py_funcname = PyUnicode_FromString(funcname);
        if (unlikely(!py_funcname)) goto bad;
        dict = PyDict_New();
        if (unlikely(!dict)) goto bad;
        {
            PyObject *old_code_object = code_object;
            code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
            Py_DECREF(old_code_object);
        }
        if (unlikely(!code_object)) goto bad;
        __pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
    } else {
        dict = PyDict_New();
    }
    getframe = PySys_GetObject("_getframe");
    if (unlikely(!getframe)) goto bad;
    if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
    frame = PyEval_EvalCode(code_object, dict, dict);
    if (unlikely(!frame) || frame == Py_None) goto bad;
    success = 1;
  bad:
    PyErr_Restore(exc_type, exc_value, exc_traceback);
    Py_XDECREF(code_object);
    Py_XDECREF(py_py_line);
    Py_XDECREF(py_funcname);
    Py_XDECREF(dict);
    Py_XDECREF(replace);
    if (success) {
        PyTraceBack_Here(
            (struct _frame*)frame);
    }
    Py_XDECREF(frame);
}
#else
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = NULL;
    PyObject *py_funcname = NULL;
    if (c_line) {
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        if (!py_funcname) goto bad;
        funcname = PyUnicode_AsUTF8(py_funcname);
        if (!funcname) goto bad;
    }
    py_code = PyCode_NewEmpty(filename, funcname, py_line);
    Py_XDECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject *ptype, *pvalue, *ptraceback;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) {
            /* If the code object creation fails, then we should clear the
               fetched exception references and propagate the new exception */
            Py_XDECREF(ptype);
            Py_XDECREF(pvalue);
            Py_XDECREF(ptraceback);
            goto bad;
        }
        __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_mstate_global->__pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}
#endif

/* CIntFromPyVerify */
  #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* Declarations */
  #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return ::std::complex< float >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return x + y*(__pyx_t_float_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      __pyx_t_float_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

/* Arithmetic */
  #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
#else
    static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    #if 1
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        if (b.imag == 0) {
            return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else if (fabsf(b.real) >= fabsf(b.imag)) {
            if (b.real == 0 && b.imag == 0) {
                return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
            } else {
                float r = b.imag / b.real;
                float s = (float)(1.0) / (b.real + b.imag * r);
                return __pyx_t_float_complex_from_parts(
                    (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
            }
        } else {
            float r = b.real / b.imag;
            float s = (float)(1.0) / (b.imag + b.real * r);
            return __pyx_t_float_complex_from_parts(
                (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
        }
    }
    #else
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        if (b.imag == 0) {
            return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else {
            float denom = b.real * b.real + b.imag * b.imag;
            return __pyx_t_float_complex_from_parts(
                (a.real * b.real + a.imag * b.imag) / denom,
                (a.imag * b.real - a.real * b.imag) / denom);
        }
    }
    #endif
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrtf(z.real*z.real + z.imag*z.imag);
          #else
            return hypotf(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
            __pyx_t_float_complex z;
            float r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    float denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        return __Pyx_c_prod_float(a, a);
                    case 3:
                        z = __Pyx_c_prod_float(a, a);
                        return __Pyx_c_prod_float(z, a);
                    case 4:
                        z = __Pyx_c_prod_float(a, a);
                        return __Pyx_c_prod_float(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                } else if ((b.imag == 0) && (a.real >= 0)) {
                    z.real = powf(a.real, b.real);
                    z.imag = 0;
                    return z;
                } else if (a.real > 0) {
                    r = a.real;
                    theta = 0;
                } else {
                    r = -a.real;
                    theta = atan2f(0.0, -1.0);
                }
            } else {
                r = __Pyx_c_abs_float(a);
                theta = atan2f(a.imag, a.real);
            }
            lnr = logf(r);
            z_r = expf(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cosf(z_theta);
            z.imag = z_r * sinf(z_theta);
            return z;
        }
    #endif
#endif

/* Declarations */
  #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return ::std::complex< double >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return x + y*(__pyx_t_double_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      __pyx_t_double_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

/* Arithmetic */
  #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
#else
    static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    #if 1
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else if (fabs(b.real) >= fabs(b.imag)) {
            if (b.real == 0 && b.imag == 0) {
                return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
            } else {
                double r = b.imag / b.real;
                double s = (double)(1.0) / (b.real + b.imag * r);
                return __pyx_t_double_complex_from_parts(
                    (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
            }
        } else {
            double r = b.real / b.imag;
            double s = (double)(1.0) / (b.imag + b.real * r);
            return __pyx_t_double_complex_from_parts(
                (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
        }
    }
    #else
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else {
            double denom = b.real * b.real + b.imag * b.imag;
            return __pyx_t_double_complex_from_parts(
                (a.real * b.real + a.imag * b.imag) / denom,
                (a.imag * b.real - a.real * b.imag) / denom);
        }
    }
    #endif
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrt(z.real*z.real + z.imag*z.imag);
          #else
            return hypot(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
            __pyx_t_double_complex z;
            double r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    double denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        return __Pyx_c_prod_double(a, a);
                    case 3:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(z, a);
                    case 4:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                } else if ((b.imag == 0) && (a.real >= 0)) {
                    z.real = pow(a.real, b.real);
                    z.imag = 0;
                    return z;
                } else if (a.real > 0) {
                    r = a.real;
                    theta = 0;
                } else {
                    r = -a.real;
                    theta = atan2(0.0, -1.0);
                }
            } else {
                r = __Pyx_c_abs_double(a);
                theta = atan2(a.imag, a.real);
            }
            lnr = log(r);
            z_r = exp(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cos(z_theta);
            z.imag = z_r * sin(z_theta);
            return z;
        }
    #endif
#endif

/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
  static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        int val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyLong_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (int) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(int) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(int) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        int val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (int) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (int) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (int) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (int) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((int) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((int) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (int) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* CIntFromPy */
  static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyLong_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (long) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(long) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(long) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        long val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (long) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (long) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (long) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (long) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((long) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((long) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (long) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_npy_long(npy_long value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const npy_long neg_one = (npy_long) -1, const_zero = (npy_long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(npy_long) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(npy_long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(npy_long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(npy_long) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(npy_long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(npy_long),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(npy_long));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_Py_intptr_t(Py_intptr_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(Py_intptr_t) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(Py_intptr_t) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(Py_intptr_t));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
  static CYTHON_INLINE Py_intptr_t __Pyx_PyLong_As_Py_intptr_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        Py_intptr_t val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (Py_intptr_t) -1;
        val = __Pyx_PyLong_As_Py_intptr_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(Py_intptr_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(Py_intptr_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Py_intptr_t) >= 2 * PyLong_SHIFT)) {
                            return (Py_intptr_t) (((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(Py_intptr_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Py_intptr_t) >= 3 * PyLong_SHIFT)) {
                            return (Py_intptr_t) (((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(Py_intptr_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Py_intptr_t) >= 4 * PyLong_SHIFT)) {
                            return (Py_intptr_t) (((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (Py_intptr_t) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(Py_intptr_t) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(Py_intptr_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(Py_intptr_t) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (Py_intptr_t) (((Py_intptr_t)-1)*(((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(Py_intptr_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (Py_intptr_t) ((((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (Py_intptr_t) (((Py_intptr_t)-1)*(((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(Py_intptr_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (Py_intptr_t) ((((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (Py_intptr_t) (((Py_intptr_t)-1)*(((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(Py_intptr_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (Py_intptr_t) ((((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(Py_intptr_t) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        Py_intptr_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (Py_intptr_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (Py_intptr_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (Py_intptr_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (Py_intptr_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(Py_intptr_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((Py_intptr_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(Py_intptr_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((Py_intptr_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((Py_intptr_t) 1) << (sizeof(Py_intptr_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (Py_intptr_t) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to Py_intptr_t");
    return (Py_intptr_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to Py_intptr_t");
    return (Py_intptr_t) -1;
}

/* FormatTypeName */
  #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
static __Pyx_TypeName
__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
{
    PyObject *module = NULL, *name = NULL, *result = NULL;
    #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
    name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                               __pyx_mstate_global->__pyx_n_u_qualname);
    #else
    name = PyType_GetQualName(tp);
    #endif
    if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad;
    module = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                               __pyx_mstate_global->__pyx_n_u_module);
    if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad;
    if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) {
        result = name;
        name = NULL;
        goto done;
    }
    result = PyUnicode_FromFormat("%U.%U", module, name);
    if (unlikely(result == NULL)) goto bad;
  done:
    Py_XDECREF(name);
    Py_XDECREF(module);
    return result;
  bad:
    PyErr_Clear();
    if (name) {
        result = name;
        name = NULL;
    } else {
        result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u__6);
    }
    goto done;
}
#endif

/* FastTypeChecks */
  #if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (cls == a || cls == b) return 1;
    mro = cls->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            PyObject *base = PyTuple_GET_ITEM(mro, i);
            if (base == (PyObject *)a || base == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
}
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    if (exc_type1) {
        return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
    } else {
        return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
}
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    assert(PyExceptionClass_Check(exc_type));
    n = PyTuple_GET_SIZE(tuple);
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* SwapException */
  #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_value = exc_info->exc_value;
    exc_info->exc_value = *value;
    if (tmp_value == NULL || tmp_value == Py_None) {
        Py_XDECREF(tmp_value);
        tmp_value = NULL;
        tmp_type = NULL;
        tmp_tb = NULL;
    } else {
        tmp_type = (PyObject*) Py_TYPE(tmp_value);
        Py_INCREF(tmp_type);
        #if CYTHON_COMPILING_IN_CPYTHON
        tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
        Py_XINCREF(tmp_tb);
        #else
        tmp_tb = PyException_GetTraceback(tmp_value);
        #endif
    }
  #elif CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = *type;
    exc_info->exc_value = *value;
    exc_info->exc_traceback = *tb;
  #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
  #endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#endif

/* PyObjectCallMethod1 */
  #if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000)
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
    PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
    Py_DECREF(method);
    return result;
}
#endif
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
#if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    PyObject *args[2] = {obj, arg};
    (void) __Pyx_PyObject_GetMethod;
    (void) __Pyx_PyObject_CallOneArg;
    (void) __Pyx_PyObject_Call2Args;
    return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#else
    PyObject *method = NULL, *result;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_Call2Args(method, obj, arg);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) return NULL;
    return __Pyx__PyObject_CallMethod1(method, arg);
#endif
}

/* ReturnWithStopIteration */
  static void __Pyx__ReturnWithStopIteration(PyObject* value, int async);
static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext) {
    if (value == Py_None) {
        if (async || !iternext)
            PyErr_SetNone(async ? PyExc_StopAsyncIteration : PyExc_StopIteration);
        return;
    }
    __Pyx__ReturnWithStopIteration(value, async);
}
static void __Pyx__ReturnWithStopIteration(PyObject* value, int async) {
#if CYTHON_COMPILING_IN_CPYTHON
    __Pyx_PyThreadState_declare
#endif
    PyObject *exc;
    PyObject *exc_type = async ? PyExc_StopAsyncIteration : PyExc_StopIteration;
#if CYTHON_COMPILING_IN_CPYTHON
    if ((PY_VERSION_HEX >= (0x030C00A6)) || unlikely(PyTuple_Check(value) || PyExceptionInstance_Check(value))) {
        if (PY_VERSION_HEX >= (0x030e00A1)) {
            exc = __Pyx_PyObject_CallOneArg(exc_type, value);
        } else {
            PyObject *args_tuple = PyTuple_New(1);
            if (unlikely(!args_tuple)) return;
            Py_INCREF(value);
            PyTuple_SET_ITEM(args_tuple, 0, value);
            exc = PyObject_Call(exc_type, args_tuple, NULL);
            Py_DECREF(args_tuple);
        }
        if (unlikely(!exc)) return;
    } else {
        Py_INCREF(value);
        exc = value;
    }
    #if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    #if CYTHON_USE_EXC_INFO_STACK
    if (!__pyx_tstate->exc_info->exc_value)
    #else
    if (!__pyx_tstate->exc_type)
    #endif
    {
        Py_INCREF(exc_type);
        __Pyx_ErrRestore(exc_type, exc, NULL);
        return;
    }
    #endif
#else
    exc = __Pyx_PyObject_CallOneArg(exc_type, value);
    if (unlikely(!exc)) return;
#endif
    PyErr_SetObject(exc_type, exc);
    Py_DECREF(exc);
}

/* CoroutineBase */
  #if !CYTHON_COMPILING_IN_LIMITED_API
#include <frameobject.h>
#if PY_VERSION_HEX >= 0x030b00a6 && !defined(PYPY_VERSION)
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
#endif // CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE void
__Pyx_Coroutine_Undelegate(__pyx_CoroutineObject *gen) {
#if CYTHON_USE_AM_SEND
    gen->yieldfrom_am_send = NULL;
#endif
    Py_CLEAR(gen->yieldfrom);
}
static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    CYTHON_UNUSED_VAR(__pyx_tstate);
    __Pyx_ErrFetch(&et, &ev, &tb);
    if (!et) {
        Py_XDECREF(tb);
        Py_XDECREF(ev);
        Py_INCREF(Py_None);
        *pvalue = Py_None;
        return 0;
    }
    if (likely(et == PyExc_StopIteration)) {
        if (!ev) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
        else if (likely(__Pyx_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) {
            #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL
            value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value);
            if (unlikely(!value)) goto limited_api_failure;
            #else
            value = ((PyStopIterationObject *)ev)->value;
            Py_INCREF(value);
            #endif
            Py_DECREF(ev);
        }
        else if (unlikely(PyTuple_Check(ev))) {
            Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(ev);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely(tuple_size < 0)) {
                Py_XDECREF(tb);
                Py_DECREF(ev);
                Py_DECREF(et);
                return -1;
            }
            #endif
            if (tuple_size >= 1) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                value = PyTuple_GET_ITEM(ev, 0);
                Py_INCREF(value);
#elif CYTHON_ASSUME_SAFE_MACROS
                value = PySequence_ITEM(ev, 0);
#else
                value = PySequence_GetItem(ev, 0);
                if (!value) goto limited_api_failure;
#endif
            } else {
                Py_INCREF(Py_None);
                value = Py_None;
            }
            Py_DECREF(ev);
        }
        else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
            value = ev;
        }
        if (likely(value)) {
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = value;
            return 0;
        }
    } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    Py_XDECREF(tb);
    Py_DECREF(et);
#if CYTHON_COMPILING_IN_LIMITED_API
    value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value);
#else
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
#endif
    Py_DECREF(ev);
#if CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(!value)) return -1;
#endif
    *pvalue = value;
    return 0;
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL || !CYTHON_ASSUME_SAFE_MACROS
  limited_api_failure:
    Py_XDECREF(et);
    Py_XDECREF(tb);
    Py_XDECREF(ev);
    return -1;
#endif
}
static CYTHON_INLINE
__Pyx_PySendResult __Pyx_Coroutine_status_from_result(PyObject **retval) {
    if (*retval) {
        return PYGEN_NEXT;
    } else if (likely(__Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, retval) == 0)) {
        return PYGEN_RETURN;
    } else {
        return PYGEN_ERROR;
    }
}
static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
#if PY_VERSION_HEX >= 0x030B00a4
    Py_CLEAR(exc_state->exc_value);
#else
    PyObject *t, *v, *tb;
    t = exc_state->exc_type;
    v = exc_state->exc_value;
    tb = exc_state->exc_traceback;
    exc_state->exc_type = NULL;
    exc_state->exc_value = NULL;
    exc_state->exc_traceback = NULL;
    Py_XDECREF(t);
    Py_XDECREF(v);
    Py_XDECREF(tb);
#endif
}
#define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyRunningError(__pyx_CoroutineObject *gen) {
    const char *msg;
    CYTHON_MAYBE_UNUSED_VAR(gen);
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
        msg = "coroutine already executing";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
        msg = "async generator already executing";
    #endif
    } else {
        msg = "generator already executing";
    }
    PyErr_SetString(PyExc_ValueError, msg);
}
static void __Pyx_Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) {
    CYTHON_MAYBE_UNUSED_VAR(gen);
    CYTHON_MAYBE_UNUSED_VAR(closing);
    #ifdef __Pyx_Coroutine_USED
    if (!closing && __Pyx_Coroutine_Check(gen)) {
        PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
    } else
    #endif
    if (value) {
        #ifdef __Pyx_AsyncGen_USED
        if (__Pyx_AsyncGen_CheckExact(gen))
            PyErr_SetNone(PyExc_StopAsyncIteration);
        else
        #endif
        PyErr_SetNone(PyExc_StopIteration);
    }
}
static
__Pyx_PySendResult __Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, PyObject **result, int closing) {
    __Pyx_PyThreadState_declare
    PyThreadState *tstate;
    __Pyx_ExcInfoStruct *exc_state;
    PyObject *retval;
    assert(__Pyx_Coroutine_get_is_running(self));  // Callers should ensure is_running
    if (unlikely(self->resume_label == -1)) {
        __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
        return PYGEN_ERROR;
    }
#if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    tstate = __pyx_tstate;
#else
    tstate = __Pyx_PyThreadState_Current;
#endif
    exc_state = &self->gi_exc_state;
    if (exc_state->exc_value) {
        #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        #else
        PyObject *exc_tb;
        #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON
        exc_tb = PyException_GetTraceback(exc_state->exc_value);
        #elif PY_VERSION_HEX >= 0x030B00a4
        exc_tb = ((PyBaseExceptionObject*) exc_state->exc_value)->traceback;
        #else
        exc_tb = exc_state->exc_traceback;
        #endif
        if (exc_tb) {
            PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
            PyFrameObject *f = tb->tb_frame;
            assert(f->f_back == NULL);
            #if PY_VERSION_HEX >= 0x030B00A1
            f->f_back = PyThreadState_GetFrame(tstate);
            #else
            Py_XINCREF(tstate->frame);
            f->f_back = tstate->frame;
            #endif
            #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON
            Py_DECREF(exc_tb);
            #endif
        }
        #endif
    }
#if CYTHON_USE_EXC_INFO_STACK
    exc_state->previous_item = tstate->exc_info;
    tstate->exc_info = exc_state;
#else
    if (exc_state->exc_type) {
        __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    } else {
        __Pyx_Coroutine_ExceptionClear(exc_state);
        __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    }
#endif
    retval = self->body(self, tstate, value);
#if CYTHON_USE_EXC_INFO_STACK
    exc_state = &self->gi_exc_state;
    tstate->exc_info = exc_state->previous_item;
    exc_state->previous_item = NULL;
    __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
#endif
    *result = retval;
    if (self->resume_label == -1) {
        return likely(retval) ? PYGEN_RETURN : PYGEN_ERROR;
    }
    return PYGEN_NEXT;
}
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
    CYTHON_UNUSED_VAR(exc_state);
#else
    PyObject *exc_tb;
    #if PY_VERSION_HEX >= 0x030B00a4
    if (!exc_state->exc_value) return;
    exc_tb = PyException_GetTraceback(exc_state->exc_value);
    #else
    exc_tb = exc_state->exc_traceback;
    #endif
    if (likely(exc_tb)) {
        PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
        PyFrameObject *f = tb->tb_frame;
        Py_CLEAR(f->f_back);
        #if PY_VERSION_HEX >= 0x030B00a4
        Py_DECREF(exc_tb);
        #endif
    }
#endif
}
#define __Pyx_Coroutine_MethodReturnFromResult(gen, result, retval, iternext)\
    ((result) == PYGEN_NEXT ? (retval) : __Pyx__Coroutine_MethodReturnFromResult(gen, result, retval, iternext))
static PyObject *
__Pyx__Coroutine_MethodReturnFromResult(PyObject* gen, __Pyx_PySendResult result, PyObject *retval, int iternext) {
    CYTHON_MAYBE_UNUSED_VAR(gen);
    if (likely(result == PYGEN_RETURN)) {
        int is_async = 0;
        #ifdef __Pyx_AsyncGen_USED
        is_async = __Pyx_AsyncGen_CheckExact(gen);
        #endif
        __Pyx_ReturnWithStopIteration(retval, is_async, iternext);
        Py_XDECREF(retval);
    }
    return NULL;
}
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE
PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) {
#if PY_VERSION_HEX <= 0x030A00A1
    return _PyGen_Send(gen, arg);
#else
    PyObject *result;
    if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) {
        if (PyAsyncGen_CheckExact(gen)) {
            assert(result == Py_None);
            PyErr_SetNone(PyExc_StopAsyncIteration);
        }
        else if (result == Py_None) {
            PyErr_SetNone(PyExc_StopIteration);
        }
        else {
#if PY_VERSION_HEX < 0x030d00A1
            _PyGen_SetStopIterationValue(result);
#else
            if (!PyTuple_Check(result) && !PyExceptionInstance_Check(result)) {
                PyErr_SetObject(PyExc_StopIteration, result);
            } else {
                PyObject *exc = __Pyx_PyObject_CallOneArg(PyExc_StopIteration, result);
                if (likely(exc != NULL)) {
                    PyErr_SetObject(PyExc_StopIteration, exc);
                    Py_DECREF(exc);
                }
            }
#endif
        }
        Py_DECREF(result);
        result = NULL;
    }
    return result;
#endif
}
#endif
static CYTHON_INLINE __Pyx_PySendResult
__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen, PyObject** retval) {
    __Pyx_PySendResult result;
    PyObject *val = NULL;
    assert(__Pyx_Coroutine_get_is_running(gen));
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
    result = __Pyx_Coroutine_SendEx(gen, val, retval, 0);
    Py_XDECREF(val);
    return result;
}
#if CYTHON_USE_AM_SEND
static __Pyx_PySendResult
__Pyx_Coroutine_SendToDelegate(__pyx_CoroutineObject *gen, __Pyx_pyiter_sendfunc gen_am_send, PyObject *value, PyObject **retval) {
    PyObject *ret = NULL;
    __Pyx_PySendResult delegate_result, result;
    assert(__Pyx_Coroutine_get_is_running(gen));
    delegate_result = gen_am_send(gen->yieldfrom, value, &ret);
    if (delegate_result == PYGEN_NEXT) {
        assert (ret != NULL);
        *retval = ret;
        return PYGEN_NEXT;
    }
    assert (delegate_result != PYGEN_ERROR || ret == NULL);
    __Pyx_Coroutine_Undelegate(gen);
    result = __Pyx_Coroutine_SendEx(gen, ret, retval, 0);
    Py_XDECREF(ret);
    return result;
}
#endif
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
    PyObject *retval = NULL;
    __Pyx_PySendResult result = __Pyx_Coroutine_AmSend(self, value, &retval);
    return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 0);
}
static __Pyx_PySendResult
__Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval) {
    __Pyx_PySendResult result;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
        *retval = __Pyx_Coroutine_AlreadyRunningError(gen);
        return PYGEN_ERROR;
    }
    #if CYTHON_USE_AM_SEND
    if (gen->yieldfrom_am_send) {
        result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, value, retval);
    } else
    #endif
    if (gen->yieldfrom) {
        PyObject *yf = gen->yieldfrom;
        PyObject *ret;
      #if !CYTHON_USE_AM_SEND
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_AsyncGen_USED
        if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
            ret = __Pyx_async_gen_asend_send(yf, value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON
        if (PyGen_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        if (PyCoro_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
      #endif
        {
            #if !CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x03080000
            if (value == Py_None && PyIter_Check(yf))
                ret = __Pyx_PyIter_Next_Plain(yf);
            else
            #endif
                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_mstate_global->__pyx_n_u_send, value);
        }
        if (likely(ret)) {
            __Pyx_Coroutine_unset_is_running(gen);
            *retval = ret;
            return PYGEN_NEXT;
        }
        result = __Pyx_Coroutine_FinishDelegation(gen, retval);
    } else {
        result = __Pyx_Coroutine_SendEx(gen, value, retval, 0);
    }
    __Pyx_Coroutine_unset_is_running(gen);
    return result;
}
static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
    __Pyx_PySendResult result;
    PyObject *retval = NULL;
    CYTHON_UNUSED_VAR(gen);
    assert(__Pyx_Coroutine_get_is_running(gen));
    #ifdef __Pyx_Generator_USED
    if (__Pyx_Generator_CheckExact(yf)) {
        result = __Pyx_Coroutine_Close(yf, &retval);
    } else
    #endif
    #ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(yf)) {
        result = __Pyx_Coroutine_Close(yf, &retval);
    } else
    if (__Pyx_CoroutineAwait_CheckExact(yf)) {
        result = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf);
    } else
    #endif
    #ifdef __Pyx_AsyncGen_USED
    if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
        retval = __Pyx_async_gen_asend_close(yf, NULL);
        result = PYGEN_RETURN;
    } else
    if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
        retval = __Pyx_async_gen_athrow_close(yf, NULL);
        result = PYGEN_RETURN;
    } else
    #endif
    {
        PyObject *meth;
        result = PYGEN_RETURN;
        meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_close);
        if (unlikely(!meth)) {
            if (unlikely(PyErr_Occurred())) {
                PyErr_WriteUnraisable(yf);
            }
        } else {
            retval = __Pyx_PyObject_CallNoArg(meth);
            Py_DECREF(meth);
            if (unlikely(!retval)) {
                result = PYGEN_ERROR;
            }
        }
    }
    Py_XDECREF(retval);
    return result == PYGEN_ERROR ? -1 : 0;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __Pyx_PySendResult result;
    PyObject *retval = NULL;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    }
    #if CYTHON_USE_AM_SEND
    if (gen->yieldfrom_am_send) {
        result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, Py_None, &retval);
    } else
    #endif
    if (gen->yieldfrom) {
        PyObject *yf = gen->yieldfrom;
        PyObject *ret;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Next(yf);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, Py_None);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && (PY_VERSION_HEX < 0x030A00A3 || !CYTHON_USE_AM_SEND)
        if (PyGen_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL);
        } else
        #endif
            ret = __Pyx_PyIter_Next_Plain(yf);
        if (likely(ret)) {
            __Pyx_Coroutine_unset_is_running(gen);
            return ret;
        }
        result = __Pyx_Coroutine_FinishDelegation(gen, &retval);
    } else {
        result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0);
    }
    __Pyx_Coroutine_unset_is_running(gen);
    return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 1);
}
static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) {
    PyObject *retval = NULL;
    __Pyx_PySendResult result;
    CYTHON_UNUSED_VAR(arg);
    result = __Pyx_Coroutine_Close(self, &retval);
    if (unlikely(result == PYGEN_ERROR))
        return NULL;
    Py_XDECREF(retval);
    Py_RETURN_NONE;
}
static __Pyx_PySendResult
__Pyx_Coroutine_Close(PyObject *self, PyObject **retval) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PySendResult result;
    PyObject *yf;
    int err = 0;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
        *retval = __Pyx_Coroutine_AlreadyRunningError(gen);
        return PYGEN_ERROR;
    }
    yf = gen->yieldfrom;
    if (yf) {
        Py_INCREF(yf);
        err = __Pyx_Coroutine_CloseIter(gen, yf);
        __Pyx_Coroutine_Undelegate(gen);
        Py_DECREF(yf);
    }
    if (err == 0)
        PyErr_SetNone(PyExc_GeneratorExit);
    result = __Pyx_Coroutine_SendEx(gen, NULL, retval, 1);
    if (result == PYGEN_ERROR) {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_Coroutine_unset_is_running(gen);
        if (!__Pyx_PyErr_Occurred()) {
            return PYGEN_RETURN;
        } else if (likely(__Pyx_PyErr_ExceptionMatches2(PyExc_GeneratorExit, PyExc_StopIteration))) {
            __Pyx_PyErr_Clear();
            return PYGEN_RETURN;
        }
        return PYGEN_ERROR;
    } else if (likely(result == PYGEN_RETURN && *retval == Py_None)) {
        __Pyx_Coroutine_unset_is_running(gen);
        return PYGEN_RETURN;
    } else {
        const char *msg;
        Py_DECREF(*retval);
        *retval = NULL;
        if ((0)) {
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_Coroutine_Check(self)) {
            msg = "coroutine ignored GeneratorExit";
        #endif
        #ifdef __Pyx_AsyncGen_USED
        } else if (__Pyx_AsyncGen_CheckExact(self)) {
            msg = "async generator ignored GeneratorExit";
        #endif
        } else {
            msg = "generator ignored GeneratorExit";
        }
        PyErr_SetString(PyExc_RuntimeError, msg);
        __Pyx_Coroutine_unset_is_running(gen);
        return PYGEN_ERROR;
    }
}
static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
                                        PyObject *args, int close_on_genexit) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *yf;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen)))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    yf = gen->yieldfrom;
    if (yf) {
        __Pyx_PySendResult result;
        PyObject *ret;
        Py_INCREF(yf);
        if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
            int err = __Pyx_Coroutine_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Coroutine_Undelegate(gen);
            if (err < 0)
                goto propagate_exception;
            goto throw_here;
        }
        if (0
        #ifdef __Pyx_Generator_USED
            || __Pyx_Generator_CheckExact(yf)
        #endif
        #ifdef __Pyx_Coroutine_USED
            || __Pyx_Coroutine_Check(yf)
        #endif
            ) {
            ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
            ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
        #endif
        } else {
            PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (unlikely(PyErr_Occurred())) {
                    __Pyx_Coroutine_unset_is_running(gen);
                    return NULL;
                }
                __Pyx_Coroutine_Undelegate(gen);
                goto throw_here;
            }
            if (likely(args)) {
                ret = __Pyx_PyObject_Call(meth, args, NULL);
            } else {
                PyObject *cargs[4] = {NULL, typ, val, tb};
                ret = __Pyx_PyObject_FastCall(meth, cargs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
            }
            Py_DECREF(meth);
        }
        Py_DECREF(yf);
        if (ret) {
            __Pyx_Coroutine_unset_is_running(gen);
            return ret;
        }
        result = __Pyx_Coroutine_FinishDelegation(gen, &ret);
        __Pyx_Coroutine_unset_is_running(gen);
        return __Pyx_Coroutine_MethodReturnFromResult(self, result, ret, 0);
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
propagate_exception:
    {
        PyObject *retval = NULL;
        __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, NULL, &retval, 0);
        __Pyx_Coroutine_unset_is_running(gen);
        return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 0);
    }
}
static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
    PyObject *typ;
    PyObject *val = NULL;
    PyObject *tb = NULL;
    if (unlikely(!PyArg_UnpackTuple(args, "throw", 1, 3, &typ, &val, &tb)))
        return NULL;
    return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
}
static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
#if PY_VERSION_HEX >= 0x030B00a4
    Py_VISIT(exc_state->exc_value);
#else
    Py_VISIT(exc_state->exc_type);
    Py_VISIT(exc_state->exc_value);
    Py_VISIT(exc_state->exc_traceback);
#endif
    return 0;
}
static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
    {
        int e = __Pyx_call_type_traverse((PyObject*)gen, 1, visit, arg);
        if (e) return e;
    }
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
}
static int __Pyx_Coroutine_clear(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    Py_CLEAR(gen->closure);
    Py_CLEAR(gen->classobj);
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
    }
#endif
    Py_CLEAR(gen->gi_code);
    Py_CLEAR(gen->gi_frame);
    Py_CLEAR(gen->gi_name);
    Py_CLEAR(gen->gi_qualname);
    Py_CLEAR(gen->gi_modulename);
    return 0;
}
static void __Pyx_Coroutine_dealloc(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject_GC_UnTrack(gen);
    if (gen->gi_weakreflist != NULL)
        PyObject_ClearWeakRefs(self);
    if (gen->resume_label >= 0) {
        PyObject_GC_Track(self);
#if CYTHON_USE_TP_FINALIZE
        if (unlikely(PyObject_CallFinalizerFromDealloc(self)))
#else
        {
            destructor del = __Pyx_PyObject_GetSlot(gen, tp_del, destructor);
            if (del) del(self);
        }
        if (unlikely(Py_REFCNT(self) > 0))
#endif
        {
            return;
        }
        PyObject_GC_UnTrack(self);
    }
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        /* We have to handle this case for asynchronous generators
           right here, because this code has to be between UNTRACK
           and GC_Del. */
        Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
    }
#endif
    __Pyx_Coroutine_clear(self);
    __Pyx_PyHeapTypeObject_GC_Del(gen);
}
#if CYTHON_USE_TP_FINALIZE
static void __Pyx_Coroutine_del(PyObject *self) {
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PyThreadState_declare
    if (gen->resume_label < 0) {
        return;
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
        PyObject *finalizer = agen->ag_finalizer;
        if (finalizer && !agen->ag_closed) {
            PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
            if (unlikely(!res)) {
                PyErr_WriteUnraisable(self);
            } else {
                Py_DECREF(res);
            }
            __Pyx_ErrRestore(error_type, error_value, error_traceback);
            return;
        }
    }
#endif
    if (unlikely(gen->resume_label == 0 && !error_value)) {
#ifdef __Pyx_Coroutine_USED
#ifdef __Pyx_Generator_USED
    if (!__Pyx_Generator_CheckExact(self))
#endif
        {
        PyObject_GC_UnTrack(self);
        if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
            PyErr_WriteUnraisable(self);
        PyObject_GC_Track(self);
        }
#endif
    } else {
        PyObject *retval = NULL;
        __Pyx_PySendResult result = __Pyx_Coroutine_Close(self, &retval);
        if (result == PYGEN_ERROR) {
            PyErr_WriteUnraisable(self);
        } else {
            Py_XDECREF(retval);
        }
    }
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
}
#endif
static PyObject *
__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, void *context)
{
    PyObject *name = self->gi_name;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(self->gi_name, value);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, void *context)
{
    PyObject *name = self->gi_qualname;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(self->gi_qualname, value);
    return 0;
}
static PyObject *
__Pyx__Coroutine_get_frame(__pyx_CoroutineObject *self)
{
#if !CYTHON_COMPILING_IN_LIMITED_API
    PyObject *frame;
    #if PY_VERSION_HEX >= 0x030d0000
    Py_BEGIN_CRITICAL_SECTION(self);
    #endif
    frame = self->gi_frame;
    if (!frame) {
        if (unlikely(!self->gi_code)) {
            Py_RETURN_NONE;
        }
        PyObject *globals = PyDict_New();
        if (unlikely(!globals)) return NULL;
        frame = (PyObject *) PyFrame_New(
            PyThreadState_Get(),            /*PyThreadState *tstate,*/
            (PyCodeObject*) self->gi_code,  /*PyCodeObject *code,*/
            globals,                        /*PyObject *globals,*/
            0                               /*PyObject *locals*/
        );
        Py_DECREF(globals);
        if (unlikely(!frame))
            return NULL;
        if (unlikely(self->gi_frame)) {
            Py_DECREF(frame);
            frame = self->gi_frame;
        } else {
            self->gi_frame = frame;
        }
    }
    Py_INCREF(frame);
    #if PY_VERSION_HEX >= 0x030d0000
    Py_END_CRITICAL_SECTION();
    #endif
    return frame;
#else
    CYTHON_UNUSED_VAR(self);
    Py_RETURN_NONE;
#endif
}
static PyObject *
__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) {
    CYTHON_UNUSED_VAR(context);
    PyObject *frame = self->gi_frame;
    if (frame)
        return __Pyx_NewRef(frame);
    return __Pyx__Coroutine_get_frame(self);
}
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
            PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
    if (unlikely(!gen))
        return NULL;
    return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
}
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    gen->body = body;
    gen->closure = closure;
    Py_XINCREF(closure);
    gen->is_running = 0;
    gen->resume_label = 0;
    gen->classobj = NULL;
    gen->yieldfrom = NULL;
    gen->yieldfrom_am_send = NULL;
    #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_LIMITED_API
    gen->gi_exc_state.exc_value = NULL;
    #else
    gen->gi_exc_state.exc_type = NULL;
    gen->gi_exc_state.exc_value = NULL;
    gen->gi_exc_state.exc_traceback = NULL;
    #endif
#if CYTHON_USE_EXC_INFO_STACK
    gen->gi_exc_state.previous_item = NULL;
#endif
    gen->gi_weakreflist = NULL;
    Py_XINCREF(qualname);
    gen->gi_qualname = qualname;
    Py_XINCREF(name);
    gen->gi_name = name;
    Py_XINCREF(module_name);
    gen->gi_modulename = module_name;
    Py_XINCREF(code);
    gen->gi_code = code;
    gen->gi_frame = NULL;
    PyObject_GC_Track(gen);
    return gen;
}
static char __Pyx_Coroutine_test_and_set_is_running(__pyx_CoroutineObject *gen) {
    char result;
    #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_BEGIN_CRITICAL_SECTION(gen);
    #endif
    result = gen->is_running;
    gen->is_running = 1;
    #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_END_CRITICAL_SECTION();
    #endif
    return result;
}
static void __Pyx_Coroutine_unset_is_running(__pyx_CoroutineObject *gen) {
    #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_BEGIN_CRITICAL_SECTION(gen);
    #endif
    assert(gen->is_running);
    gen->is_running = 0;
    #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_END_CRITICAL_SECTION();
    #endif
}
static char __Pyx_Coroutine_get_is_running(__pyx_CoroutineObject *gen) {
    char result;
    #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_BEGIN_CRITICAL_SECTION(gen);
    #endif
    result = gen->is_running;
    #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_END_CRITICAL_SECTION();
    #endif
    return result;
}
static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure) {
    CYTHON_UNUSED_VAR(closure);
    char result = __Pyx_Coroutine_get_is_running((__pyx_CoroutineObject*)gen);
    if (result) Py_RETURN_TRUE;
    else Py_RETURN_FALSE;
}
#if __PYX_HAS_PY_AM_SEND == 2
static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send) {
    Py_ssize_t ptr_offset = (char*)(type->tp_as_async) - (char*)type;
    if (ptr_offset < 0 || ptr_offset > type->tp_basicsize) {
        return;
    }
    memcpy((void*)static_amsend_methods, (void*)(type->tp_as_async), sizeof(*type->tp_as_async));
    static_amsend_methods->am_send = am_send;
    type->tp_as_async = __Pyx_SlotTpAsAsync(static_amsend_methods);
}
#endif

/* Generator */
  static PyMethodDef __pyx_Generator_methods[] = {
    {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
     PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
     PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
     PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
    {0, 0, 0, 0}
};
static PyMemberDef __pyx_Generator_memberlist[] = {
    {"gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
     PyDoc_STR("object being iterated by 'yield from', or None")},
    {"gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
    {"__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0},
    {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0},
    {0, 0, 0, 0, 0}
};
static PyGetSetDef __pyx_Generator_getsets[] = {
    {"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
     PyDoc_STR("name of the generator"), 0},
    {"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
     PyDoc_STR("qualified name of the generator"), 0},
    {"gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL,
     PyDoc_STR("Frame of the generator"), 0},
    {"gi_running", __Pyx_Coroutine_get_is_running_getter, NULL, NULL, NULL},
    {0, 0, 0, 0, 0}
};
static PyType_Slot __pyx_GeneratorType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc},
    {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse},
    {Py_tp_iter, (void *)PyObject_SelfIter},
    {Py_tp_iternext, (void *)__Pyx_Generator_Next},
    {Py_tp_methods, (void *)__pyx_Generator_methods},
    {Py_tp_members, (void *)__pyx_Generator_memberlist},
    {Py_tp_getset, (void *)__pyx_Generator_getsets},
    {Py_tp_getattro, (void *) PyObject_GenericGetAttr},
#if CYTHON_USE_TP_FINALIZE
    {Py_tp_finalize, (void *)__Pyx_Coroutine_del},
#endif
#if __PYX_HAS_PY_AM_SEND == 1
    {Py_am_send, (void *)__Pyx_Coroutine_AmSend},
#endif
    {0, 0},
};
static PyType_Spec __pyx_GeneratorType_spec = {
    __PYX_TYPE_MODULE_PREFIX "generator",
    sizeof(__pyx_CoroutineObject),
    0,
#if PY_VERSION_HEX >= 0x030A0000
    Py_TPFLAGS_IMMUTABLETYPE |
#endif
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE | __Pyx_TPFLAGS_HAVE_AM_SEND,
    __pyx_GeneratorType_slots
};
#if __PYX_HAS_PY_AM_SEND == 2
static __Pyx_PyAsyncMethodsStruct __pyx_Generator_as_async;
#endif
static int __pyx_Generator_init(PyObject *module) {
    __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
    mstate->__pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL);
    if (unlikely(!mstate->__pyx_GeneratorType)) {
        return -1;
    }
#if __PYX_HAS_PY_AM_SEND == 2
    __Pyx_SetBackportTypeAmSend(mstate->__pyx_GeneratorType, &__pyx_Generator_as_async, &__Pyx_Coroutine_AmSend);
#endif
    return 0;
}
static PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *retval = NULL;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    }
    __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0);
    __Pyx_Coroutine_unset_is_running(gen);
    (void) result;
    assert (result == PYGEN_RETURN || result == PYGEN_ERROR);
    assert ((result == PYGEN_RETURN && retval != NULL) || (result == PYGEN_ERROR && retval == NULL));
    return retval;
}

/* GetRuntimeVersion */
  static unsigned long __Pyx_get_runtime_version(void) {
#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
    return Py_Version & ~0xFFUL;
#else
    static unsigned long __Pyx_cached_runtime_version = 0;
    if (__Pyx_cached_runtime_version == 0) {
        const char* rt_version = Py_GetVersion();
        unsigned long version = 0;
        unsigned long factor = 0x01000000UL;
        unsigned int digit = 0;
        int i = 0;
        while (factor) {
            while ('0' <= rt_version[i] && rt_version[i] <= '9') {
                digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
                ++i;
            }
            version += factor * digit;
            if (rt_version[i] != '.')
                break;
            digit = 0;
            factor >>= 8;
            ++i;
        }
        __Pyx_cached_runtime_version = version;
    }
    return __Pyx_cached_runtime_version;
#endif
}

/* CheckBinaryVersion */
  static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
    const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
    if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
        return 0;
    if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
        return 1;
    {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compile time Python version %d.%d "
                      "of module '%.100s' "
                      "%s "
                      "runtime version %d.%d",
                       (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
                       __Pyx_MODULE_NAME,
                       (allow_newer) ? "was newer than" : "does not match",
                       (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
       );
        return PyErr_WarnEx(NULL, message, 1);
    }
}

/* NewCodeObj */
  #if CYTHON_COMPILING_IN_LIMITED_API
    static PyObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
                                       PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                       PyObject *fv, PyObject *cell, PyObject* fn,
                                       PyObject *name, int fline, PyObject *lnos) {
        PyObject *exception_table = NULL;
        PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
        #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
        PyObject *version_info;
        PyObject *py_minor_version = NULL;
        #endif
        long minor_version = 0;
        PyObject *type, *value, *traceback;
        PyErr_Fetch(&type, &value, &traceback);
        #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
        minor_version = 11;
        #else
        if (!(version_info = PySys_GetObject("version_info"))) goto end;
        if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
        minor_version = PyLong_AsLong(py_minor_version);
        Py_DECREF(py_minor_version);
        if (minor_version == -1 && PyErr_Occurred()) goto end;
        #endif
        if (!(types_module = PyImport_ImportModule("types"))) goto end;
        if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
        if (minor_version <= 7) {
            (void)p;
            result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOOO", a, k, l, s, f, code,
                          c, n, v, fn, name, fline, lnos, fv, cell);
        } else if (minor_version <= 10) {
            result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOOO", a,p, k, l, s, f, code,
                          c, n, v, fn, name, fline, lnos, fv, cell);
        } else {
            if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
            result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOOOO", a,p, k, l, s, f, code,
                          c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
        }
    end:
        Py_XDECREF(code_type);
        Py_XDECREF(exception_table);
        Py_XDECREF(types_module);
        if (type) {
            PyErr_Restore(type, value, traceback);
        }
        return result;
    }
#elif PY_VERSION_HEX >= 0x030B0000
  static PyCodeObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
                                         PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                         PyObject *fv, PyObject *cell, PyObject* fn,
                                         PyObject *name, int fline, PyObject *lnos) {
    PyCodeObject *result;
    result =
      #if PY_VERSION_HEX >= 0x030C0000
        PyUnstable_Code_NewWithPosOnlyArgs
      #else
        PyCode_NewWithPosOnlyArgs
      #endif
        (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes);
    return result;
  }
#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY
  #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
static PyObject* __Pyx_PyCode_New(
        const __Pyx_PyCode_New_function_description descr,
        PyObject * const *varnames,
        PyObject *filename,
        PyObject *funcname,
        const char *line_table,
        PyObject *tuple_dedup_map
) {
    PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL, *line_table_bytes = NULL;
    Py_ssize_t var_count = (Py_ssize_t) descr.nlocals;
    PyObject *varnames_tuple = PyTuple_New(var_count);
    if (unlikely(!varnames_tuple)) return NULL;
    for (Py_ssize_t i=0; i < var_count; i++) {
        Py_INCREF(varnames[i]);
        if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done;
    }
    #if CYTHON_COMPILING_IN_LIMITED_API
    varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple);
    if (!varnames_tuple_dedup) {
        if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done;
        varnames_tuple_dedup = varnames_tuple;
    }
    #else
    varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple);
    if (unlikely(!varnames_tuple_dedup)) goto done;
    #endif
    #if CYTHON_AVOID_BORROWED_REFS
    Py_INCREF(varnames_tuple_dedup);
    #endif
    if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL
        && !CYTHON_COMPILING_IN_GRAAL) {
        line_table_bytes = PyBytes_FromStringAndSize(line_table, descr.line_table_length);
        if (unlikely(!line_table_bytes)) goto done;
        Py_ssize_t code_len = (descr.line_table_length * 2 + 4) & ~3;
        code_bytes = PyBytes_FromStringAndSize(NULL, code_len);
        if (unlikely(!code_bytes)) goto done;
        char* c_code_bytes = PyBytes_AsString(code_bytes);
        if (unlikely(!c_code_bytes)) goto done;
        memset(c_code_bytes, 0, (size_t) code_len);
    }
    code_obj = (PyObject*) __Pyx__PyCode_New(
        (int) descr.argcount,
        (int) descr.num_posonly_args,
        (int) descr.num_kwonly_args,
        (int) descr.nlocals,
        0,
        (int) descr.flags,
        code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes,
        __pyx_mstate_global->__pyx_empty_tuple,
        __pyx_mstate_global->__pyx_empty_tuple,
        varnames_tuple_dedup,
        __pyx_mstate_global->__pyx_empty_tuple,
        __pyx_mstate_global->__pyx_empty_tuple,
        filename,
        funcname,
        (int) descr.first_line,
        (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table_bytes) ? line_table_bytes : __pyx_mstate_global->__pyx_empty_bytes
    );
done:
    Py_XDECREF(code_bytes);
    Py_XDECREF(line_table_bytes);
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(varnames_tuple_dedup);
    #endif
    Py_DECREF(varnames_tuple);
    return code_obj;
}

/* InitStrings */
  static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names) {
    while (t->s) {
        PyObject *str;
        if (t->is_unicode) {
            if (t->intern) {
                str = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                str = PyUnicode_Decode(t->s, t->n - 1, encoding_names[t->encoding], NULL);
            } else {
                str = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            str = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        if (!str)
            return -1;
        *target = str;
        if (PyObject_Hash(str) == -1)
            return -1;
        ++t;
        ++target;
    }
    return 0;
}

#include <string.h>
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
    size_t len = strlen(s);
    if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
        PyErr_SetString(PyExc_OverflowError, "byte string is too long");
        return -1;
    }
    return (Py_ssize_t) len;
}
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
}
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return PyByteArray_FromStringAndSize(c_str, len);
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if CYTHON_COMPILING_IN_LIMITED_API
    {
        const char* result;
        Py_ssize_t unicode_length;
        CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
        if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL;
        #else
        result = PyUnicode_AsUTF8AndSize(o, length);
        #endif
        #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        unicode_length = PyUnicode_GetLength(o);
        if (unlikely(unicode_length < 0)) return NULL;
        if (unlikely(unicode_length != *length)) {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
        #endif
        return result;
    }
#else
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
#endif
}
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
    if (PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
    if (PyByteArray_Check(o)) {
#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)))
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
#else
        *length = PyByteArray_Size(o);
        if (*length == -1) return NULL;
        return PyByteArray_AsString(o);
#endif
    } else
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
    int retval;
    if (unlikely(!x)) return -1;
    retval = __Pyx_PyObject_IsTrue(x);
    Py_DECREF(x);
    return retval;
}
static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) {
    __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result));
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ").  "
                "The ability to return an instance of a strict subclass of int is deprecated, "
                "and may be removed in a future version of Python.",
                result_type_name)) {
            __Pyx_DECREF_TypeName(result_type_name);
            Py_DECREF(result);
            return NULL;
        }
        __Pyx_DECREF_TypeName(result_type_name);
        return result;
    }
    PyErr_Format(PyExc_TypeError,
                 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")",
                 result_type_name);
    __Pyx_DECREF_TypeName(result_type_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  PyObject *res = NULL;
  if (likely(PyLong_Check(x)))
      return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  if (likely(m && m->nb_int)) {
      res = m->nb_int(x);
  }
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
      res = PyNumber_Long(x);
  }
#endif
  if (likely(res)) {
      if (unlikely(!PyLong_CheckExact(res))) {
          return __Pyx_PyNumber_LongWrongResultType(res);
      }
  }
  else if (!PyErr_Occurred()) {
      PyErr_SetString(PyExc_TypeError,
                      "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(__Pyx_PyLong_IsCompact(b))) {
        return __Pyx_PyLong_CompactValue(b);
    } else {
      const digit* digits = __Pyx_PyLong_Digits(b);
      const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyLong_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
    return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
  } else {
    Py_ssize_t ival;
    PyObject *x;
    x = PyNumber_Index(o);
    if (!x) return -1;
    ival = PyLong_AsLong(x);
    Py_DECREF(x);
    return ival;
  }
}
static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) {
    CYTHON_UNUSED_VAR(b);
    return __Pyx_NewRef(Py_None);
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) {
    return PyLong_FromSize_t(ival);
}


  /* MultiPhaseInitModuleState */
  #if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000)
  #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1
#else
  #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
#endif
#endif
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS
#error "Module state with PEP489 requires atomics. Currently that's one of\
 C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics"
#endif
#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
#define __Pyx_ModuleStateLookup_Lock()
#define __Pyx_ModuleStateLookup_Unlock()
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
static PyMutex __Pyx_ModuleStateLookup_mutex = {0};
#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex)
#elif defined(__cplusplus) && __cplusplus >= 201103L
#include <mutex>
static std::mutex __Pyx_ModuleStateLookup_mutex;
#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock()
#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock()
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__)
#include <threads.h>
static mtx_t __Pyx_ModuleStateLookup_mutex;
static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT;
static void __Pyx_ModuleStateLookup_initialize_mutex(void) {
    mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain);
}
#define __Pyx_ModuleStateLookup_Lock()\
  call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\
  mtx_lock(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex)
#elif defined(HAVE_PTHREAD_H)
#include <pthread.h>
static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER;
#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex)
#elif defined(_WIN32)
#include <Windows.h>  // synchapi.h on its own doesn't work
static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT;
#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
#else
#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\
 Requires C standard >= C11, or C++ standard >= C++11,\
 or pthreads, or the Windows 32 API, or Python >= 3.13."
#endif
typedef struct {
    int64_t id;
    PyObject *module;
} __Pyx_InterpreterIdAndModule;
typedef struct {
    char interpreter_id_as_index;
    Py_ssize_t count;
    Py_ssize_t allocated;
    __Pyx_InterpreterIdAndModule table[1];
} __Pyx_ModuleStateLookupData;
#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0;
#endif
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
#else
static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
#endif
static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
        __Pyx_InterpreterIdAndModule* table,
        Py_ssize_t count,
        int64_t interpreterId) {
    __Pyx_InterpreterIdAndModule* begin = table;
    __Pyx_InterpreterIdAndModule* end = begin + count;
    if (begin->id == interpreterId) {
        return begin;
    }
    while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
        __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
        if (halfway->id == interpreterId) {
            return halfway;
        }
        if (halfway->id < interpreterId) {
            begin = halfway;
        } else {
            end = halfway;
        }
    }
    for (; begin < end; ++begin) {
        if (begin->id >= interpreterId) return begin;
    }
    return begin;
}
static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) {
    int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
    if (interpreter_id == -1) return NULL;
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
    {
        __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
        if (likely(data)) {
            __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data);
            if (likely(data == new_data)) {
                goto read_finished;
            }
        }
        __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
        __Pyx_ModuleStateLookup_Lock();
        __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter);
        data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
        __Pyx_ModuleStateLookup_Unlock();
    }
  read_finished:;
#else
    __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
#endif
    __Pyx_InterpreterIdAndModule* found = NULL;
    if (unlikely(!data)) goto end;
    if (data->interpreter_id_as_index) {
        if (interpreter_id < data->count) {
            found = data->table+interpreter_id;
        }
    } else {
        found = __Pyx_State_FindModuleStateLookupTableLowerBound(
            data->table, data->count, interpreter_id);
    }
  end:
    {
        PyObject *result=NULL;
        if (found && found->id == interpreter_id) {
            result = found->module;
        }
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
        __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
#endif
        return result;
    }
}
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) {
    while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0);
}
#else
#define __Pyx_ModuleStateLookup_wait_until_no_readers()
#endif
static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) {
    Py_ssize_t to_allocate = (*old_data)->allocated;
    while (to_allocate <= interpreter_id) {
        if (to_allocate == 0) to_allocate = 1;
        else to_allocate *= 2;
    }
    __Pyx_ModuleStateLookupData *new_data = *old_data;
    if (to_allocate != (*old_data)->allocated) {
         new_data = (__Pyx_ModuleStateLookupData *)realloc(
            *old_data,
            sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
        if (!new_data) {
            PyErr_NoMemory();
            return -1;
        }
        for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) {
            new_data->table[i].id = i;
            new_data->table[i].module = NULL;
        }
        new_data->allocated = to_allocate;
    }
    new_data->table[interpreter_id].module = module;
    if (new_data->count < interpreter_id+1) {
        new_data->count = interpreter_id+1;
    }
    *old_data = new_data;
    return 0;
}
static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) {
    __Pyx_InterpreterIdAndModule *read = data->table;
    __Pyx_InterpreterIdAndModule *write = data->table;
    __Pyx_InterpreterIdAndModule *end = read + data->count;
    for (; read<end; ++read) {
        if (read->module) {
            write->id = read->id;
            write->module = read->module;
            ++write;
        }
    }
    data->count = write - data->table;
    for (; write<end; ++write) {
        write->id = 0;
        write->module = NULL;
    }
    data->interpreter_id_as_index = 0;
}
static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) {
    int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
    if (interpreter_id == -1) return -1;
    int result = 0;
    __Pyx_ModuleStateLookup_Lock();
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *)
            __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
#else
    __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
#endif
    __Pyx_ModuleStateLookupData *new_data = old_data;
    if (!new_data) {
        new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData));
        if (!new_data) {
            result = -1;
            PyErr_NoMemory();
            goto end;
        }
        new_data->allocated = 1;
        new_data->interpreter_id_as_index = 1;
    }
    __Pyx_ModuleStateLookup_wait_until_no_readers();
    if (new_data->interpreter_id_as_index) {
        if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
            result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id);
            goto end;
        }
        __Pyx_State_ConvertFromInterpIdAsIndex(new_data);
    }
    {
        Py_ssize_t insert_at = 0;
        {
            __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
                new_data->table, new_data->count, interpreter_id);
            assert(lower_bound);
            insert_at = lower_bound - new_data->table;
            if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) {
                lower_bound->module = module;
                goto end;  // already in table, nothing more to do
            }
        }
        if (new_data->count+1 >= new_data->allocated) {
            Py_ssize_t to_allocate = (new_data->count+1)*2;
            new_data =
                (__Pyx_ModuleStateLookupData*)realloc(
                    new_data,
                    sizeof(__Pyx_ModuleStateLookupData) +
                    (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
            if (!new_data) {
                result = -1;
                new_data = old_data;
                PyErr_NoMemory();
                goto end;
            }
            new_data->allocated = to_allocate;
        }
        ++new_data->count;
        int64_t last_id = interpreter_id;
        PyObject *last_module = module;
        for (Py_ssize_t i=insert_at; i<new_data->count; ++i) {
            int64_t current_id = new_data->table[i].id;
            new_data->table[i].id = last_id;
            last_id = current_id;
            PyObject *current_module = new_data->table[i].module;
            new_data->table[i].module = last_module;
            last_module = current_module;
        }
    }
  end:
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
#else
    __Pyx_ModuleStateLookup_data = new_data;
#endif
    __Pyx_ModuleStateLookup_Unlock();
    return result;
}
static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) {
    int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
    if (interpreter_id == -1) return -1;
    __Pyx_ModuleStateLookup_Lock();
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *)
            __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
#else
    __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
#endif
    if (data->interpreter_id_as_index) {
        if (interpreter_id < data->count) {
            data->table[interpreter_id].module = NULL;
        }
        goto done;
    }
    {
        __Pyx_ModuleStateLookup_wait_until_no_readers();
        __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
            data->table, data->count, interpreter_id);
        if (!lower_bound) goto done;
        if (lower_bound->id != interpreter_id) goto done;
        __Pyx_InterpreterIdAndModule *end = data->table+data->count;
        for (;lower_bound<end-1; ++lower_bound) {
            lower_bound->id = (lower_bound+1)->id;
            lower_bound->module = (lower_bound+1)->module;
        }
    }
    --data->count;
    if (data->count == 0) {
        free(data);
        data = NULL;
    }
  done:
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
#else
    __Pyx_ModuleStateLookup_data = data;
#endif
    __Pyx_ModuleStateLookup_Unlock();
    return 0;
}
#endif

/* #### Code section: utility_code_pragmas_end ### */
#ifdef _MSC_VER
#pragma warning( pop )
#endif



/* #### Code section: end ### */
#endif /* Py_PYTHON_H */
