... | ... | @@ -89,3 +89,47 @@ The following parameters are optional. |
|
|
* `--db_name` - defaults to "multimodalDB". The name of the database
|
|
|
|
|
|
## Example Run
|
|
|
|
|
|
Let's assume we have the
|
|
|
* documents as ".txt" files in "../data/documents/"
|
|
|
* "MS COCO train 2014" images as ".jpg" files in "../data/train2014/"
|
|
|
* concreteness values file (which is related to the images) in "../data/concreteness/concretenessValuesMscoco.json"
|
|
|
|
|
|
Further, we want to save the highlighted images in "../data/miniclip/". Since we run the multimodal dataset creation program for the first time (or we use the image set for the first time) we specify that the cached image features are saved in "../data/cache/mscoco_features.pkl".
|
|
|
|
|
|
Then, running
|
|
|
|
|
|
```
|
|
|
python main.py --documents ../data/documents --images ../data/train2014 --mcimages ../data/miniclip --concreteness ../data/concreteness/concretenessValuesMscoco.json --cached_image_features ../data/cache/mscoco_features.pkl
|
|
|
```
|
|
|
|
|
|
will have the same result as
|
|
|
|
|
|
```
|
|
|
python main.py
|
|
|
```
|
|
|
|
|
|
since the values of the parameters are the same as the default values.
|
|
|
|
|
|
Running the program for the first time may take a while because the images have to be preprocessed and encoded by CLIP. The second run with the same image set and the usage of the cached features file should be much faster.
|
|
|
|
|
|
Now, every document in "../data/documents/" that has at least one multimodal sentence is saved in the MongoDB database called "multimodalDB". With
|
|
|
|
|
|
```
|
|
|
mongo localhost:27017
|
|
|
use multimodalDB
|
|
|
```
|
|
|
|
|
|
and
|
|
|
|
|
|
```
|
|
|
db.books.find().pretty()
|
|
|
```
|
|
|
|
|
|
or
|
|
|
|
|
|
```
|
|
|
db.focusSents.find().pretty()
|
|
|
```
|
|
|
|
|
|
you can check the documents/books and the images of the multimodal sentences respectively. |
|
|
\ No newline at end of file |