Repository: acl-org/acl-anthology

Issue:
Ingestion of GURT/SyntaxFest 2023 paper videos 
Hello!

As described in these instructions:
https://github.com/acl-org/acl-anthology/wiki/Ingesting-videos

We have the paper presentation videos uploaded to a Google Drive folder: 
https://drive.google.com/drive/folders/17t0__MEjnBdEmEOC1zKPHSoEiNfsHknN

Please let us know when you are done downloading the videos so we can take them down from Drive.

The folder also contains a tsv file (anthology_id.tsv) with the anthology_id of the papers, but we do not have the videos hosted anywhere externally, so the presentation_url column is blank.

Thank you!



Discussion:
@lauren-lizzy-levine thank you for submitting the videos. We have downloaded them. Ingestion will take sometime.

Resolving patch:
diff --git a/bin/ingest_archive_video.py b/bin/ingest_archive_video.py
--- a/bin/ingest_archive_video.py
+++ b/bin/ingest_archive_video.py
@@ -16,9 +16,9 @@
 # limitations under the License.
 #
 # Usage:
-#   python -v PATH_TO_VIDEO_DIR
+#   python -v PATH_TO_VIDEO_DIR -t mp4
 #
-# Video dir contains a list of videos need to be ingested, for example
+# Video dir contains a list of videos need to be ingested in .mp4 or .mov format, for example
 #
 # videos/
 #    N13-1001.mp4
@@ -73,7 +73,9 @@ def get_collection_ids(video_dir: str, anth_id_style: str) -> List[str]:
     return collection_ids
 
 
-def get_anth_ids(video_dir: str, anth_id_style: str) -> Tuple[List[str], List[List[str]]]:
+def get_anth_ids(
+    video_dir: str, anth_id_style: str, video_type: str
+) -> Tuple[List[str], List[List[str]]]:
     '''
     Go over all the .mp4 files in the video dir and extract two types of anthology ids, which will be used to identify papers that needs video tag.
 
@@ -89,45 +91,45 @@ def get_anth_ids(video_dir: str, anth_id_style: str) -> Tuple[List[str], List[Li
     if anth_id_style == 'old':
         anth_ids_single = [
             file[len(video_dir) :].split('.')[0]
-            for file in glob.glob(f"{video_dir}/*.mp4")
+            for file in glob.glob(f"{video_dir}/*.{video_type}")
             if len(file[len(video_dir) :].split('.')) == 2
         ]
         anth_ids_multiple = [
             file[len(video_dir) :].split('.')[0:-1]
-            for file in glob.glob(f"{video_dir}/*.mp4")
+            for file in glob.glob(f"{video_dir}/*.{video_type}")
             if len(file[len(video_dir) :].split('.')) > 2
         ]
         anth_ids_multiple.sort()
     else:
         anth_ids_single = [
             ('.').join(file[len(video_dir) :].split('.')[:-1])
-            for file in glob.glob(f"{video_dir}/*.mp4")
+            for file in glob.glob(f"{video_dir}/*.{video_type}")
         ]
         # for new anth_id_style, each anth_id can only have one video
         anth_ids_multiple = []
     return anth_ids_single, anth_ids_multiple
 
 
-def add_video_tag_single(anth_id, xml_parse):
+def add_video_tag_single(anth_id, xml_parse, video_type: str):
     '''
     Add video tag for paper f'{anth_id}'
     '''
     collection_id, volume_id, paper_id = deconstruct_anthology_id(anth_id)
     paper = xml_parse.find(f'./volume[@id="{volume_id}"]/paper[@id="{paper_id}"]')
-    video_url = anth_id + '.mp4'
+    video_url = anth_id + f'.{video_type}'
 
     if video_url not in [video.attrib["href"] for video in paper.iter("video")]:
         make_simple_element('video', attrib={'href': video_url}, parent=paper)
 
 
-def add_video_tag_multiple(anth_id, vid_num, xml_parse):
+def add_video_tag_multiple(anth_id, vid_num, xml_parse, video_type: str):
     '''
     Add video tag for paper f`{anth_id}` with multiple number of videos
     Adapted from add_video_tags.py
     '''
     collection_id, volume_id, paper_id = deconstruct_anthology_id(anth_id)
     paper = xml_parse.find(f'./volume[@id="{volume_id}"]/paper[@id="{paper_id}"]')
-    video_url = anth_id + f'.{vid_num}' + '.mp4'
+    video_url = anth_id + f'.{vid_num}' + f'.{video_type}'
     make_simple_element("video", attrib={"href": video_url}, parent=paper)
 
 
@@ -153,7 +155,13 @@ def update_xml(data_dir, collection_id, extention, xml_tree):
     default='new',
     help='Anthology ID style used in the video file names',
 )
-def main(video_dir, anth_id_style):
+@click.option(
+    '-t',
+    '--video_type',
+    default='mp4',
+    help='mp4 or mov file',
+)
+def main(video_dir, anth_id_style, video_type):
     collection_ids = get_collection_ids(video_dir=video_dir, anth_id_style=anth_id_style)
 
     xml_files = [
@@ -163,7 +171,7 @@ def main(video_dir, anth_id_style):
     ]
 
     anth_ids_single, anth_ids_multiple = get_anth_ids(
-        video_dir=video_dir, anth_id_style=anth_id_style
+        video_dir=video_dir, anth_id_style=anth_id_style, video_type=video_type
     )
 
     for file in xml_files:
@@ -171,7 +179,9 @@ def main(video_dir, anth_id_style):
         tree = et.parse(os.path.join(DATA_DIR, file))
         for anth_id in anth_ids_single:
             if collection_id in anth_id:
-                add_video_tag_single(anth_id=anth_id, xml_parse=tree)
+                add_video_tag_single(
+                    anth_id=anth_id, xml_parse=tree, video_type=video_type
+                )
                 update_xml(
                     data_dir=DATA_DIR,
                     collection_id=collection_id,


Test patch: