-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use provided model #5
Comments
Will it be helpful if we provide an example using colab? |
Yes, that would be amazing!! |
I managed to run the inference script (however, evaluation is still throwing an error). You can find my workspace here to have a look. My question is, how can I now pass a new input to the model? I guess evaluation is not that important for now, I just want to see how the model's output might look like to my type of text. The input parameter --input did not work. Thanks! |
I take a quick look. The error is during evaluation, which you said is not important for now.
Remove below line for evaluation, compute rouge score, to avoid the error.
|
I managed to infer on the command line using this fairly simple script I have two questions. When creating the binary files, it replaced a large portion with [UNK].
Is that correct? Also, when predicting, it seems like important words are being replaced by [UNK]. For example: This paragraph We investigate how perceived job riskiness and individual attitudes impact the vocational choice of business graduates. The hypotheses are tested with a sample of 182 similarly qualified students at two European business schools. Participants are randomly allocated to two conditions under which they receive a job-description that highlights job security or job risk. The findings indicate that risk negatively affects employer attractiveness and the inclination to apply. Besides that, the subjective person-job fit has a positive direct impact on employer attractiveness and the inclination to apply. Contrary to the expectations, risk had no significantly stronger effect on women. will be evaluated to [UNK] investigate how perceived job [UNK] and individual attitudes impact the vocational choice of business [UNK] [UNK] [UNK] are tested with a sample of 182 similarly qualified students at two [UNK] business [UNK] [UNK] are randomly allocated to two conditions under which they receive a [UNK] that highlights job security or job [UNK] [UNK] findings indicate that risk negatively affects employer [UNK] and the inclination to [UNK] [UNK] [UNK] the subjective [UNK] fit has a positive direct impact on employer [UNK] and the inclination to [UNK] [UNK] to the [UNK] risk had no significantly stronger effect on [UNK] yielding the hypothesis students are randomly allocated to receive a [UNK] that highlights job security or job [UNK] . [X_SEP] the subjective fit has a positive direct impact on employer [UNK] . [X_SEP] the inclination to [UNK] [UNK] to the [UNK] risk had no significantly stronger effect on [UNK] . This looks quite good, however, the frequency of these tokes seems weird. I guess it's related to the UniLM but I'm quite unsure how to proceed here. |
It missed a preprocess step, which caused many token been replaced by [UNK]. @qiweizhen Could you add a tutorial about "training/inference on own data"? |
Okay I figured. In the UniLM data you linked there were only dev.src/dev.tgt. When creating binaries it threw error valid.src/valid.tgt missing so I changed dev.src/dev.tgt to valid.src/valid.tgt since it was the only one named wrong. Was that correct? Just checked preprocessing without applying changes to provided data. High percentage is still there plus thrown error due to wrong naming. I might have missed running the python script before. I will try that later and tell you what happened. |
You need run below script to do the modify, instead of rename.
|
Yes, I did that last night! Preprocessing replaced 0.0% now, so everything seems fine. But when infering on many texts there seem to be replacements of (sometimes unusual but sometimes quite usual) words. Is that intentional? |
Could you give some examples for this? |
I encountered this story—which is about Taylor Swift clones—when it won the Gulf Coast Barthelme Prize a couple of years ago. The judge was Steve Almond, who wrote, “I tried quite hard to resist choosing “Taylor Swift” as the winner of this year’s Barthelme Award. Why? Because all the stories I received were worthy and many were more technically ambitious when it came to language and form, by which I guess I mean experimental. . . . But what the hell. In the end, I just wanted to read this thing again and again.” Which is exactly right. Whatever you think of the actual Taylor Swift, this story is just plain fun. Transformers have a potential of learning longer-term dependency, but are limited by a fixed-length context in the setting of language modeling. We propose a novel neural architecture Transformer-XL that enables learning dependency beyond a fixed length without disrupting temporal coherence. It consists of a segment-level recurrence mechanism and a novel positional encoding scheme. Our method not only enables capturing longer-term dependency, but also resolves the context fragmentation problem. |
It looks like that you didn't tokenize the provided text into word pieces. For now, tokenizing whole word into word pieces is commonly used to alleviate some vocabulary problems, and you may refer to here. |
@qiweizhen as you said, after
I ran this and the output is 100% identical. It replaces words but I feel like the summarization look ok. Another paragraph: I'm noticing 2 types of replacements:
Wild guess is, word+punct is observed -> not found in dict -> replaced. Merkel was educated at Karl Marx University, Leipzig, where she studied physics from 1973 to 1978. While a student, she participated in the reconstruction of the ruin of the Moritzbastei, a project students initiated to create their own club and recreation facility on campus. Such an initiative was unprecedented in the GDR of that period, and initially resisted by the University; however, with backing of the local leadership of the SED party, the project was allowed to proceed. At school she learned to speak Russian fluently, and was awarded prizes for her proficiency in Russian and mathematics. She was the best in her class in mathematics and Russian, and completed her school education with the best possible average Abitur grade 1.0. |
Hi, I tried your input sentence, whose tokenized text should be like this: |
Hi, had someone faced to problem with numpy during binary trainable files generating?
I am running this script like here:
while generating files I am getting warnings if I use numpy == 1.8 and errors if I use 1.7 In case of numpy 1.8: execution never ends, and shows only warnings :
when i try numpy 1.17 it explicitly shows errors:``(virtenv) C:......\prophetnet\src>bash binary.sh I tried go further with first case, but on inference I got some errors again, and I thought it might be because of this step. Also, I need 1.7 to run another technology If you have questions, please, ask. Any help would be appreciated! |
@yuyan2do Can we get the Colab as you stated earlier. It will be extremely helpful for PyTorch newbies to explore ProphetNet. Thanks |
@gireek Create a Colab tutorial is in our backlog. We will priority this work if more people ask for it. |
I think a Colab tutorial would be really valuable. There were a few unknowns, unanswered questions, and hurdles I had to work through to be able to run. |
I also think a Colab tutorial will be really helpful for us to use the model. As the exact steps that need to be performed are slightly unclear |
I would also like a Colab tutorial please! |
Is there any news about Colab tutorial? It will be really very helpful! =) |
I too am overwhelmed by so many scripts...a working colab notebook with scripts in correct order would make the task very easy to follow. Already about six users have demanded this. Thanks for prioritizing this :) |
Here you provide a ready-to-use model if I understand correctly? How do I use this model? I am having troubles with this as I'm quite new to torch models and fairseq.
Besides that I ran the setup until the tuning but it takes forever even on colab. So I figured there must be a quick way.. Thanks!
The text was updated successfully, but these errors were encountered: