class TensorflowMarian extends Serializable
MarianTransformer: Fast Neural Machine Translation
MarianTransformer uses models trained by MarianNMT.
Marian is an efficient, free Neural Machine Translation framework written in pure C++ with minimal dependencies. It is mainly being developed by the Microsoft Translator team. Many academic (most notably the University of Edinburgh and in the past the Adam Mickiewicz University in Poznań) and commercial contributors help with its development.
It is currently the engine behind the Microsoft Translator Neural Machine Translation services and being deployed by many companies, organizations and research projects (see below for an incomplete list).
Sources : MarianNMT https://marian-nmt.github.io/ Marian: Fast Neural Machine Translation in C++ https://www.aclweb.org/anthology/P18-4020/
- Alphabetic
- By Inheritance
- TensorflowMarian
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
TensorflowMarian(tensorflow: TensorflowWrapper, sppSrc: SentencePieceWrapper, sppTrg: SentencePieceWrapper, configProtoBytes: Option[Array[Byte]] = None, signatures: Option[Map[String, String]] = None)
- tensorflow
LanguageDetectorDL Model wrapper with TensorFlow Wrapper
- sppSrc
Contains the vocabulary for the target language.
- sppTrg
Contains the vocabulary for the source language
- configProtoBytes
Configuration for TensorFlow session
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val _tfMarianSignatures: Map[String, String]
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- def decode(sentences: Array[Array[Int]], vocabsArray: Array[String]): Seq[String]
- def encode(sentences: Seq[Annotation], normalizer: MosesPunctNormalizer, maxSeqLength: Int, vocabsArray: Array[String], langId: Int, unknownTokenId: Int, eosTokenId: Int): Seq[Array[Int]]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
predict(sentences: Seq[Annotation], batchSize: Int = 1, maxInputLength: Int, maxOutputLength: Int, vocabs: Array[String], langId: String, ignoreTokenIds: Array[Int] = Array()): Array[Annotation]
generate seq2seq via encoding, generating, and decoding
generate seq2seq via encoding, generating, and decoding
- sentences
none empty Annotation
- batchSize
size of baches to be process at the same time
- maxInputLength
maximum length for input
- maxOutputLength
maximum length for output
- vocabs
list of all vocabs
- langId
language id for multi-lingual models
- val sppSrc: SentencePieceWrapper
- val sppTrg: SentencePieceWrapper
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- def tag(batch: Seq[Array[Int]], maxOutputLength: Int, paddingTokenId: Int, eosTokenId: Int, vocabSize: Int, ignoreTokenIds: Array[Int] = Array()): Array[Array[Int]]
- val tensorflow: TensorflowWrapper
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()