hengyuan-hu / bottom-up-attention-vqa

An efficient PyTorch implementation of the winning entry of the 2017 VQA Challenge.
GNU General Public License v3.0
753 stars 181 forks source link

the function of period_strip is not clear #14

Closed ZhuFengdaaa closed 6 years ago

ZhuFengdaaa commented 6 years ago

I want to ask what is the term period_strip = re.compile("(?!<=\d)(\.)(?!\d)") used for ? The first brackets ("(?!<=\d) filters out the terms numbers start with <=, which never matches the main regex (\.). Thus the brackets ("(?!<=\d) is useless.

I guess you want to filter out all periods . except the periods in numbers. The correct regex is (?<!\d)(\.)(?!\d)

hengyuan-hu commented 6 years ago

I am actually not sure. This is copied from the official vqa evaluation code. In fact filtering has little effect to the final performance.

On Wed, Apr 4, 2018 at 11:24 PM ZhuFengdaaa notifications@github.com wrote:

I want to ask what is the term period_strip = re.compile("(?!<=\d)(.)(?!\d)") used for ? The first brackets ("(?!<=\d) filters out the terms numbers start with <=, which never matches the main regex (.). Thus the brackets ("(?!<=\d) is useless.

I guess you want to filter out all periods . except the periods in numbers. The correct regex is (?<!\d)(.)(?!\d)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hengyuan-hu/bottom-up-attention-vqa/issues/14, or mute the thread https://github.com/notifications/unsubscribe-auth/AEglZdUvODKqMv9jSp6DxxOaxOtm_3eWks5tlbitgaJpZM4TH6pI .