Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Soumya Chennabasavaraj
    @soumyacbr
    I have trained a transformer model, Now I'm doing the inference. But the inference is stuck after translating some 20 sentences. what could be the problem ? has anyone faced this?. Plus it does not even throw any error. Its just stick after translating 20th sentence.
    Guillaume Klein
    @guillaumekln
    You should probably just let it run. The test file is reordered internally to increase efficiency.
    Soumya Chennabasavaraj
    @soumyacbr
    Yes I left it to run. Finally it did run. Thanks
    Anna Samiotou
    @annasamt_twitter
    Hello, does OpenNMT-tf support protected sequences/placeholders i.e. ⦅URL:http://www.opennmt.net⦆as described in https://opennmt.net/OpenNMT/tools/tokenization/#special-characters? Provided that SP/BPE or unigram is deployed through OpenNTM tokenizer. Thanks in advance
    Guillaume Klein
    @guillaumekln
    Hi, you would need to remove the value part (:http://www.opennmt.net in this example) before calling OpenNMT-tf. The remaining part ⦅URL⦆ will be treated as any other tokens during training/inference.
    Anna Samiotou
    @annasamt_twitter
    OK, thanks.
    Yunès
    @jbyunes
    Hi, I tried to tag (featured) both source and target languages with OpenNMT but didn't succeed. PyTorch just crashed at translation step (training was ok); and TensorFlow docs says that "target_inputter – A opennmt.inputters.Inputter to process the target data. Currently, only the opennmt.inputters.WordEmbedder is supported." which means (to me) that we can't tag the target. How could I try to tag both source and target with OpenNMT ? Is this possible ? May someone help me ?
    Guillaume Klein
    @guillaumekln
    Hi, tags are not supported on the target side in OpenNMT-tf. In OpenNMT-py, there is an open pull request for this feature: OpenNMT/OpenNMT-py#1710
    Yunès
    @jbyunes
    Thanks @guillaumekln. In OpenNMT-py what puzzled me is that the training was perfect (at least no error) but at the translation step it seems that the crash was due to a non uniform word added by the system at the end of the sentence (looks like a end-of-sentence word that is of course? non featured).
    Yunès
    @jbyunes
    @guillaumekln Is it a non-sense to imagine tagging by adding suffix to original words? Do you know if that makes sense? I mean "go_VERB" for example? This would increase the vocab size but does it makes sense or some internals may disturb the processes?
    Guillaume Klein
    @guillaumekln
    As you pointed out the biggest issue is the vocabulary, but if it fits, the model will manage to make sense of your inputs. Alternatively, if your sequences are not too long you could simply merge the 2 streams, e.g. : John NNP goes VRB
    Yunès
    @jbyunes
    @guillaumekln why not ? I will try something like that. Interesting.
    alrudak
    @alrudak
    Is it possible to run one language pair (docker container ) on the first GPU and another language pair on second GPU separately if the server has 2 GPUs ?
    Guillaume Klein
    @guillaumekln
    Sure. Just run 2 separate training processes, each running on a different GPU. You can restrict the GPU visible to each process with this approach: https://opennmt.net/OpenNMT-tf/faq.html#how-can-i-restrict-the-tensorflow-runtime-to-specific-gpu
    alrudak
    @alrudak
    Thanks!
    Sirogha
    @Sirogha
    Hello. I try use Ctranslate2. Can you help me:
    translator.translate_batch([["▁H", "ello", "▁world", "!"]]) --- this function (translate_batch) async or i need parallel algorithm for using it?
    Guillaume Klein
    @guillaumekln
    Hi. This function is synchronous. To run multiple translations in parallel, you can set inter_threads to a larger value and call translate_batch from multiple Python threads.
    If you have more questions regarding CTranslate2, please post in https://gitter.im/OpenNMT/CTranslate2 or in the forum
    Sirogha
    @Sirogha
    Sorry. Thanks!
    rrifaldiu
    @rrifaldiu
    Hello, I want to ask some question about embedding. I wonder how does the Embedding from WordEmbedder class trained? I looked at the source code but still don't understand. And is it possible to export the embedding from the trained WordEmbedder class into the pretrained word embedding format? Thanks in advance
    Edit: As an additional information, I trained my model using the Transformer class
    Rahaf Alnajjar
    @MaryaAI
    Hi, Where I can find a simple web Interfaces source code to implement OpenNMT-tf model??
    Guillaume Klein
    @guillaumekln
    I'm not sure to understand. What are you looking for exactly?
    Rahaf Alnajjar
    @MaryaAI
    I want to deploy my model in a web interface (Are there any tutorials?)
    Guillaume Klein
    @guillaumekln
    There is no tutorial for a web interface. This is not in the scope of the project.
    yutongli
    @yutongli
    Hi @guillaumekln I have trained a good transformer model but I saw some lengthy inference examples. for example, the source query is 10-characters long, but the generated inference by the model can be 200 characters, some portions are just repeating. Is there a way to control the length of the inference to be generated by the transformer model?
    (BTW, I had the sequence_length set to 80 during training. )
    Guillaume Klein
    @guillaumekln
    Hi. Look for maximum_decoding_length in the parameters: https://opennmt.net/OpenNMT-tf/configuration.html. Maybe length_penalty can also help.
    However, when this issue happens it usually means the input was unexpected for the model and the training may lack this type of examples.
    yutongli
    @yutongli
    Hi @guillaumekln , thanks so much for your response, it's very helpful!! Just a couple of quick follow-up questions: 1. I think the maximum_decoding_length and length_penalty are parameters affecting both training and inferencing, am I correct? 2. does the 'length' here refer to the number of characters, the number or subwords, or the number of words?
    Guillaume Klein
    @guillaumekln
    1. They are inference only parameters. 2. The length is the number of tokens, as defined by your tokenization.
    yutongli
    @yutongli
    I see, thanks so much!
    @guillaumekln for another parameter 'maximum_features_length', does the length here also refer to the number of tokens, as defined by the tokenization?
    Guillaume Klein
    @guillaumekln
    Yes, all length parameters are defined in terms of number of tokens.
    yutongli
    @yutongli
    Thank you @guillaumekln !!
    yutongli
    @yutongli
    Hi @guillaumekln I've trained a Transformer model using onmt and have also run infer command to do the inference. all went good. now I have a requirement to bring the model into production which supports tensorflow, so I exported the model into TF SavedModel format (https://opennmt.net/OpenNMT-tf/serving.html). However for the inferencing part, some beam or decoder related parameters may affect the inference latency, such as beam_width, n_best, maximum_decoding_length, how I could incorporate these onmt parameters given an exported TF SavedModel package, in the tensorflow production environment? onmt inferencing refers to a config file where we specify those parameters, would a similar config file needed for doing inference given a SavedModel on a machine where only tensorflow is supported?
    Thanks in advance!
    Guillaume Klein
    @guillaumekln
    Hi. The SavedModel format is a frozen computation graph so you can't change these values. Usually you tune these parameters using the infer command, before running the export.
    yutongli
    @yutongli
    Thanks a lot!
    yutongli
    @yutongli
    Hi @guillaumekln May I have a simple question to confirm with you? For the Transformer model, is beam_width=1 actually the greedy search mode? (meaning no beam search)
    Guillaume Klein
    @guillaumekln
    Hi. That is correct.
    yutongli
    @yutongli
    One additional question @guillaumekln :) I read the comment for the parameter 'sampling_topk': # (optional) Sample predictions from the top K most likely tokens (requires beam_width to 1). If 0, sample from the full output distribution (default: 1).
    My question is: With greedy search model, how should I set "sampling_topk" to maximize the speed?
    Just should be the default value 1, right?
    yutongli
    @yutongli
    Can mixed precision be used in exporting ONMT model to TF SavedModel? or it's only for training?
    yutongli
    @yutongli
    I searched the mixed precision a little bit, seems to me that it's only for training
    Guillaume Klein
    @guillaumekln
    sampling_topk is not about speed but to produce random outputs. Is that what you want to do? If not, you should not set this parameter.
    yutongli
    @yutongli
    thanks! @guillaumekln
    Kristine Mae M. Adlaon
    @kadlaon
    Hi. How can I extract the embeddings of my source and target data after training the model?
    Guillaume Klein
    @guillaumekln
    Kristine Mae M. Adlaon
    @kadlaon
    image.png
    Thank you @guillaumekln ! Got it.