SQL for NC_BIGRAMS_4
SELECT COUNT(*) AS freq
FROM biotext_annotation shallow
JOIN biotext_annotation word1 ON
shallow.pmid = word1.pmid AND
shallow.section = word1.section AND
shallow.sentence = word1.sentence AND
shallow.first_word_pos <= word1.first_word_pos
JOIN biotext_annotation word2 ON
shallow.pmid = word2.pmid AND
shallow.section = word2.section AND
shallow.sentence = word2.sentence AND
word1.last_word_pos = word2.first_word_pos AND
word2.last_word_pos <= shallow.last_word_pos
WHERE shallow.layer_id = 3
AND shallow.tag_type = 31
AND word1.layer_id = 1
AND word1.tag_type IN (27, 28, 29, 30)
AND word1.word_id IN (217291, 48437, 49764, 1248998)
AND word2.layer_id = 1
AND word2.tag_type IN (27, 28, 29, 30)
AND word2.word_id IN (43556, 45714, 1325075, 242403, 43610, 45717)
;