|
|
|
|
|
by IgorPartola
789 days ago
|
|
Isn’t the solution to this particular problem to do what a human would do? I just tried this: Write me a short Python program that will count how many times a word occurs in a given text.
Sure, I can help you with that! Here's a short Python program that counts how many times a word occurs in a given text:
```python
def count_words(text, word):
words = > text.lower().split()
count = 0
for w in words:
if w == word.lower():
count += 1
return count
text = "Snapchat is a fun way to share moments with friends!"
word = "Snapchat"
result = count_words(text, word)
print(f"The word '{word}' occurs {result} times in the text.")
```
You can replace the `text` variable with your own text and the `word` variable with the word you want to count. Let me know if you have any questions!
Seems to me that if you give an LLM an environment to run said program it would be able to automatically do this with the correct prompt. This doesn’t solve the insurance policy problem at all but the solution to these problems is different in my opinion. |
|